Contains information about a tweening process.

Available since

0.1.0

.

Constructor

new(startV:Float, to:Float, tMax:Float)

Creates an nb.Tween.TweenVar instance.

Parameters:

startV

The starting value.

to

The destination value.

tMax

The tweening duration.

Variables

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

Time elpased, in seconds.

read onlystartV:Float

The starting value.

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

The t value, between 0 and 1.

read onlytMax:Float

The total time the tweening operation will take.

read onlyto:Float

The destination value.

read onlyv:Float

The current value.

Methods

end():Void

Sets the current value to the destination value and ends the tweening process.

dynamicformula():Float

The function that is in charge of returning the t values.

dynamiconStep(v:Float, realT:Float, t:Float, tVar:TweenVar):Void

A function called at the end of every step.

step(dt:Float):Bool

Calculates the next value.

Parameters:

dt

Time elapsed in seconds.

Returns:

true if the tweening process ended, false otherwise.