logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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
    object
    ScreenFlashEffect
    Implements
    IFeedbackEffect
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.Feedback.Application.Effects
    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
    Type Name Description
    float r
    float g
    float b
    float peakAlpha
    float durationSeconds
    IFeedbackCurve curve

    Fields

    B

    Declaration
    public readonly float B
    Field Value
    Type Description
    float

    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
    Type Description
    float

    G

    Declaration
    public readonly float G
    Field Value
    Type Description
    float

    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
    public readonly float R
    Field Value
    Type Description
    float

    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
    Type Description
    float

    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
    Type Description
    IFeedbackEffect

    A new, scaled effect of the same type.

    Implements

    IFeedbackEffect
    In this article
    © 2026 Serenity. All Rights Reserved