pub struct State { /* private fields */ }
Expand description

Animation state

Implementations

Create a new state

Reset animation state

The animation will restart from the first frame, like if the animation was freshly spawned.

Returns the index of the current animation frame

The index is relative to the animation sequence. not to the sprite-sheet.

Returns the index of the current sprite frame

The index is relative to the sprite atlas. not to the animation frame sequence.

Returns true if the animation has ended

Update the animation state

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.