Base class for all tweening operations.


Variable Name Type Description
playOnAwake boolean If set to be true, the tween will automatically start playing on awake.
flag string The flag of tween.
style int Does it play once? Does it loop? Value: Tween.STYLE_ONCE(Play Once)、Tween.STYLE_LOOP(Loop the tween)、Tween.STYLE_PINGPONG(Pingpong the tween)
curve qc.BezierCurve Curve of tween.
delay number How long will the tweener wait before starting the tween? Unit: second.
duration number How long is the duration of the tween? Unit: second.
tweenGroup int Used by buttons and tween sequences. Group of '0' means not in a sequence.


Event Description
onStart When the animation starts, this event is triggered.
onFinished When the animation finishes, this event is triggered.
onLoopFinished When the animation finishes a loop, this event is triggered.


Method Description
playForward Play the tween forward.
playGroupForward Play the tweens with same 'tweenGroup' forward.
playReverse Play the tween in reverse.
playGroupReverse Play the tweens with same 'tweenGroup' in reverse.
stop Stop the tween.
stopGroup Stop the tweens with same 'tweenGroup'.
resetToBeginning Manually reset the tweener's state to the beginning. If the tween is playing forward, this means the tween's start. If the tween is playing in reverse, this means the tween's end.
resetGroupToBeginning Manually reset the tweener's state with same 'TweenGroup' to the beginning.


Tween Animation