Skip to content

Commit

Permalink
feat: add current_frame_index getter from animation state (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcornaz committed Mar 6, 2022
1 parent a5e7ea8 commit 1e30613
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/state.rs
Expand Up @@ -50,6 +50,14 @@ impl SpriteSheetAnimationState {
*self = Self::default();
}

/// Returns the index of the current frame
///
/// The index is relative to the animation sequence. **not** to the sprite-sheet.
#[must_use]
pub fn current_frame_index(&self) -> usize {
self.current_frame
}

/// Update the animation and the sprite (if necessary)
///
/// Returns true if the animation has ended
Expand Down

0 comments on commit 1e30613

Please sign in to comment.