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").await;

    clear_background(WHITE);
    loop {
        animation.draw();
        animation.tick();
        next_frame().await
    }
}

Structs

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.

Struct containing textures to display every frame.