class IntervalShake
package funkin.effects
implements IFlxDestroyable
Available on all platforms
pretty much a copy of FlxFlicker geared towards making sprites shake around at a set interval and slow down over time.
Static methods
staticisShaking(Object:FlxObject):Bool
Returns whether the object is shaking or not.
Parameters:
Object | The object to test. |
|---|
staticshake(Object:FlxObject, Duration:Float = 1, Interval:Float = 0.04, StartIntensity:Float = 0, EndIntensity:Float = 0, Ease:EaseFunction, ?CompletionCallback:IntervalShake ‑> Void, ?ProgressCallback:IntervalShake ‑> Void):IntervalShake
An effect that shakes the sprite on a set interval and a starting intensity that goes down over time.
Parameters:
Object | The object to shake. |
|---|---|
Duration | How long to shake for (in seconds). |
Interval | In what interval to update the shake position. Set to |
StartIntensity | The starting intensity of the shake. |
EndIntensity | The ending intensity of the shake. |
Ease | Control the easing of the intensity over the shake. |
CompletionCallback | Callback on shake completion |
ProgressCallback | Callback on each shake interval |
Returns:
The IntervalShake object. IntervalShakes are pooled internally, so beware of storing references.
staticstopShaking(Object:FlxObject):Void
Stops shaking the object.
Parameters:
Object | The object to stop shaking. |
|---|
Variables
read onlyinitialOffset:FlxPoint
Defines the initial position of the object at the beginning of the shake effect.
read onlytimer:FlxTimer
The shaking timer. You can check how many seconds has passed since shaking started etc.
read onlycompletionCallback:IntervalShake ‑> Void
The callback that will be triggered after the shake has completed.
read onlyprogressCallback:IntervalShake ‑> Void
The callback that will be triggered every time the object shakes.