Tween

 

Props

NameTypeDefaultDescription
animate
TweenAnimation

 

callbackScope
any

Scope (this) for the callbacks. The default scope is the tween.

completeDelay
string number object Function any[]

The time the tween will wait before the onComplete event is dispatched once it has completed, in ms.

delay
number Function

The number of milliseconds to delay before the tween will start.

duration
number

The duration of the tween in milliseconds.

ease
"Linear" "Stepped" "Back" "Bounce" "Circular" "Cubic" "Elastic" "Expo" "Quadratic" "Quartic" "Quintic" "Sine" ((progress: number) => number)

The easing equation to use for the tween.

easeParams
any[]

Optional easing parameters.

exit
TweenAnimation

 

flipX
boolean

Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the flipX property.

flipY
boolean

Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the flipY property.

hold
number

The number of milliseconds to hold the tween for before yoyo’ing.

initial
TweenAnimation

 

loop
string number object Function any[]

The number of times the tween will repeat. (A value of 1 means the tween will play twice, as it repeated once.) The first loop starts after every property tween has completed once.

loopDelay
string number object Function any[]

The time the tween will pause before starting either a yoyo or returning to the start for a repeat.

offset
string number object Function any[]

Used when the Tween is part of a Timeline.

onActive
TweenOnActiveCallback

A function to call when the tween becomes active within the Tween Manager.

onActiveParams
any[]

Additional parameters to pass to onActive.

onActiveScope
any

Scope (this) for onActive.

onComplete
TweenOnCompleteCallback

A function to call when the tween completes.

onCompleteParams
any[]

Additional parameters to pass to onComplete.

onCompleteScope
any

Scope (this) for onComplete.

onLoop
TweenOnLoopCallback

A function to call each time the tween loops.

onLoopParams
any[]

Additional parameters to pass to onLoop.

onLoopScope
any

Scope (this) for onLoop.

onRepeat
TweenOnRepeatCallback

A function to call each time the tween repeats. Called once per property per target.

onRepeatParams
any[]

Additional parameters to pass to onRepeat.

onRepeatScope
any

Scope (this) for onRepeat.

onStart
TweenOnStartCallback

A function to call when the tween starts playback, after any delays have expired.

onStartParams
any[]

Additional parameters to pass to onStart.

onStartScope
any

Scope (this) for onStart.

onStop
TweenOnStopCallback

A function to call when the tween is stopped.

onStopParams
any[]

Additional parameters to pass to onStop.

onStopScope
any

Scope (this) for onStop.

onUpdate
TweenOnUpdateCallback

A function to call each time the tween steps. Called once per property per target.

onUpdateParams
any[]

Additional parameters to pass to onUpdate.

onUpdateScope
any

Scope (this) for onUpdate.

onYoyo
TweenOnYoyoCallback

A function to call each time the tween yoyos. Called once per property per target.

onYoyoParams
any[]

Additional parameters to pass to onYoyo.

onYoyoScope
any

Scope (this) for onYoyo.

repeat
number

The number of times each property tween repeats.

repeatDelay
number

The number of milliseconds to pause before a repeat.

useFrames
boolean

Use frames or milliseconds?

whileHover
TweenAnimation

 

whileTap
TweenAnimation

 

yoyo
boolean

Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take duration milliseconds to complete.