Constructor
new Animator()
Initialize a new animator.
The new animator is added to the list of animators managed by the Sozi player.
- Source:
Extends
- EventEmitter
Members
durationMs :number
The duration of the current animation, in milliseconds.
Type:
- number
- Default Value:
- 500
- Source:
initialTime :number
The start time of the current animation.
Type:
- number
- Source:
running :boolean
The current running state of this animator.
Type:
- boolean
- Source:
Methods
start(durationMs)
Start a new animation.
The step
event is fired once before starting the animation.
Parameters:
Name | Type | Description |
---|---|---|
durationMs |
number | The duration of the animation, in milliseconds. |
- Source:
Fires:
step()
Perform one animation step.
This function is called automatically by the main animation loop.
It fires the step
event with
an indication of the current progress (elapsed time / duration).
If the animation duration has elapsed, the
done
event is fired.
- Source:
Fires:
stop()
Stop the current animation.
- Source: