This will shake the bitmapData.

Constructor

@:value({ Duration : 0.5, Intensity : 5 })new(Intensity:Float = 5, Duration:Float = 0.5, ?OnComplete:() ‑> Void, ?Axes:FlxAxes)

A shake effect.

Parameters:

Intensity

Value in pixels representing the maximum distance that the bitmapData can move while shaking.

Duration

The length in seconds that the shaking effect should last.

OnComplete

Optional completion callback function.

Axes

On what axes to shake. Default value is XY / both.

Variables

@:value(true)active:Bool = true

@:value(XY)axes:FlxAxes = XY

On what axes to shake.

@:value(0)intensity:Float = 0

Value in pixels representing the maximum distance that the bitmapData can move while shaking.

@:value(FlxPoint.get())read onlyoffset:FlxPoint = FlxPoint.get()

onComplete:() ‑> Void

A function you want to run when the shake finishes.

Methods

@:value({ Duration : 0.5, Intensity : 5 })reset(Intensity:Float = 5, Duration:Float = 0.5, ?OnComplete:() ‑> Void, ?Axes:FlxAxes):Void

Reset the effect, need to set the parameters again. To use the same parameters call method start().

Parameters:

Intensity

Value in pixels representing the maximum distance that the bitmapData can move while shaking.

Duration

The length in seconds that the shaking effect should last.

OnComplete

Optional completion callback function.

Axes

On what axes to shake. Default value is XY / both.

@:value({ Force : false })start(Force:Bool = false):Void

Reset and start the effect with the same parameters.

Parameters:

Force

Force the effect to reset.

update(elapsed:Float):Void