AnimationPlayer
Provides programmatic control of a reusable animation sequence,
built using the build()
method of AnimationBuilder
. The build()
method
returns a factory, whose create()
method instantiates and initializes this interface.
- interface AnimationPlayer {
- parentPlayer: AnimationPlayer | null
- totalTime: number
- beforeDestroy?: () => any
- onDone(fn: () => void): void
- onStart(fn: () => void): void
- onDestroy(fn: () => void): void
- init(): void
- hasStarted(): boolean
- play(): void
- pause(): void
- restart(): void
- finish(): void
- destroy(): void
- reset(): void
- setPosition(position: any): void
- getPosition(): number
- }
Class implementations
See also
Properties
Property | Description |
---|---|
parentPlayer: AnimationPlayer | null
|
The parent of this player, if any. |
totalTime: number
|
Read-only.
The total run time of the animation, in milliseconds. |
beforeDestroy?: () => any
|
Provides a callback to invoke before the animation is destroyed. |
Methods
Provides a callback to invoke when the animation finishes. See also:
|
Provides a callback to invoke when the animation starts. See also:
|
Provides a callback to invoke after the animation is destroyed. See also:
|
Initializes the animation. |
ParametersThere are no parameters. Returns
|
Reports whether the animation has started. |
ParametersThere are no parameters. Returns
|
Runs the animation, invoking the |
ParametersThere are no parameters. Returns
|
Pauses the animation. |
ParametersThere are no parameters. Returns
|
Restarts the paused animation. |
ParametersThere are no parameters. Returns
|
Ends the animation, invoking the |
ParametersThere are no parameters. Returns
|
Destroys the animation, after invoking the |
ParametersThere are no parameters. Returns
|
Resets the animation to its initial state. |
ParametersThere are no parameters. Returns
|
Sets the position of the animation. |
Reports the current position of the animation. |
ParametersThere are no parameters. Returns
|