Skip to content
EvilEngine.Formats.Records

CrosshairReaction record

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 or hold one of its own.

Reactions playing at once add their spreads, up to the largest 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.

[crosshair."crosshair/rifle".on.shot]
spread = 4
attack = 0.03
release = 0.35
max = 14
Assembly
EvilEngine.Formats
Commit
4ff877b1

Members

CrosshairReaction constructor

public CrosshairReaction()

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

Spread property

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

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

public double Attack { get; init; }

Seconds rising to the peak.

Hold property

public double Hold { get; init; }

Seconds at the peak before easing back.

Release property

public double Release { get; init; }

Seconds easing back. 0.2 unless set.

Max property

public double? Max { get; init; }

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

Ease property

public CrosshairEase Ease { get; init; }

The shape of the rise and the fall. Smooth unless set.

Length property

public double Length { get; }

Attack, Hold and Release together: how long the reaction plays.