Skip to content

Commit

Permalink
feat: rename state's current_frame_index to animation_frame_index
Browse files Browse the repository at this point in the history
… (old name is deprecated)
  • Loading branch information
jcornaz committed Jul 17, 2022
1 parent 47f1330 commit e1249d6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,18 @@ impl SpriteSheetAnimationState {
*self = Self::default();
}

/// Returns the index of the current frame
#[must_use]
#[deprecated(since = "3.7.0", note = "please use `animation_frame_index` instead")]
#[doc(hidden)]
pub fn current_frame_index(&self) -> usize {
self.animation_frame_index()
}

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

Expand Down

0 comments on commit e1249d6

Please sign in to comment.