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 tween
PIXI.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 config
PIXI.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 data
Object 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 resolve
Promise 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 end
boolean 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 data
Object 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 deltaMS
number 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 from
Object <optional>
to
Object <optional>
delay
number <optional>
easing
function | string <optional>
loop
boolean <optional>
path
Object <optional>
pathReverse
boolean <optional>
pingPong
boolean <optional>
repeat
number <optional>
time
number <optional>
speed
number <optional>
on
Object <optional>
Properties
Name Type Argument Description end
function <optional>
pingpong
function <optional>
repeat
function <optional>
start
function <optional>
stop
function <optional>
update
function <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 repeat
number 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 progress
number 0-1 decimal value representing proportion of completion.
elapsedTime
number How much time in ms that has passed since the tween started.