AnimatedTextureProvider
APJS Script API reference for the AnimatedTextureProvider class.
| Type | Name | Interface Description |
|---|---|---|
| Variables | duration: number | • Function: Gets the duration of the animation in seconds. |
| Variables | fps: number | • Function: Gets the frames per second (fps) of the animation. |
| Variables | loopCount: number | • Function: Gets the number of times the animation should loop. |
| Variables | playMode: AnimatedTexturePlayMode | • Function: Gets or sets the play mode of the animation. |
| Variables | reverse: boolean | • Function: Gets whether the animation plays in reverse. Returns True if animation plays in reverse, false otherwise |
| Functions | getCurrentPlayingFrame(): number | • Function: Get current playing frame index, the index range from 0 to frameCount - 1 Returns Current frame index |
| Functions | getFrameCount(): number | • Function: Gets the total number of frames in the animation sequence. Returns Total frame count |
| Functions | pause(): void | • Function: Pauses animation playback. |
| Functions | play(): void | • Function: Starts the animation playback. |
| Functions | playFromTo(from: number, to: number): void | • Function: reset and set the start and end index of the animation. The index range from 0 to frameCount - 1. Parameters • • |
| Functions | reset(): void | • Function: Resets the animation to its initial state and restarts playback. |
| Functions | resume(): void | • Function: Resumes the animation playback. |
| Functions | stop(): void | • Function: Stops animation playback, resets to initial state, and displays the first frame. |
Use Case
@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use AnimatedTextureProvider here
}
onUpdate(deltaTime: number) {
}
}