Indice
Easing Functions
All Easing functions are mapped on the tween table.
- tween.count()
- tween.reset(id)
- tween.resetAll()
- tween.start(time, subject, target, easing, callback, …)
- tween.stop(id, callback)
- tween.stopAll(callback)
- tween.update(dt)
- tween.TEST()
tween.count()
count = tween.count()
Returns how many tweens are running.
OUTPUT
- count : Number of running tweens
tween.reset(id)
tween.reset(tweenId)
Reset, and stop, the given running tween.
INPUT
- id : The id of the tween we want to reset
tween.resetAll()
tween.resetAll()
Reset, and stop, all running tweens.
tween.start(time, subject, target, easing, callback, ...)
tweenId = tween.start(time, subject, target, easing, callback, ...)
Start a new tween and returns its id.
INPUT
- time : Transition time in milliseconds
- subject : Table where the transition target(s) are defined
- target : A table with one or more targets and their final values
- easing : String with the easing formula name
- callback : Function to call when the transition ends
- … : Additional variables to pass to the callback function at the end of the transition
OUTPUT
- tweenId : Id of the initialized tween
NOTES
Have a look here for all recognized easing functions.
tween.stop(id, callback)
tween.stop(id, callback)
Stops the given running tween.
INPUT
- id : Id of the tween we want to stop
- callback : Set this argument to TRUE if you want to execute the associated callback function like if the tween was naturally ended.
tween.stopAll(callback)
tween.stopAll()
Stops all running tweens
tween.update(dt)
tween.update(dt)
Update all running tweens evaluating the given 'dt' delta time.
INPUT
- dt : Delta time in milliseconds, it is the time passed between the last update and this exact moment.
tween.TEST()
This program shows how to use tweens and will test all tween functions. It also uses recursive callback functions to build tween chains.