From cf678f9f16dbc7e9953c1a0712260d1feb4024d7 Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Sat, 26 Jul 2025 18:44:10 -0500 Subject: [PATCH] Update spawn_screen function --- src/lib.rs | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 539118f..290a840 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -238,22 +238,18 @@ fn spawn_ui(mut commands: Commands, score: Res, lives: Res) { fn start_screen(mut commands: Commands) { commands.spawn(( TitleUI, - TextBundle::from_sections([ - TextSection::new( - "Robert's Bad Asteroids Game", - TextStyle { - font_size: 50.0, - ..default() - }, - ), - TextSection::new( - "Press space to begin", - TextStyle { - font_size: 40.0, - ..default() - }, - ), - ]) - .with_text_justify(bevy::text::JustifyText::Center), - )); + Node { + flex_direction: FlexDirection::Column, + ..Default::default() + }, + )).with_children(|cmds| { + cmds.spawn(( + Text::new("Robert's Bad Asteroids Game"), + TextFont::from_font_size(50.0), + )); + cmds.spawn(( + Text::new("Press space to begin"), + TextFont::from_font_size(40.0), + )); + }); }