A tween class.

Available since

0.1.0

.

Static variables

@:value([])staticread onlytwVars:Array<TweenVar> = []

Contains all current tween processes.

Static methods

@:value({ type : LINEAR, duration : 1 })staticstart(from:Float, to:Float, duration:Float = 1, type:TweenType = LINEAR, ?onStep:(Float, Float, Float, TweenVar) ‑> Void):TweenVar

Starts a tweening process.

Parameters:

from

The value to tween from.

to

The value to tween to.

duration

The duration of the process, in seconds.

type

The nb.Tween.TweenType of the process.

onStep

A function that gets called at the end of each step. The first argument is the current value, the second argument the time elapsed, the the third argument the current t value, and the last argument the associated nb.Tween.TweenVar.

Returns:

An nb.Tween.TweenVar instance.

@:value({ type : LINEAR, duration : 1 })staticstartMultiple(from:Array<Float>, to:Array<Float>, duration:Float = 1, type:TweenType = LINEAR, ?onStep:(Array<Float>, Float, Float) ‑> Void):TweenVar

Starts a single process tweening multiple values.

Example: startMultiple([10,50],[0,100,25]) will tween 10 to 0 and 50 to 100. The 25 in the second array has no matching value in the first array so it is discarded.

Parameters:

from

The values to tween from.

to

The values to tween to.

duration

The duration of the process, in seconds.

type

The nb.Tween.TweenType of the process.

onStep

A function that gets called at the end of each step. The first argument is the current values, the second argument the time elapsed, and the third argument the current t value, and the last argument the associated nb.Tween.TweenVar.

Returns:

An nb.Tween.TweenVar instance.

staticupdate(dt:Float):Void