Expand description
Simple crate to load and draw a GIF animation using Macroquad.
The animation will loop forever, regardless of how many iterations are set in the file.
use macroquad::prelude::*;
use quad_gif;
#[macroquad::main("quad-gif")]
async fn main() {
let mut animation = quad_gif::GifAnimation::load("animation.gif".to_string()).await;
clear_background(WHITE);
loop {
animation.draw();
animation.tick();
next_frame().await
}
}Structsยง
- Animation
Frame - Struct for a single frame. Contains the texture to draw, and a delay for how many seconds the frame should show before advancing to the next frame.
- GifAnimation
- Struct containing textures to display every frame.