new TweenData(parent)
A Phaser.Tween contains at least one TweenData object. It contains all of the tween data values, such as the starting and ending values, the ease function, interpolation and duration. The Tween acts as a timeline manager for TweenData objects and can contain multiple TweenData objects.
Parameters
Name | Type | Description |
---|---|---|
parent |
Phaser.Tween | The Tween that owns this TweenData object. |
- Source code: tween/TweenData.js (Line 16)
Public Properties
-
[static] COMPLETE : number
-
- Source code: tween/TweenData.js (Line 173)
-
[static] LOOPED : number
-
- Source code: tween/TweenData.js (Line 167)
-
[static] PENDING : number
-
- Source code: tween/TweenData.js (Line 155)
-
[static] RUNNING : number
-
- Source code: tween/TweenData.js (Line 161)
-
delay : number
-
The amount to delay by until the Tween starts (in ms). Only applies to the start, use repeatDelay to handle repeats.
- Default Value
- 0
- Source code: tween/TweenData.js (Line 107)
-
dt : number
-
Current time value.
- Source code: tween/TweenData.js (Line 112)
-
duration : number
-
The duration of the tween in ms.
- Default Value
- 1000
- Source code: tween/TweenData.js (Line 56)
-
easingFunction : Function
-
The easing function used for the Tween.
- Default Value
- Phaser.Easing.Default
- Source code: tween/TweenData.js (Line 123)
-
game : Phaser.Game
-
A reference to the currently running Game.
- Source code: tween/TweenData.js (Line 26)
-
inReverse : boolean
-
When a Tween is yoyoing this value holds if it's currently playing forwards (false) or in reverse (true).
- Default Value
- false
- Source code: tween/TweenData.js (Line 101)
-
interpolate : boolean
-
True if the Tween will use interpolation (i.e. is an Array to Array tween)
- Default Value
- false
- Source code: tween/TweenData.js (Line 84)
-
interpolationContext : Object
-
The interpolation function context used for the Tween.
- Default Value
- Phaser.Math
- Source code: tween/TweenData.js (Line 135)
-
interpolationFunction : Function
-
The interpolation function used for the Tween.
- Default Value
- Phaser.Math.linearInterpolation
- Source code: tween/TweenData.js (Line 129)
-
isFrom : boolean
-
Is this a from tween or a to tween?
- Default Value
- false
- Source code: tween/TweenData.js (Line 147)
-
isRunning : boolean
-
If the tween is running this is set to
true
. Unless Phaser.Tween a TweenData that is waiting for a delay to expire is not considered as running.- Default Value
- false
- Source code: tween/TweenData.js (Line 141)
-
parent : Phaser.Tween
-
The Tween which owns this TweenData.
- Source code: tween/TweenData.js (Line 21)
-
[readonly] percent : number
-
A value between 0 and 1 that represents how far through the duration this tween is.
- Source code: tween/TweenData.js (Line 62)
-
repeatCounter : number
-
If the Tween is set to repeat this contains the current repeat count.
- Source code: tween/TweenData.js (Line 73)
-
repeatDelay : number
-
The amount of time in ms between repeats of this tween.
- Source code: tween/TweenData.js (Line 78)
-
startTime : number
-
The time the Tween started or null if it hasn't yet started.
- Source code: tween/TweenData.js (Line 117)
-
[readonly] value : number
-
The current calculated value.
- Source code: tween/TweenData.js (Line 68)
-
yoyo : boolean
-
True if the Tween is set to yoyo, otherwise false.
- Default Value
- false
- Source code: tween/TweenData.js (Line 90)
-
yoyoDelay : number
-
The amount of time in ms between yoyos of this tween.
- Source code: tween/TweenData.js (Line 95)
Public Methods
-
generateData(frameRate) → {array}
-
This will generate an array populated with the tweened object values from start to end. It works by running the tween simulation at the given frame rate based on the values set-up in Tween.to and Tween.from. Just one play through of the tween data is returned, including yoyo if set.
Parameters
Name Type Argument Default Description frameRate
number <optional>
60 The speed in frames per second that the data should be generated at. The higher the value, the larger the array it creates.
Returns
array -An array of tweened values.
- Source code: tween/TweenData.js (Line 397)
-
start() → {Phaser.TweenData}
-
Starts the Tween running.
Returns
This Tween object.
- Source code: tween/TweenData.js (Line 233)
-
<internal> update() → {number}
-
Updates this Tween. This is called automatically by Phaser.Tween.
Returns
number -The current status of this Tween. One of the Phaser.TweenData constants: PENDING, RUNNING, LOOPED or COMPLETE.
- Internal:
- This member is internal (protected) and may be modified or removed in the future.
- Source code: tween/TweenData.js (Line 329)