Expand description
Use Iced UI programs in your Bevy application
use bevy::prelude::*;
use bevy_iced::iced::widget::text;
use bevy_iced::{IcedContext, IcedPlugin};
pub enum UiMessage {}
pub fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(IcedPlugin)
.add_event::<UiMessage>()
.add_system(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()
)));
}Feature flags
touch: Enables touch input. Is not exclude input from the mouse.
Re-exports
pub use iced_native as iced;pub use iced_wgpu;
Structs
- The context for interacting with Iced. Add this as a parameter to your system.
- The main feature of
bevy_iced. Add this to yourAppby callingapp.add_plugin(bevy_iced::IcedPlugin). - Settings used to independently customize Iced rendering.