From 2f9afaeac119d0c936acf0f0713472e312f5c3ae Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Sat, 26 Jul 2025 18:30:38 -0500 Subject: [PATCH] Replace spawn_ui implementation --- src/lib.rs | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index fd107de..539118f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -229,36 +229,10 @@ fn wrap_entities(mut query: Query<&mut Position>, world_size: Res) { } fn spawn_ui(mut commands: Commands, score: Res, lives: Res) { - commands.spawn(TextBundle::from_sections([ - TextSection::new( - "Score: ", - TextStyle { - font_size: 25.0, - ..default() - }, - ), - TextSection::new( - *score, - TextStyle { - font_size: 25.0, - ..default() - }, - ), - TextSection::new( - " | Lives: ", - TextStyle { - font_size: 25.0, - ..default() - }, - ), - TextSection::new( - *lives, - TextStyle { - font_size: 25.0, - ..default() - }, - ), - ])); + commands.spawn(( + Text::new(format!("Score: {score:?} | Lives: {lives:?}")), + TextFont::from_font_size(25.0), + )); } fn start_screen(mut commands: Commands) {