This crate allows you to integrate your aseprite files into your game project at compile time. This means that changes will break the build should you reference something nonexistent.
Here's what's included:
animation
fieldslice
fieldbevy-spicy-aseprite
takes care of showing you the updated version!Of note: Should you encounter any bugs or hard to use or confusing interfaces, please post an issue or bug report so that we may all profit from it!
cargo add https://github.com/TheNeikos/bevy-spicy-aseprite
rust,ignore
aseprite!(pub Player, "assets/sprites/player.aseprite");
rust,ignore
mod Player {
mod tags {
pub const Walk = ...;
pub const Run = ...;
}
}
rust,ignore
commands.spawn_bundle(AsepriteBundle {
aseprite: Player::sprite(),
animation: AsepriteAnimation::from(Player::tags::Walk),
transform: Transform {
scale: Vec3::splat(4.),
translation: Vec3::new(0., 0., 0.),
..Default::default()
},
..Default::default()
});
Check out the example to see how it could be used:
bash
cargo run --example show-aseprite
Press space to pause and unpause