SpriteAnimator
class in OpalScript
Controls animation states, sprite sequences, and automatic locomotion animation.
Properties
| Member | Description |
|---|---|
| SpriteAnimator.State | Name of the active animation state. |
| SpriteAnimator.Playing | Whether an animation sequence is currently playing. |
| SpriteAnimator.Frame | Zero-based frame index of the current sequence; zero without sequence playback. |
| SpriteAnimator.Automatic | Whether automatic locomotion state selection is enabled. |
Methods
| Member | Description |
|---|---|
| SpriteAnimator.SetState | Switch to a named animation state. |
| SpriteAnimator.Play | Play a sprite sequence. A one-shot can restore the previous state frame when complete. |
| SpriteAnimator.PlayAsync | Await one exact animation playback, including loading and every frame hold. Replacement or cancellation stops only this operation. |
| SpriteAnimator.WaitForMarker | Await a frame label on the current or loading playback, returning its first reached frame index. Canceling the wait leaves playback running. |
| SpriteAnimator.Stop | Stop the current sequence and cancel any pending animation load. Automatic locomotion can choose a state on the next frame. |
| SpriteAnimator.PlayIdle | Switch to an authored locomotion state. |
| SpriteAnimator.PlayWalk | Switch to an authored locomotion state. |
| SpriteAnimator.PlayRun | Switch to an authored locomotion state. |
| SpriteAnimator.PlayJump | Switch to an authored locomotion state. |
| SpriteAnimator.PlayFall | Switch to an authored locomotion state. |
| SpriteAnimator.PlayLanding | Switch to an authored locomotion state. |
| SpriteAnimator.SetAutomatic | Enable or disable automatic locomotion animation states. |
| SpriteAnimator.StateIs | Whether the named animation state is active. |