Api AnimationState
class

AnimationState

public class AnimationState

Contains the state of a sprite instance's animation playback.

Constructors

AnimationState()

Properties

Name Type Description
JustFinished Boolean Returns true if the animation finished, looped, or ping-ponged after calling Single)

Methods

Void ResetState()

Reset the animation playback state to the beginning (first frame, no ping-pong, zero time-since).

Boolean TryAdvanceFrame(Animation animation, Single deltaTime)

Try to advance the frame of a given animation with a given delta time. Returns false if the frame did not advance.

Fields

Name Type Description
CurrentFrameIndex Int32 The current frame index in the animation.
IsPingPonging Boolean Whether or not the animation is currently ping-ponging. This is only relevant for animations that have PingPong
TimeSinceLastFrame Single The time since the last frame was advanced.
PlaybackSpeed Single The speed at which the animation is playing back. A value of 1 means normal speed, 0.5 means half speed, and -1 means reverse playback.
Assembly: Sandbox.Engine Declaring Type: Sprite Full Name: Sandbox.Sprite.AnimationState