Skip to content

SpriteAnimator ​

class in OpalScript

Controls animation states, sprite sequences, and automatic locomotion animation.

Properties ​

MemberDescription
SpriteAnimator.StateName of the active animation state.
SpriteAnimator.PlayingWhether an animation sequence is currently playing.
SpriteAnimator.FrameZero-based frame index of the current sequence; zero without sequence playback.
SpriteAnimator.AutomaticWhether automatic locomotion state selection is enabled.

Methods ​

MemberDescription
SpriteAnimator.SetStateSwitch to a named animation state.
SpriteAnimator.PlayPlay a sprite sequence. A one-shot can restore the previous state frame when complete.
SpriteAnimator.PlayAsyncAwait one exact animation playback, including loading and every frame hold. Replacement or cancellation stops only this operation.
SpriteAnimator.WaitForMarkerAwait a frame label on the current or loading playback, returning its first reached frame index. Canceling the wait leaves playback running.
SpriteAnimator.StopStop the current sequence and cancel any pending animation load. Automatic locomotion can choose a state on the next frame.
SpriteAnimator.PlayIdleSwitch to an authored locomotion state.
SpriteAnimator.PlayWalkSwitch to an authored locomotion state.
SpriteAnimator.PlayRunSwitch to an authored locomotion state.
SpriteAnimator.PlayJumpSwitch to an authored locomotion state.
SpriteAnimator.PlayFallSwitch to an authored locomotion state.
SpriteAnimator.PlayLandingSwitch to an authored locomotion state.
SpriteAnimator.SetAutomaticEnable or disable automatic locomotion animation states.
SpriteAnimator.StateIsWhether the named animation state is active.

See also ​