Tweens a color's red, green, and blue properties independently. Can also tween an alpha value.

Constructor

new(Options:TweenOptions, ?manager:FlxTweenManager)

Variables

read onlycolor:FlxColor

read onlysprite:FlxSprite

Optional sprite object whose color to tween

Methods

destroy():Void

Clean up references

tween(Duration:Float, FromColor:FlxColor, ToColor:FlxColor, ?Sprite:FlxSprite):ColorTween

Tweens the color to a new color and an alpha to a new alpha.

Parameters:

Duration

Duration of the tween.

FromColor

Start color.

ToColor

End color.

Sprite

Optional sprite object whose color to tween.

Returns:

The ColorTween.

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

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.