demo_hello_world/main.rs
1use bones_bevy_renderer::BonesBevyRenderer;
2use bones_framework::prelude::*;
3
4fn main() {
5 // Setup logging
6 setup_logs!();
7
8 // First create bones game.
9 let mut game = Game::new();
10
11 // Create a new session for the game menu. Each session is it's own bones world with it's own
12 // plugins, systems, and entities.
13 game.sessions
14 .create_with("menu", |session: &mut SessionBuilder| {
15 session
16 // Install the default bones_framework plugin for this session
17 .install_plugin(DefaultSessionPlugin)
18 // Add our menu system to the update stage
19 .add_system_to_stage(Update, menu_system);
20 });
21
22 BonesBevyRenderer::new(game).app().run();
23}
24
25/// System to render the home menu.
26fn menu_system(ctx: Res<EguiCtx>) {
27 egui::CentralPanel::default().show(&ctx, |ui| {
28 ui.label("Hello World");
29 });
30}