name | type | arguments | Default | description |
---|---|---|---|---|
targets | object | Array.<object> |
The object, or an array of objects, to run the tween on. |
||
delay | number | <optional> | 0 |
The number of milliseconds to delay before the tween will start. |
duration | number | <optional> | 1000 |
The duration of the tween in milliseconds. |
ease | string | <optional> | 'Power0' |
The easing equation to use for the tween. |
easeParams | array | <optional> |
Optional easing parameters. |
|
hold | number | <optional> | 0 |
The number of milliseconds to hold the tween for before yoyo'ing. |
repeat | number | <optional> | 0 |
The number of times to repeat the tween. |
repeatDelay | number | <optional> | 0 |
The number of milliseconds to pause before a tween will repeat. |
yoyo | boolean | <optional> | false |
Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take |
flipX | boolean | <optional> | false |
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 |
flipY | boolean | <optional> | false |
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 |
persist | boolean | <optional> | false |
Retain the tween within the Tween Manager, even after playback completes? |
interpolation | function | <optional> | null |
The interpolation function to use for array-based tween values. |
A Tween Event.
name | type | description |
---|---|---|
target | any |
The tween target. |
key | string |
The target property. |
value | number |
The current value of the target property. |
targetIndex | number |
The index of the target within the Tween. |
totalTargets | number |
The total number of targets in this Tween. |
tween | Phaser.Tweens.Tween |
The Tween that invoked this callback. |
name | type | description |
---|---|---|
target | any |
The tween target. |
key | string |
The target property. |
value | number |
The current value of the target property. |
targetIndex | number |
The index of the target within the Tween. |
totalTargets | number |
The total number of targets in this Tween. |
tween | Phaser.Tweens.Tween |
The Tween that invoked this callback. |
name | type | description |
---|---|---|
target | any |
The tween target. |
key | string |
The target property. |
value | number |
The current value of the target property. |
targetIndex | number |
The index of the target within the Tween. |
totalTargets | number |
The total number of targets in this Tween. |
tween | Phaser.Tweens.Tween |
The Tween that invoked this callback. |
name | type | arguments | Default | description |
---|---|---|---|---|
from | number | <optional> | 0 |
The start number. |
to | number | <optional> | 1 |
The end number. |
delay | number | <optional> | 0 |
The number of milliseconds to delay before the counter will start. |
duration | number | <optional> | 1000 |
The duration of the counter in milliseconds. |
ease | string | function | <optional> | 'Power0' |
The easing equation to use for the counter. |
easeParams | array | <optional> |
Optional easing parameters. |
|
hold | number | <optional> | 0 |
The number of milliseconds to hold the counter for before yoyo'ing. |
repeat | number | <optional> | 0 |
The number of times to repeat the counter. |
repeatDelay | number | <optional> | 0 |
The number of milliseconds to pause before the counter will repeat. |
yoyo | boolean | <optional> | false |
Should the counter play forward to the end value and then backwards to the start? The reverse playback will also take |
completeDelay | string | number | function | object | array | <optional> | 0 |
The time the counter will wait before the onComplete event is dispatched once it has completed, in ms. |
loop | string | number | function | object | array | <optional> | 0 |
The number of times the counter will repeat. (A value of 1 means the counter will play twice, as it repeated once.) |
loopDelay | string | number | function | object | array | <optional> | 0 |
The time the counter will pause before starting either a yoyo or returning to the start for a repeat. |
paused | boolean | <optional> | false |
Does the counter start in a paused state (true) or playing (false)? |
callbackScope | any | <optional> |
Scope (this) for the callbacks. The default scope is the counter. |
|
onComplete | Phaser.Types.Tweens.TweenOnCompleteCallback | <optional> |
A function to call when the counter completes. |
|
onCompleteParams | array | <optional> |
Additional parameters to pass to |
|
onLoop | Phaser.Types.Tweens.TweenOnLoopCallback | <optional> |
A function to call each time the counter loops. |
|
onLoopParams | array | <optional> |
Additional parameters to pass to |
|
onRepeat | Phaser.Types.Tweens.TweenOnRepeatCallback | <optional> |
A function to call each time the counter repeats. |
|
onRepeatParams | array | <optional> |
Additional parameters to pass to |
|
onStart | Phaser.Types.Tweens.TweenOnStartCallback | <optional> |
A function to call when the counter starts. |
|
onStartParams | array | <optional> |
Additional parameters to pass to |
|
onStop | Phaser.Types.Tweens.TweenOnStopCallback | <optional> |
A function to call when the counter is stopped. |
|
onStopParams | array | <optional> |
Additional parameters to pass to |
|
onUpdate | Phaser.Types.Tweens.TweenOnUpdateCallback | <optional> |
A function to call each time the counter steps. |
|
onUpdateParams | array | <optional> |
Additional parameters to pass to |
|
onYoyo | Phaser.Types.Tweens.TweenOnYoyoCallback | <optional> |
A function to call each time the counter yoyos. |
|
onYoyoParams | array | <optional> |
Additional parameters to pass to |
|
onPause | Phaser.Types.Tweens.TweenOnPauseCallback | <optional> |
A function to call when the counter is paused. |
|
onPauseParams | array | <optional> |
Additional parameters to pass to |
|
onResume | Phaser.Types.Tweens.TweenOnResumeCallback | <optional> |
A function to call when the counter is resumed after being paused. |
|
onResumeParams | array | <optional> |
Additional parameters to pass to |
|
persist | boolean | <optional> |
Will the counter be automatically destroyed on completion, or retained for future playback? |
|
interpolation | string | function | <optional> |
The interpolation function to use if the |
name | type | arguments | Default | description |
---|---|---|---|---|
start | number | <optional> | 0 |
The value to start the stagger from. Can be used as a way to offset the stagger while still using a range for the value. |
ease | string | function | <optional> | 'Linear' |
An ease to apply across the staggered values. Can either be a string, such as 'sine.inout', or a function. |
from | string | number | <optional> | 0 |
The index to start the stagger from. Can be the strings |
grid | Array.<number> | <optional> |
Set the stagger to run across a grid by providing an array where element 0 is the width of the grid and element 1 is the height. Combine with the 'from' property to control direction. |
name | type | arguments | Default | description |
---|---|---|---|---|
targets | any |
The object, or an array of objects, to run the tween on. |
||
delay | number | function | <optional> | 0 |
The number of milliseconds to delay before the tween will start. |
duration | number | <optional> | 1000 |
The duration of the tween in milliseconds. |
ease | string | function | <optional> | 'Power0' |
The easing equation to use for the tween. |
easeParams | array | <optional> |
Optional easing parameters. |
|
hold | number | <optional> | 0 |
The number of milliseconds to hold the tween for before yoyo'ing. |
repeat | number | <optional> | 0 |
The number of times each property tween repeats. |
repeatDelay | number | <optional> | 0 |
The number of milliseconds to pause before a repeat. |
yoyo | boolean | <optional> | false |
Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take |
flipX | boolean | <optional> | false |
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 |
flipY | boolean | <optional> | false |
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 |
completeDelay | string | number | function | object | array | <optional> | 0 |
The time the tween will wait before the onComplete event is dispatched once it has completed, in ms. |
loop | string | number | function | object | array | <optional> | 0 |
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 in the tween has completed once. |
loopDelay | string | number | function | object | array | <optional> | 0 |
The time the tween will pause before starting either a yoyo or returning to the start for a repeat. |
paused | boolean | <optional> | false |
Does the tween start in a paused state (true) or playing (false)? |
props | Object.<string, (number|string|Phaser.Types.Tweens.GetEndCallback|Phaser.Types.Tweens.TweenPropConfig)> | <optional> |
The properties to tween. |
|
callbackScope | any | <optional> |
The scope (or context) for all of the callbacks. The default scope is the tween. |
|
onComplete | Phaser.Types.Tweens.TweenOnCompleteCallback | <optional> |
A function to call when the tween completes. |
|
onCompleteParams | array | <optional> |
Additional parameters to pass to |
|
onLoop | Phaser.Types.Tweens.TweenOnLoopCallback | <optional> |
A function to call each time the tween loops. |
|
onLoopParams | array | <optional> |
Additional parameters to pass to |
|
onRepeat | Phaser.Types.Tweens.TweenOnRepeatCallback | <optional> |
A function to call each time a property tween repeats. Called once per property per target. |
|
onRepeatParams | array | <optional> |
Additional parameters to pass to |
|
onStart | Phaser.Types.Tweens.TweenOnStartCallback | <optional> |
A function to call when the tween starts playback, after any delays have expired. |
|
onStartParams | array | <optional> |
Additional parameters to pass to |
|
onStop | Phaser.Types.Tweens.TweenOnStopCallback | <optional> |
A function to call when the tween is stopped. |
|
onStopParams | array | <optional> |
Additional parameters to pass to |
|
onUpdate | Phaser.Types.Tweens.TweenOnUpdateCallback | <optional> |
A function to call each time the tween steps. Called once per property per target. |
|
onUpdateParams | array | <optional> |
Additional parameters to pass to |
|
onYoyo | Phaser.Types.Tweens.TweenOnYoyoCallback | <optional> |
A function to call each time a property tween yoyos. Called once per property per target. |
|
onYoyoParams | array | <optional> |
Additional parameters to pass to |
|
onActive | Phaser.Types.Tweens.TweenOnActiveCallback | <optional> |
A function to call when the tween becomes active within the Tween Manager. |
|
onActiveParams | array | <optional> |
Additional parameters to pass to |
|
onPause | Phaser.Types.Tweens.TweenOnPauseCallback | <optional> |
A function to call when the tween is paused. |
|
onPauseParams | array | <optional> |
Additional parameters to pass to |
|
onResume | Phaser.Types.Tweens.TweenOnResumeCallback | <optional> |
A function to call when the tween is resumed after being paused. |
|
onResumeParams | array | <optional> |
Additional parameters to pass to |
|
persist | boolean | <optional> |
Will the Tween be automatically destroyed on completion, or retained for future playback? |
|
interpolation | string | function | <optional> |
The interpolation function to use if the |
name | type | arguments | description |
---|---|---|---|
onActive | Phaser.Types.Tweens.TweenOnActiveCallback | <optional> |
A function to call when the tween becomes active within the Tween Manager. |
onStart | Phaser.Types.Tweens.TweenOnStartCallback | <optional> |
A function to call when the tween starts playback, after any delays have expired. |
onComplete | Phaser.Types.Tweens.TweenOnCompleteCallback | <optional> |
A function to call when the tween completes. |
onLoop | Phaser.Types.Tweens.TweenOnLoopCallback | <optional> |
A function to call each time the tween loops. |
onPause | Phaser.Types.Tweens.TweenOnPauseCallback | <optional> |
A function to call each time the tween is paused. |
onResume | Phaser.Types.Tweens.TweenOnResumeCallback | <optional> |
A function to call each time the tween is resumed. |
onRepeat | Phaser.Types.Tweens.TweenOnRepeatCallback | <optional> |
A function to call each time the tween repeats. Called once per property per target. |
onStop | Phaser.Types.Tweens.TweenOnStopCallback | <optional> |
A function to call when the tween is stopped. |
onUpdate | Phaser.Types.Tweens.TweenOnUpdateCallback | <optional> |
A function to call each time the tween steps. Called once per property per target. |
onYoyo | Phaser.Types.Tweens.TweenOnYoyoCallback | <optional> |
A function to call each time the tween yoyos. Called once per property per target. |
name | type | arguments | Default | description |
---|---|---|---|---|
targets | any |
The object, or an array of objects, to run each tween on. |
||
delay | number | function | <optional> | 0 |
The number of milliseconds to delay before the chain will start. |
completeDelay | string | number | function | object | array | <optional> | 0 |
The time the chain will wait before the onComplete event is dispatched once it has completed, in ms. |
loop | string | number | function | object | array | <optional> | 0 |
The number of times the chain will repeat. (A value of 1 means the chain will play twice, as it repeated once.) The first loop starts after every tween has completed once. |
loopDelay | string | number | function | object | array | <optional> | 0 |
The time the chain will pause before returning to the start for a repeat. |
paused | boolean | <optional> | false |
Does the chain start in a paused state (true) or playing (false)? |
tweens | Array.<Phaser.Types.Tweens.TweenBuilderConfig> | <optional> |
The tweens to chain together. |
|
callbackScope | any | <optional> |
The scope (or context) for all of the callbacks. The default scope is the chain. |
|
onComplete | Phaser.Types.Tweens.TweenOnCompleteCallback | <optional> |
A function to call when the chain completes. |
|
onCompleteParams | array | <optional> |
Additional parameters to pass to |
|
onLoop | Phaser.Types.Tweens.TweenOnLoopCallback | <optional> |
A function to call each time the chain loops. |
|
onLoopParams | array | <optional> |
Additional parameters to pass to |
|
onStart | Phaser.Types.Tweens.TweenOnStartCallback | <optional> |
A function to call when the chain starts playback, after any delays have expired. |
|
onStartParams | array | <optional> |
Additional parameters to pass to |
|
onStop | Phaser.Types.Tweens.TweenOnStopCallback | <optional> |
A function to call when the chain is stopped. |
|
onStopParams | array | <optional> |
Additional parameters to pass to |
|
onActive | Phaser.Types.Tweens.TweenOnActiveCallback | <optional> |
A function to call when the chain becomes active within the Tween Manager. |
|
onActiveParams | array | <optional> |
Additional parameters to pass to |
|
onPause | Phaser.Types.Tweens.TweenOnPauseCallback | <optional> |
A function to call when the chain is paused. |
|
onPauseParams | array | <optional> |
Additional parameters to pass to |
|
onResume | Phaser.Types.Tweens.TweenOnResumeCallback | <optional> |
A function to call when the chain is resumed after being paused. |
|
onResumeParams | array | <optional> |
Additional parameters to pass to |
|
persist | boolean | <optional> |
Will the Tween be automatically destroyed on completion, or retained for future playback? |
name | type | arguments | Default | description |
---|---|---|---|---|
target | any |
The target to tween. |
||
index | number |
The target index within the Tween targets array. |
||
key | string |
The property of the target being tweened. |
||
getActiveValue | Phaser.Types.Tweens.GetActiveCallback |
If not null, is invoked immediately as soon as the TweenData is running, and is set on the target property. |
||
getEndValue | Phaser.Types.Tweens.GetEndCallback |
The returned value sets what the property will be at the END of the Tween. |
||
getStartValue | Phaser.Types.Tweens.GetStartCallback |
The returned value sets what the property will be at the START of the Tween. |
||
ease | function |
The ease function this tween uses. |
||
duration | number | <optional> | 0 |
Duration of the tween in milliseconds, excludes time for yoyo or repeats. |
totalDuration | number | <optional> | 0 |
The total calculated duration of this TweenData (based on duration, repeat, delay and yoyo) |
delay | number | <optional> | 0 |
Time in milliseconds before tween will start. |
yoyo | boolean | <optional> | false |
Cause the tween to return back to its start value after hold has expired. |
hold | number | <optional> | 0 |
Time in milliseconds the tween will pause before running the yoyo or starting a repeat. |
repeat | number | <optional> | 0 |
Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. |
repeatDelay | number | <optional> | 0 |
Time in milliseconds before the repeat will start. |
flipX | boolean | <optional> | false |
Automatically call toggleFlipX when the TweenData yoyos or repeats |
flipY | boolean | <optional> | false |
Automatically call toggleFlipY when the TweenData yoyos or repeats |
progress | number | <optional> | 0 |
Between 0 and 1 showing completion of this TweenData. |
elapsed | number | <optional> | 0 |
Delta counter |
repeatCounter | number | <optional> | 0 |
How many repeats are left to run? |
start | number | <optional> | 0 |
The property value at the start of the ease. |
current | number | <optional> | 0 |
The current propety value. |
previous | number | <optional> | 0 |
The previous property value. |
end | number | <optional> | 0 |
The property value at the end of the ease. |
gen | Phaser.Types.Tweens.TweenDataGenConfig | <optional> |
LoadValue generation functions. |
|
state | Phaser.Tweens.StateType | <optional> | 0 |
TWEEN_CONST.CREATED |
name | type | description |
---|---|---|
delay | function |
Time in milliseconds before tween will start. |
duration | function |
Duration of the tween in milliseconds, excludes time for yoyo or repeats. |
hold | function |
Time in milliseconds the tween will pause before running the yoyo or starting a repeat. |
repeat | function |
Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. |
repeatDelay | function |
Time in milliseconds before the repeat will start. |
name | type | arguments | Default | description |
---|---|---|---|---|
target | any |
The target to tween. |
||
index | number |
The target index within the Tween targets array. |
||
key | string |
The property of the target being tweened. |
||
duration | number | <optional> | 0 |
Duration of the tween in milliseconds, excludes time for yoyo or repeats. |
totalDuration | number | <optional> | 0 |
The total calculated duration of this TweenData (based on duration, repeat, delay and yoyo) |
delay | number | <optional> | 0 |
Time in milliseconds before tween will start. |
hold | number | <optional> | 0 |
Time in milliseconds the tween will pause before running the yoyo or starting a repeat. |
repeat | number | <optional> | 0 |
Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. |
repeatDelay | number | <optional> | 0 |
Time in milliseconds before the repeat will start. |
flipX | boolean | <optional> | false |
Automatically call toggleFlipX when the TweenData yoyos or repeats |
flipY | boolean | <optional> | false |
Automatically call toggleFlipY when the TweenData yoyos or repeats |
progress | number | <optional> | 0 |
Between 0 and 1 showing completion of this TweenData. |
elapsed | number | <optional> | 0 |
Delta counter |
repeatCounter | number | <optional> | 0 |
How many repeats are left to run? |
gen | Phaser.Types.Tweens.TweenDataGenConfig | <optional> |
LoadValue generation functions. |
|
state | Phaser.Tweens.StateType | <optional> | 0 |
TWEEN_CONST.CREATED |
name | type | description |
---|---|---|
tween | Phaser.Tweens.Tween |
A reference to the Tween. |
targets | any | Array.<any> |
The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. |
param | any |
Any value passed in |
name | type | description |
---|---|---|
tween | Phaser.Tweens.Tween |
A reference to the Tween. |
targets | any | Array.<any> |
The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. |
param | any |
Any value passed in |
name | type | description |
---|---|---|
tween | Phaser.Tweens.Tween |
A reference to the Tween. |
targets | any | Array.<any> |
The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. |
param | any |
Any value passed in |
name | type | description |
---|---|---|
tween | Phaser.Tweens.Tween |
A reference to the Tween. |
targets | any | Array.<any> |
The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. |
param | any |
Any value passed in |
name | type | description |
---|---|---|
tween | Phaser.Tweens.Tween |
A reference to the Tween. |
target | any |
The current target of the Tween. If this Tween has multiple targets, this will be a reference to just the single one being updated prior to this callback. |
key | string |
The property that is being updated on the target. |
current | number |
The current value of the property being set on the target. |
previous | number |
The previous value of the property being set on the target. |
param | any |
Any value passed in |
name | type | description |
---|---|---|
tween | Phaser.Tweens.Tween |
A reference to the Tween. |
targets | any | Array.<any> |
The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. |
param | any |
Any value passed in |
name | type | description |
---|---|---|
tween | Phaser.Tweens.Tween |
A reference to the Tween. |
targets | any | Array.<any> |
The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. |
param | any |
Any value passed in |
name | type | description |
---|---|---|
tween | Phaser.Tweens.Tween |
A reference to the Tween. |
targets | any | Array.<any> |
The targets of the Tween. If this Tween has multiple targets this will be an array of the targets. |
param | any |
Any value passed in |
name | type | description |
---|---|---|
tween | Phaser.Tweens.Tween |
A reference to the Tween. |
target | any |
The current target of the Tween. If this Tween has multiple targets, this will be a reference to just the single one being updated prior to this callback. |
key | string |
The property that is being updated on the target. |
current | number |
The current value of the property being set on the target. |
previous | number |
The previous value of the property being set on the target. |
param | any |
Any value passed in |
name | type | description |
---|---|---|
tween | Phaser.Tweens.Tween |
A reference to the Tween. |
target | any |
The current target of the Tween. If this Tween has multiple targets, this will be a reference to just the single one being updated prior to this callback. |
key | string |
The property that is being updated on the target. |
current | number |
The current value of the property being set on the target. |
previous | number |
The previous value of the property being set on the target. |
param | any |
Any value passed in |
name | type | arguments | description |
---|---|---|---|
value | number | Array.<number> | string | Phaser.Types.Tweens.GetEndCallback | Phaser.Types.Tweens.TweenPropConfig | <optional> |
What the property will be at the END of the Tween. |
getActive | Phaser.Types.Tweens.GetActiveCallback | <optional> |
What the property will be set to immediately when this tween becomes active. |
getEnd | Phaser.Types.Tweens.GetEndCallback | <optional> |
What the property will be at the END of the Tween. |
getStart | Phaser.Types.Tweens.GetStartCallback | <optional> |
What the property will be at the START of the Tween. |
ease | string | function | <optional> |
The ease function this tween uses. |
delay | number | <optional> |
Time in milliseconds before tween will start. |
duration | number | <optional> |
Duration of the tween in milliseconds. |
yoyo | boolean | <optional> |
Determines whether the tween should return back to its start value after hold has expired. |
hold | number | <optional> |
Time in milliseconds the tween will pause before repeating or returning to its starting value if yoyo is set to true. |
repeat | number | <optional> |
Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. |
repeatDelay | number | <optional> |
Time in milliseconds before the repeat will start. |
flipX | boolean | <optional> |
Should toggleFlipX be called when yoyo or repeat happens? |
flipY | boolean | <optional> |
Should toggleFlipY be called when yoyo or repeat happens? |
interpolation | string | function | <optional> |
The interpolation function to use if the |