12 unstable releases (3 breaking)

Uses new Rust 2024

0.4.1 Apr 30, 2025
0.4.0 Apr 29, 2025
0.3.1 Nov 30, 2024
0.2.0 Jul 4, 2024
0.1.1 May 24, 2024

#1602 in Game dev

Download history 140/week @ 2025-02-01 99/week @ 2025-02-08 147/week @ 2025-02-15 150/week @ 2025-02-22 158/week @ 2025-03-01 163/week @ 2025-03-08 159/week @ 2025-03-15 179/week @ 2025-03-22 196/week @ 2025-03-29 100/week @ 2025-04-05 38/week @ 2025-04-12 52/week @ 2025-04-19 294/week @ 2025-04-26 172/week @ 2025-05-03 114/week @ 2025-05-10 100/week @ 2025-05-17

683 downloads per month

MIT/Apache

1.5MB
565 lines

vleue_kinetoscope

MIT/Apache 2.0 Doc Crate Bevy Tracking CI

Animated GIF and WebP player for Bevy.

animated-gif

Usage

System setup

Add the plugin to your app:

use bevy::prelude::*;
use vleue_kinetoscope::AnimatedImagePlugin;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(AnimatedImagePlugin);
}

Play an animated gif

Spawn an entity with the component AnimatedImageController:

use bevy::prelude::*;
use vleue_kinetoscope::*;

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn(Camera2d);

    commands.spawn(AnimatedImageController::play(asset_server.load("cube.gif")));
}

Play an animated WebP

Spawn an entity with the component AnimatedImageController:

use bevy::prelude::*;
use vleue_kinetoscope::*;

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn(Camera2d);

    commands.spawn(AnimatedImageController::play(asset_server.load("cube.webp")));
}

Streaming animations

It is possible to stream an animated GIF or WebP, so that it's not loaded completely into Memory:

use bevy::prelude::*;
use vleue_kinetoscope::*;

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn(Camera2d);

    commands.spawn(StreamingAnimatedImageController::play(asset_server.load("big-buck-bunny.webp")));
}

Streaming animated images are only played once, and can't loop.

Wasm is not yet supported for streaming animations.

Bevy Support

Bevy vleue_kinetoscope
main main
0.16 0.4
0.15 0.3
0.14 0.2
0.13 0.1

Dependencies

~38–69MB
~1M SLoC