From 272543eff6b4bca57fd3f6b88faa7ca4d9b7142f Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Wed, 13 Aug 2025 13:03:47 -0700 Subject: [PATCH] Made flap/rewind buttons bigger --- src/bin/flappy/main.rs | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/bin/flappy/main.rs b/src/bin/flappy/main.rs index ad7e5d5..a88acc3 100644 --- a/src/bin/flappy/main.rs +++ b/src/bin/flappy/main.rs @@ -536,7 +536,7 @@ fn init_ui(mut commands: Commands) { ..default() }, PlayerState::Pause, - children![Text::new("Go!")], + Text::new("PAUSED"), )); commands @@ -544,26 +544,46 @@ fn init_ui(mut commands: Commands) { align_self: AlignSelf::End, justify_self: JustifySelf::Center, flex_direction: FlexDirection::Row, + justify_content: JustifyContent::SpaceEvenly, + width: Val::Percent(100.0), + min_height: Val::Percent(10.0), ..default() }) .with_children(|parent| { parent .spawn(( - Node { ..default() }, + Node { + width: Val::Percent(50.0), + align_items: AlignItems::Center, + justify_content: JustifyContent::Center, + ..default() + }, Button, BackgroundColor::default(), RewindButton, - children![Text::new("Rewind!"),], + children![ + Text::new("Rewind!"), + TextLayout::new_with_justify(JustifyText::Center) + ], )) .observe(start_rewind) .observe(end_rewind); parent .spawn(( - Node { ..default() }, + Node { + width: Val::Percent(50.0), + align_items: AlignItems::Center, + justify_content: JustifyContent::Center, + ..default() + }, Button, FlapButton, - children![Text::new("Flap!"),], + children![ + Text::new("Flap!"), + TextFont::from_font_size(30.0), + TextLayout::new_with_justify(JustifyText::Center) + ], )) .observe(flap_button); }); @@ -575,9 +595,11 @@ fn init_ui(mut commands: Commands) { ..default() }, BackgroundColor(WHITE.into()), - SyncResource::::default(), - Text::default(), - TextLayout::new_with_justify(JustifyText::Center), + children![( + SyncResource::::default(), + Text::default(), + TextLayout::new_with_justify(JustifyText::Center), + )] )); }