Skip to content

vleue/vleue_kinetoscope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 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()
        .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

About

Animated GIF / WebP player for Bevy

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 2

  •  
  •  

Languages