bevy_animate_atlas

v0.1.0

Adobe Animate sparrow V2 and texture atlas support for the Bevy game engine

Profile

Stub

What problem does this crate solve?

Sparrow parsing and atlas animation can be useful for making nice animations. This is particularly nice for vector graphic animations than can easily be made in Sparrow.

Features

  • Sparrow parsing
  • Atlas animations
  • Dynamic riggind
  • Procedural vertices

Get started

A sparrow animation will look like this, give it a try:

fn animate_sparrow(time: Res<Time>, mut query: Query<(&mut Sprite, &mut Transform, &mut SpriteAnimation)>) {
    for (mut sprite, mut transform, mut anim) in query.iter_mut() {
        anim.timer.tick(time.delta());

        if anim.timer.just_finished() {
            if let Some(f) = anim.frames.get(anim.current_frame) {
                // Update the visible source rectangle on the texture sheet
                sprite.rect = Some(Rect::new(f.x, f.y, f.x + f.width, f.y + f.height));

                // Adjust position based on the Sparrow frame offset (Inverting Y for Bevy)
                transform.translation = Vec3::new(100.0 - f.frame_x, -(150.0 - f.frame_y), 0.0);
            }

            anim.current_frame = (anim.current_frame + 1) % anim.frames.len();
        }
    }
}

Reviews

No reviews yet. Be the first to review this crate!

Downloads 24
Cages 0
Rating Unrated
License non-standard
Added by ffmulks
Owner
notmagniill