Expand description
§vleue_kinetoscope
Animated GIF and WebP player for Bevy.
§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 component AnimatedImageController
:
use bevy::prelude::*;
use vleue_kinetoscope::*;
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
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(AnimatedImageController::play(asset_server.load("cube.webp")));
}
§Bevy Support
Bevy | vleue_kinetoscope |
---|---|
main | main |
0.15 | 0.3 |
0.14 | 0.2 |
0.13 | 0.1 |
Structs§
- Animated
Image - An animated image asset.
- Animated
Image Controller - Component to help control the animation of an
AnimatedImage
. - Animated
Image Loader - Loader for animated images (GIF and WebP).
- Animated
Image Plugin - A plugin for loading and displaying animated images (GIF or WebP).
- Frame
- Frame of an animated image.