6 个版本
0.2.0 | 2024 年 7 月 4 日 |
---|---|
0.2.0-rc.4 | 2024 年 6 月 29 日 |
0.1.1 | 2024 年 5 月 24 日 |
在 游戏开发 中排名 #2249
每月下载量 264
1.5MB
254 行
动态电影仪_kinetoscope
Bevy 的动态 GIF 和 WebP 播放器。
使用方法
系统设置
将插件添加到您的应用程序
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