| Name | Type | Description |
|---|---|---|
target |
* |
Target object to tween |
manager |
PIXI.tween.TweenManager |
optional
Tween manager to handle this tween |
config |
PIXI.tween.Tween#tweenConfig |
optional
object to configure the tween |
Members
-
readonlyactiveboolean
-
True if the tween is running
-
delaynumber
-
Set a delay time in milliseconds before the tween starts
-
easingPIXI.tween.Easing
-
Either an easing function from PIXI.tween.Easing or a custom easing
-
readonlyelapsedTimenumber
-
How much time has passed on an active tween
-
readonlyisEndedboolean
-
True if a tween has ended running
-
readonlyisStartedboolean
-
True if the tween has started running
-
loopboolean
-
Set true if you want to loop this tween forever
-
Set an instance of TweenPath to animate an object along the path
-
pathReverseboolean
-
Set true to reverse the direction along the path
-
pingPongboolean
-
Set true to repeat the tween from the end point back to the start point
-
readonlyprogressnumber
-
0-1 decimal value representing proportion of completion
-
repeatnumber
-
Times to repeat this tween
-
speednumber
-
The speed that the tween will play at. 0 effectively pauses it, 1 is normal speed
-
timenumber
-
How long to animate this tween over
Methods
-
chain(tween){PIXI.tween.Tween}
-
Chain another tween to play after this tween has ended
Name Type Description tweenPIXI.tween.Tween Tween to chain
Returns:
Type Description PIXI.tween.Tween - This tween instance
-
clear(){PIXI.tween.Tween}
-
Clears all class data, meaning that the tween will now do nothing if start is called
Returns:
Type Description PIXI.tween.Tween - This tween instance
-
config(config){PIXI.tween.Tween}
-
Configures the tween via a config object
Name Type Description configPIXI.tween.Tween#tweenConfig object to configure the tween
Returns:
Type Description PIXI.tween.Tween - This tween instance
-
from(data){PIXI.tween.Tween}
-
Set the start point data for the tween.
If nothing is set, data is reset so that starting the tween will use the objects current state as the start pointName Type Description dataObject optional Object containing start point data for the tween
Returns:
Type Description PIXI.tween.Tween - This tween instance
Example
tween.from({ x:50, y:50 }); -
remove(){PIXI.tween.Tween}
-
Remove the tween from the manager if it has one
Returns:
Type Description PIXI.tween.Tween - This tween instance
-
reset(){PIXI.tween.Tween}
-
Resets the tween to it's default state, but keeping any to and from data, so start can be called to replay the tween
Returns:
Type Description PIXI.tween.Tween - This tween instance
-
start(resolve){PIXI.tween.Tween}
-
Starts the tween
Name Type Description resolvePromise Promise to resolve when the tween has ended
Returns:
Type Description PIXI.tween.Tween - This tween instance
-
Starts the tween, whilst returning a new promise
Returns:
Type Description Promise - Promsie that will resolve when the tween has finished
-
stop(end){PIXI.tween.Tween}
-
Stop the tweens progress
Name Type Default Description endboolean false optional Force end to be called
Fires:
Returns:
Type Description PIXI.tween.Tween - This tween instance
-
to(data){PIXI.tween.Tween}
-
Set the end data for the tween
Name Type Description dataObject Object containing end point data for the tween
Returns:
Type Description PIXI.tween.Tween - This tween instance
Example
tween.to({ x:100, y:100 }); -
Updating of the tween; usually automatically called by its manager
Name Type Description deltaMSnumber Time elapsed in milliseconds from last update to this update.
Fires:
Type Definitions
-
tweenConfigObject
-
Quickly configure a tween via an object / json
Properties:
Name Type Argument Description fromObject <optional>
toObject <optional>
delaynumber <optional>
easingfunction | string <optional>
loopboolean <optional>
pathObject <optional>
pathReverseboolean <optional>
pingPongboolean <optional>
repeatnumber <optional>
timenumber <optional>
speednumber <optional>
onObject <optional>
Properties
Name Type Argument Description endfunction <optional>
pingpongfunction <optional>
repeatfunction <optional>
startfunction <optional>
stopfunction <optional>
updatefunction <optional>
Events
-
Fired when the tween is over. If the .loop option it's true, this event never will be fired.
If the tween has an .repeat number, this event will be fired just when all the repeats are done. -
If the pingPong option it's true, this events will be fired when the tweens returns back.
-
Fired at every repeat cycle, if your tween has .repeat=5 this events will be fired 5 times.
Name Type Description repeatnumber Number of times this tween has repeated
-
Fired when the tween starts. If the tween has a delay, this event fires when the delay time is ended.
-
Fired only when it's used the .stop() method. It's useful to know when a timer is cancelled.
-
Fired at each frame
Name Type Description progressnumber 0-1 decimal value representing proportion of completion.
elapsedTimenumber How much time in ms that has passed since the tween started.