Timeline
Overview
An animation is driven by its associated properties, such as size, location and color, etc. Timeline provides the capability to update the property values along the progression of time.
A Timeline, defined by one or more KeyFrames, processes individual KeyFrame sequentially, in the order specified by KeyFrame.time. The animated properties, defined as key values in KeyFrame.values, are interpolated (when interpolation is enabled) to/from the targeted key values at the specified time of the KeyFrame to Timeline's initial position, depends on Timeline's direction.
Timeline processes individual KeyFrame at or after specified time interval elapsed, it does not guarantee the timing when KeyFrame is processed.
Call #play() or #playFromStart() to play a Timeline. The Timeline progresses in the direction and speed specified by #rate, and stops when its duration is elasped. A Timeline with indefinite duration (a #repeatCount of #INDEFINITE) runs repeatedly until the #stop() method is explicitly called, which will stop the running Timeline and reset its play head to the initial position.
Timeline can be paused by calling #pause(), and next play() call will resume the Timeline from where it was paused.
A Timeline's play head can be randomly positioned, whether it is running or not. If the Timeline is running, the play head jumps to the specified position immediately and continues playing from new position. If the Timeline is not running, the next #play() will start the Timeline from the specified position.
Invert the value of #rate can invert Timeline play direction. Inverting a running Timeline causes it to reverse direction in play and play back over the portion it has elapsed.
Profile: common
Constants Summary
| name | type | description |
|---|---|---|
| INDEFINITE | Integer |
Used to specify an animation that repeats indefinitely, until the |
Variable Summary
| name | type | Default Value | description |
|---|---|---|---|
| rate | Number | 1.0 |
Defines the direction/speed at which the The absolute value of Rate Inverting the rate of a running |
| time | Duration | 0s |
Defines the If If user wants to bind the variable and update it simultaneously, bidirectional
|
| interpolate | Boolean | true |
Enable/disable interpolation. |
| repeatCount | Number | 1.0 |
Defines the number of cycles in this animation. The |
| autoReverse | Boolean | false |
Defines whether this animation reverses direction on alternating cycles. If |
| keyFrames | KeyFrame |
Defines the sequence of |
|
| framerate | Number |
The maximum framerate at which this animation will run, in frames per second. This can be used, for example, to keep particularly complex Timelines from over-consuming system resources. By default, a Timeline's framerate is not explicitly limited, meaning the Timeline will run at an optimal framerate for the underlying platform. |
