mirror of
https://github.com/csd4ni3l/soundboard.git
synced 2026-01-01 04:23:45 +01:00
22 lines
592 B
Rust
22 lines
592 B
Rust
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(())
|
|
} |