1 unstable release
0.2.0 | Jun 22, 2022 |
---|
#32 in #macroquad
480KB
140 lines
quad-gif
Display GIF animations with Macroquad.
Usage
quad-gif 0.2.0
Display a GIF file.
Usage: quad-gif <file>
Licenses
quad-gif
Copyright 2022 Olle Wreede, released under the MIT License.
animation.gif
Animated Ferris in Action by A. L. Palmer
Happy as a Rustacean at Rust Fest Berlin 2016 (www.rustfest.eu)
lib.rs
:
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
}
}
Dependencies
~19MB
~241K SLoC