A sprite animation library for rust game development
Initially designed for bevy, it is now engine agnostic.
benimator assumes usage of texture atlas (or equivalent).
Animation contains the list of animation frames,
each frame defined by an index.
use benimator::*; // Create an animation let animation = Animation::from_indices(0..=3, FrameRate::from_fps(10.0)); // Create a new animation state let mut state = State::new(); // In the game loop, for each update, tell the state how much time has elapsed let delta_time = Duration::from_millis(250); state.update(&animation, delta_time); // Then get the current frame index. // (so that we can tell our engine to render the sprite at that index) assert_eq!(state.frame_index(), 2);
- Definition of an animation
- A single animation frame
- Frame-Rate definition
- Animation state