logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UiScreenShakeEffect

    UI screen shake: a decaying jitter applied to active UI shake receivers (menus, HUD) — the screen-space counterpart to ScreenShakeEffect, which shakes the camera. Amplitude is scaled by global intensity (so a "reduce motion" / lower-intensity setting calms it).

    Inheritance
    object
    UiScreenShakeEffect
    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 UiScreenShakeEffect : IFeedbackEffect

    Constructors

    UiScreenShakeEffect(float, float, float, bool)

    Initializes a new instance.

    Declaration
    public UiScreenShakeEffect(float amplitude, float frequency, float durationSeconds, bool haveExitTime = true)
    Parameters
    Type Name Description
    float amplitude
    float frequency
    float durationSeconds
    bool haveExitTime

    Fields

    Amplitude

    Declaration
    public readonly float Amplitude
    Field Value
    Type Description
    float

    Peak positional offset magnitude (UI units). Scaled by global intensity.

    DurationSeconds

    Declaration
    public readonly float DurationSeconds
    Field Value
    Type Description
    float

    Frequency

    Declaration
    public readonly float Frequency
    Field Value
    Type Description
    float

    Jitter frequency (Hz-ish), how rapidly the offset changes.

    HaveExitTime

    Declaration
    public readonly bool HaveExitTime
    Field Value
    Type Description
    bool

    When true the shake decays to zero over its duration and stops; when false it sustains at constant amplitude until another effect overwrites it (e.g. a zero-amplitude shake).

    Kind

    Declaration
    public const string Kind = "ui_screen_shake"
    Field Value
    Type Description
    string

    Stable kind id for this effect.

    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

    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