#gif #animation #bevy

vleue_kinetoscope

Bevy 的动态 GIF 播放器

6 个版本

0.2.0 2024 年 7 月 4 日
0.2.0-rc.42024 年 6 月 29 日
0.1.1 2024 年 5 月 24 日

游戏开发 中排名 #2249

Download history 256/week @ 2024-05-20 105/week @ 2024-05-27 136/week @ 2024-06-03 82/week @ 2024-06-10 106/week @ 2024-06-17 81/week @ 2024-06-24 227/week @ 2024-07-01 60/week @ 2024-07-08 32/week @ 2024-07-15 121/week @ 2024-07-29 103/week @ 2024-08-05

每月下载量 264

MIT/Apache

1.5MB
254

动态电影仪_kinetoscope

MIT/Apache 2.0 Doc Crate Bevy Tracking CI

Bevy 的动态 GIF 和 WebP 播放器。

animated-gif

使用方法

系统设置

将插件添加到您的应用程序

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

fn main() {
    App::new()
        // Usually included with `DefaultPlugins`
        .add_plugins(AssetPlugin::default())
        .add_plugins(AnimatedImagePlugin);
}

播放动态 GIF

使用 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 支持

由于依赖项的发布版本中存在动画 WebP 的当前问题,需要修补才能正常工作

[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 支持

Bevy 动态电影仪_kinetoscope
main main
0.14 0.2
0.13 0.1

依赖项

~36–72MB
~1.5M SLoC