Module hilo/tween/Tween
Requires
hilo/core/Class
Source
Tween.js
Tween class makes tweening (easing, slow motion).
Demo:
ticker.addTick(Hilo.Tween);//Tween works after being added to ticker var view = new View({x:5, y:10}); Hilo.Tween.to(view, { x:100, y:20, alpha:0 }, { duration:1000, delay:500, ease:Hilo.Ease.Quad.EaseIn, onComplete:function(){ console.log('complete'); } });
Property | Defined | |
---|---|---|
delay:Int
Tweenning delay time, measure in ms.
|
Tween | |
duration:Int
Tweening duration, measure in ms.
|
Tween | |
ease:Function
Tweening transform function, default value is null.
|
Tween | |
loop:Boolean
Does tweening loop, default value is false.
|
Tween | |
onComplete:Function
Function invoked on the end of tweening.
|
Tween | |
onStart:Function
Function invoked on the beginning of tweening.
|
Tween | |
onUpdate:Function
Function invoked on tweening update.
|
Tween | |
paused:Boolean
Is tweening paused, default value is false.
|
Tween | |
repeat:Int
Repeat times of tweening, default value is 0.
|
Tween | |
repeatDelay:Int
Delay time of repeating tweening, measure in ms.
|
Tween | |
reverse:Boolean
Does tweening reverse, default value is false.
|
Tween | |
target:Object
Tween target object, readonly!
|
Tween | |
time:Int
Time that tweening taken, measure in ms, readonly!
|
Tween |
Method | Defined | |
---|---|---|
Tween(target:Object, fromProps:Object, toProps:Object, params:Object)
Constructor
|
Tween | |
Link next Tween.
|
Tween | |
pause():Tween
Pause the tweening.
|
Tween | |
resume():Tween
Continue to play the tweening.
|
Tween | |
seek(time:Number, pause:Boolean):Tween
Tween jumps to some point.
|
Tween | |
setProps(fromProps:Object, toProps:Object):Tween
Set beginning properties and ending properties of tweening object.
|
Tween | |
start():Tween
Starting the tweening.
|
Tween | |
stop():Tween
Stop the tweening.
|
Tween | |
tick():Object
static
Update all Tween instances.
|
Tween | |
static
Add a Tween instance.
|
Tween | |
static
Remove one Tween target.
|
Tween | |
removeAll():Object
static
Remove all Tween instances.
|
Tween | |
fromTo(target:Object|Array, fromProps, toProps, params):Tween|Array
static
Create a tween, make target object easing from beginning properties to ending properties.
|
Tween | |
to(target:Object|Array, toProps, params):Tween|Array
static
Create a tween, make target object easing from current properties to ending properties.
|
Tween | |
from(target:Object|Array, fromProps, params):Tween|Array
static
Create a tween, make target object easing from beginning properties to current properties.
|
Tween |