Skip to content

vleue/vleue_kinetoscope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()
        // Usually included with `DefaultPlugins`
        .add_plugins(AssetPlugin::default())
        .add_plugins(AnimatedImagePlugin);
}

Play an animated gif

Spawn an entity with the bundle AnimatedImageBundle

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

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn(AnimatedImageBundle {
        animated_image: asset_server.load("Geneva_mechanism_6spoke_animation.gif"),
        ..default()
    });
}

WebP Support

Animated WebP is currently broken in release versions of dependencies, and need patches to work properly:

[patch.crates-io]
# For webp support - https://github.com/image-rs/image/pull/2228
image = { git = "https://github.com/image-rs/image" }
# For webp support - https://github.com/image-rs/image-webp/pull/76
image-webp = { git = "https://github.com/image-rs/image-webp" }

Bevy Support

Bevy vleue_kinetoscope
main main
0.14 0.2
0.13 0.1