diff --git a/src/main.rs b/src/main.rs index e7a11a9..2c9bc1e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,14 @@ +/// Helper module containing common imports across the project +pub(crate) mod prelude; + +/// Menu plugin, state, systems +pub(crate) mod menu; + +use crate::prelude::*; + fn main() { - println!("Hello, world!"); + App::new() + .add_plugins(DefaultPlugins) + .add_plugins(menu::MenuPlugin) + .run(); } diff --git a/src/menu.rs b/src/menu.rs new file mode 100644 index 0000000..4aed6f2 --- /dev/null +++ b/src/menu.rs @@ -0,0 +1,60 @@ +use crate::prelude::*; + +pub(crate) struct MenuPlugin; + +impl Plugin for MenuPlugin { + fn build(&self, app: &mut App) { + app.add_systems(Startup, init_menu); + } +} + +fn init_menu(mut commands: Commands) { + commands.spawn(Camera3dBundle { ..default() }); + commands + .spawn(NodeBundle { + style: Style { + max_width: Val::Percent(60.0), + max_height: Val::Percent(100.0), + ..default() + }, + ..default() + }) + .with_children(|parent| { + parent.spawn(TextBundle { + style: Style { + ..default() + }, + text: Text { + justify: JustifyText::Center, + sections: vec![ + TextSection::new( + "ACTS", + TextStyle { + font_size: 384.0, + color: Color::WHITE, + ..default() + }, + ), + TextSection::new( + "of\n", + TextStyle { + font_size: 16.0, + color: Color::WHITE, + ..default() + }, + ), + TextSection::new( + "GODS", + TextStyle { + font_size: 384.0, + color: Color::WHITE, + ..default() + }, + ), + ], + ..default() + }, + ..default() + }); + }); +} diff --git a/src/prelude.rs b/src/prelude.rs new file mode 100644 index 0000000..f5a3adf --- /dev/null +++ b/src/prelude.rs @@ -0,0 +1 @@ +pub(crate) use bevy::prelude::*; diff --git a/src/ui.rs b/src/ui.rs new file mode 100644 index 0000000..2f25855 --- /dev/null +++ b/src/ui.rs @@ -0,0 +1,9 @@ +use crate::prelude::*; + +pub(crate) struct UiPlugin; + +impl Plugin for UiPlugin { + fn build(&self, app: &mut App) { + app.add_systems(Startup, init_ui); + } +}