Class ScreenFlashEffect
Full-screen color flash. Curve shapes the alpha envelope over the duration
(normalized time 0..1 → 0..1, multiplied by PeakAlpha); when null a built-in
fast-rise/slow-fall hump is used. Driven on unscaled time so it is visible during a hit-stop.
Inheritance
ScreenFlashEffect
Assembly: Serenity.Feedback.Application.dll
Syntax
public sealed class ScreenFlashEffect : IFeedbackEffect
Constructors
ScreenFlashEffect(float, float, float, float, float, IFeedbackCurve)
Initializes a new instance.
Declaration
public ScreenFlashEffect(float r, float g, float b, float peakAlpha, float durationSeconds, IFeedbackCurve curve = null)
Parameters
Fields
B
Declaration
Field Value
Curve
Declaration
public readonly IFeedbackCurve Curve
Field Value
| Type |
Description |
| IFeedbackCurve |
Optional alpha envelope over normalized time; null uses the built-in hump.
|
DurationSeconds
Declaration
public readonly float DurationSeconds
Field Value
G
Declaration
Field Value
Kind
Declaration
public const string Kind = "screen_flash"
Field Value
| Type |
Description |
| string |
Stable kind id for this effect.
|
PeakAlpha
Declaration
public readonly float PeakAlpha
Field Value
| Type |
Description |
| float |
Peak opacity (0..1). Scaled by global intensity.
|
R
Declaration
Field Value
Properties
BypassesGlobalGate
Declaration
public bool BypassesGlobalGate { get; }
Property Value
| Type |
Description |
| bool |
When true, this effect ignores the global vibration enable/intensity settings — it is
dispatched even when feedback is disabled and is never passed through Scaled(float).
Reserved for non-haptic effects (e.g. audio) that must not be silenced or attenuated by the
controller-vibration toggle. Haptic effects return false.
|
EffectKind
Declaration
public string EffectKind { get; }
Property Value
| Type |
Description |
| string |
Stable identifier of the effect type (e.g. "vibration"). Used for logging/diagnostics.
|
Methods
EnvelopeAt(float)
Evaluates the alpha envelope (0..1) at normalized time t. Uses the authored
Curve when present; otherwise a smooth sine hump (0 → 1 → 0).
Declaration
public float EnvelopeAt(float t)
Parameters
| Type |
Name |
Description |
| float |
t |
|
Returns
Scaled(float)
Returns a copy of this effect scaled by the global intensity multiplier (0..1).
Declaration
public IFeedbackEffect Scaled(float globalIntensity)
Parameters
| Type |
Name |
Description |
| float |
globalIntensity |
Global multiplier; values outside 0..1 are clamped by the effect.
|
Returns
Implements