# CrosshairReaction record

> How a crosshair moves when it reacts to something: how far it spreads and how much it dims at its peak, and how it gets there and back. A style's record holds its reactions to events in its on table, and a Plugin can play or hold one of its own.

Namespace `EvilEngine.Formats.Records`, assembly `EvilEngine.Formats`. Engine commit 4ff877b1.

```csharp
public sealed record CrosshairReaction
```

How a crosshair moves when it reacts to something: how far it spreads and how much it dims at its peak, and how it gets there and back. A style's record holds its reactions to events in its `on` table, and a Plugin can [play](/docs/api/icrosshair#play) or [hold](/docs/api/icrosshair#hold) one of its own.

Reactions playing at once add their spreads, up to the largest [Max](#max) among them, and multiply their dimming, so shots fired faster than they settle widen the crosshair to its cap and it tightens as each recovers.

```toml
[crosshair."crosshair/rifle".on.shot]
spread = 4
attack = 0.03
release = 0.35
max = 14
```

## Members

### CrosshairReaction (constructor)

```csharp
public CrosshairReaction()
```

Makes a reaction that does nothing, over 0.2 s, for setting what you need.

### Spread (property)

```csharp
public double Spread { get; init; }
```

How far the classic cross's arms move out at the peak, in the style's lengths, scaled as its gap is. An image or a glyph doesn't spread.

### Opacity (property)

```csharp
public double Opacity { get; init; }
```

The share of its alpha the crosshair keeps at the peak, from 0, gone, to 1, unchanged. 1 unless set.

### Attack (property)

```csharp
public double Attack { get; init; }
```

Seconds rising to the peak.

### Hold (property)

```csharp
public double Hold { get; init; }
```

Seconds at the peak before easing back.

### Release (property)

```csharp
public double Release { get; init; }
```

Seconds easing back. 0.2 unless set.

### Max (property)

```csharp
public double? Max { get; init; }
```

The most the spread of every playing reaction adds up to, or `null` for no cap.

### Ease (property)

```csharp
public CrosshairEase Ease { get; init; }
```

The [shape](/docs/api/crosshairease) of the rise and the fall. [Smooth](/docs/api/crosshairease#smooth) unless set.

### Length (property)

```csharp
public double Length { get; }
```

[Attack](#attack), [Hold](#hold) and [Release](#release) together: how long the reaction plays.
