All Projects → jcornaz → benimator

jcornaz / benimator

Licence: Unlicense, MIT licenses found Licenses found Unlicense UNLICENSE MIT LICENSE-MIT
A sprite animation library for rust game development

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to benimator

Pixelorama
A free & open-source 2D sprite editor, made with the Godot Engine! Available on Windows, Linux, macOS and the Web!
Stars: ✭ 2,535 (+1791.79%)
Mutual labels:  sprite-animation
React Game Kit
Component library for making games with React & React Native
Stars: ✭ 4,480 (+3243.28%)
Mutual labels:  sprite-animation
bitmapflow
A tool to generate inbetweens for animated sprites, written in godot-rust
Stars: ✭ 388 (+189.55%)
Mutual labels:  sprite-animation
wesa
WebGL Engine of Sprite Animation
Stars: ✭ 23 (-82.84%)
Mutual labels:  sprite-animation
susse
super ültra sweet sprite editor
Stars: ✭ 22 (-83.58%)
Mutual labels:  sprite-animation

Benimator

License Crates.io Docs Build

A sprite animation library for rust game development.

Initially designed for bevy, it is now engine agnostic.

Goals

This project aim to provide the building the blocks to facilitate 2d sprite animation with any game engine.

Non-goals

Benimator is not rendering anything. It only keeps track of sprite indices.

One is expected to use benimator with a game engine such as bevy.

How it looks like

At its core benimator is an Animation data structure and a State to track the frame-index as time pass.

// 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);

Have a look at the examples for complete examples using the bevy game engine.

Installation

benimator is published on crates.io

You can add the dependency to your cargo file with:

cargo add benimator

Cargo features

Feature Description
serde Implementations of Serialize and Deserialize

Feature flags not mentioned here are NOT part of the public API and are subject to breaking changes!

MSRV

The minimum supported rust version is, at all times, the latest stable.

License

Licensed under either of

at your option.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].