# Sandbox.Sprite.AnimationState

Contains the state of a sprite instance's animation playback.

- Kind: class
- Assembly: `Sandbox.Engine`

## Constructors

- [`AnimationState`](/api/Sandbox.Sprite.AnimationState/.ctor)

## Fields

- [`CurrentFrameIndex`](/api/Sandbox.Sprite.AnimationState/CurrentFrameIndex): The current frame index in the animation.
- [`IsPingPonging`](/api/Sandbox.Sprite.AnimationState/IsPingPonging): Whether or not the animation is currently ping-ponging. This is only relevant for animations that have [Sandbox.Sprite.LoopMode.PingPong](/api/Sandbox.Sprite.LoopMode/PingPong)
- [`PlaybackSpeed`](/api/Sandbox.Sprite.AnimationState/PlaybackSpeed): 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.
- [`TimeSinceLastFrame`](/api/Sandbox.Sprite.AnimationState/TimeSinceLastFrame): The time since the last frame was advanced.

## Properties

- [`JustFinished`](/api/Sandbox.Sprite.AnimationState/JustFinished): Returns true if the animation finished, looped, or ping-ponged after calling [Sandbox.Sprite.AnimationState.TryAdvanceFrame](/api/Sandbox.Sprite.AnimationState/TryAdvanceFrame)

## Methods

- [`ResetState`](/api/Sandbox.Sprite.AnimationState/ResetState): Reset the animation playback state to the beginning (first frame, no ping-pong, zero time-since).
- [`TryAdvanceFrame`](/api/Sandbox.Sprite.AnimationState/TryAdvanceFrame): Try to advance the frame of a given animation with a given delta time. Returns false if the frame did not advance.
