Expand description
§Use Iced UI programs in your Bevy application
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()
)));
}
Modules§
- Basic re-exports for all Iced-related stuff.
Structs§
- The context for interacting with Iced. Add this as a parameter to your system.
- The main feature of
bevy_iced
. Add this to yourApp
by callingapp.add_plugin(bevy_iced::IcedPlugin::default())
. - Settings used to independently customize Iced rendering.
Type Aliases§
- The default renderer.