use bevy::prelude::*; use bevy_egui::{egui, EguiContexts, EguiPlugin, EguiPrimaryContextPass}; fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugins(EguiPlugin::default()) .add_systems(Startup, setup_camera_system) .add_systems(EguiPrimaryContextPass, ui_example_system) .run(); } fn setup_camera_system(mut commands: Commands) { commands.spawn(Camera2d); } fn ui_example_system(mut contexts: EguiContexts) -> Result { egui::Window::new("Hello").show(contexts.ctx_mut()?, |ui| { ui.label("world"); }); Ok(()) }