Class ScreenShakeEffect
Camera screen shake: a decaying positional jitter over a duration. Amplitude is scaled by global intensity (so a "reduce motion" / lower-intensity setting calms it). Camera only — for UI shake use UiScreenShakeEffect.
Implements
Inherited Members
Namespace: Serenity.Feedback.Application.Effects
Assembly: Serenity.Feedback.Application.dll
Syntax
public sealed class ScreenShakeEffect : IFeedbackEffect
Constructors
ScreenShakeEffect(float, float, float, bool)
Initializes a new instance.
Declaration
public ScreenShakeEffect(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 (world 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 = "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. |