Shake effect for a FlxSprite

Constructor

new(Options:TweenOptions, ?manager:FlxTweenManager)

Methods

@:value({ Axes : XY, Duration : 1, Intensity : 0.05 })tween(Sprite:FlxSprite, Intensity:Float = 0.05, Duration:Float = 1, Axes:FlxAxes = XY):ShakeTween

A simple shake effect for FlxSprite.

Parameters:

Sprite

Sprite to shake.

Intensity

Percentage representing the maximum distance that the sprite can move while shaking.

Duration

The length in seconds that the shaking effect should last.

Axes

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

Inherited Variables

Defined by FlxTween

@:value(false)active:Bool = false

read onlybackward:Bool

@:value(0)duration:Float = 0

@:value(0)read onlyexecutions:Int = 0

How many times this tween has been executed / has finished so far - useful to stop the LOOPING and PINGPONG types after a certain amount of time

read onlyfinished:Bool

@:value(0)loopDelay:Float = 0

Seconds to wait between loops of this tween, 0 by default

manager:FlxTweenManager

The manager to which this tween belongs

Available since

4.2.0

.

percent:Float

Value between 0 and 1 that indicates how far along this tween is in its completion. A value of 0.33 means that the tween is 33% complete.

@:value(0)read onlyscale:Float = 0

@:value(0)startDelay:Float = 0

Seconds to wait until starting this tween, 0 by default

read onlytime:Float

The total time passed since start

Available since

5.7.0

.

Inherited Methods

Defined by FlxTween

cancel():Void

Immediately stops the Tween and removes it from its manager without calling the onComplete callback.

Yields control to the next chained Tween if one exists.

cancelChain():Void

Immediately stops the Tween and removes it from its manager without calling the onComplete callback or yielding control to the next chained Tween if one exists.

If control has already been passed on, forwards the cancellation request along the chain to the currently active Tween.

Available since

4.3.0

.

start():FlxTween

Starts the Tween, or restarts it if it's currently running.

then(tween:FlxTween):FlxTween

Specify a tween to be executed when this one has finished (useful for creating "tween chains").

wait(delay:Float):FlxTween

How many seconds to delay the execution of the next tween in a tween chain.