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
- }
参见
属性
属性 | 说明 |
---|---|
parentPlayer: AnimationPlayer | null | The parent of this player, if any. |
totalTime: number | 只读 The total run time of the animation, in milliseconds. |
beforeDestroy?: () => any | Provides a callback to invoke before the animation is destroyed. |
方法
Provides a callback to invoke when the animation finishes. |
Provides a callback to invoke when the animation starts. |
Provides a callback to invoke after the animation is destroyed. |
Initializes the animation. |
参数没有参数。 返回值
|
Reports whether the animation has started. |
参数没有参数。 返回值
|
Runs the animation, invoking the |
参数没有参数。 返回值
|
Pauses the animation. |
参数没有参数。 返回值
|
Restarts the paused animation. |
参数没有参数。 返回值
|
Ends the animation, invoking the |
参数没有参数。 返回值
|
Destroys the animation, after invoking the |
参数没有参数。 返回值
|
Resets the animation to its initial state. |
参数没有参数。 返回值
|
Sets the position of the animation. |
Reports the current position of the animation. |
参数没有参数。 返回值
|