Expand description
Use Iced UI programs in your Bevy application
use bevy::prelude::*;
use bevy_iced::{
IcedAppExtensions, IcedPlugin,
iced::{Program, program::State}
};
#[derive(Default)]
pub struct Ui {
// Set up your UI state
}
impl Program for Ui {
// Set up your program logic
}
pub fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(IcedPlugin)
.insert_program(Ui::default())
.add_system(ui_system)
.run();
}
pub fn ui_system(mut ui_state: ResMut<State<Ui>>, /* ... */) {
// Do some work here, then modify your ui state by running
// ui_state.queue_message(..);
}Re-exports
pub use iced_native as iced;pub use iced_wgpu;Structs
The main feature of bevy_iced.
Add this to your App by calling app.add_plugin(bevy_iced::IcedPlugin).
The user-defined rendering state of an Iced program.
Settings used to independently customize Iced rendering.
Traits
A trait that adds the necessary features for an App
to handle Iced.