#iced #bevy-ui #bevy #ui #gui #game

bevy_iced

Bevy的Iced集成

9个不稳定版本

0.5.0 2024年7月1日
0.4.0 2023年8月9日
0.3.1 2023年8月3日
0.3.0 2023年4月16日
0.1.1 2022年6月6日

#1152 in 游戏开发

Download history 1/week @ 2024-04-22 6/week @ 2024-06-03 4/week @ 2024-06-10 2/week @ 2024-06-24 185/week @ 2024-07-01 79/week @ 2024-07-29

每月下载量 87次

MIT/Apache

59KB
905 代码行

bevy_iced: 在你的 Bevy 应用程序中使用 Iced UI程序

Crates.io MIT/Apache 2.0

示例

use bevy::prelude::*;
use bevy_iced::iced::widget::text;
use bevy_iced::{IcedContext, IcedPlugin};

#[derive(Event)]
pub enum UiMessage {}

pub fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(IcedPlugin::default())
        .add_event::<UiMessage>()
        .add_systems(Update, ui_system)
        .run();
}

fn ui_system(time: Res<Time>, mut ctx: IcedContext<UiMessage>) {
    ctx.display(text(format!(
        "Hello Iced! Running for {:.2} seconds.",
        time.elapsed_seconds()
    )));
}

请参阅示例文档以了解如何使用此crate的更多详细信息。

兼容性

Bevy版本 crate版本
0.13 0.5, master
0.11 0.4
0.10 0.3
0.9 0.2
0.7 0.1

待办事项

  • 多窗口支持
  • 剪贴板支持

致谢

依赖项

~50–87MB
~1.5M SLoC