Crates.io | micro_banimate |
lib.rs | micro_banimate |
version | 0.11.0 |
created_at | 2022-10-05 02:05:25.15091+00 |
updated_at | 2025-04-27 00:36:01.857205+00 |
description | Easily manage complex Bevy 2D sprite animations |
homepage | |
repository | https://lab.lcr.gr/microhacks/micro-banimate |
max_upload_size | |
id | 680258 |
size | 178,038 |
Easily manage complex 2D sprite animations
BanimatePluginGroup
to your appSprite
and attach a SpriteAnimation
and an AnimationHandle
.Code examples have been moved to the examples folder - clone the source and see them in action!
AnimationOverride
Directionality
componentSprite
and a ChildOf
relation, set the atlas index of the sprite based on the parent valueAn animation set maps a name to a series of frames and a frame rate. A given animation has one frame rate for the whole animation, but different animations can have different frame rates (i.e. a "walk" animation could play at 100ms per frame, and an "idle" animation could play at 250ms per frame, but you can not set the duration of an individual frame within either animation).
An AnimationSet
might contains many animations, and a given AnimationSet
is likely to be attached to many entities.
As such,
animations use the Asset
system to avoid passing around relatively large duplicate objects. Loaders are included
for JSON
and TOML
data types, but only JSON
is enabled by default. The loaders are not required, and so can therefore be disabled if
another method
of creating AnimationSet
assets is desired.
With the json_loader
feature enabled, you can load an animation set from a file with a .anim.json
suffix that looks
like this:
{
"idle": {
"frames": [
1,
2,
3
],
"frame_time": 250
},
"shoot_right": {
"frames": [
34,
34,
34,
35,
36
],
"frame_time": 100
}
}
With the toml_loader
feature enabled, you can load an animation set from a file with a .anim.toml
suffix that looks
like this:
[idle]
frames = [1, 2, 3]
frame_time = 250
[shoot_right]
frames = [34, 34, 34, 35, 36]
frame_time = 100
banimate version | bevy version | tilemap version |
---|---|---|
0.11.0 | 0.16 | n/a |
0.10.0 | 0.15 | n/a |
0.9.x | 0.14 | n/a |
0.8.0 | 0.13 | n/a |
0.7.0 | 0.12 | n/a |
0.6.0-rc.1 | 0.11 | 55c15bfa43c7a9e2adef6b70007e92d699377454 |
0.5.x | 0.10 | 0.10 |
0.5.x | 0.10 | 0.10 |
0.2.x, 0.3.x, 0.4.x | 0.9 | 0.9 |
0.1.x | 0.8 | 0.8 |