From 37316c7706397ea6333a58fbe97b4f4f9d98fece Mon Sep 17 00:00:00 2001 From: Klaas-Jan Boon Date: Wed, 11 Sep 2024 02:49:27 +0200 Subject: [PATCH] Fix "game_menu" example buttons not changing color on Interaction (#15153) # Objective Fixes #15079 , repairing the `game_menu` example ## Solution - Changed the target component for the color updates from `UiImage` to `BackgroundColor`. - Changed the width of the `button_style` to `300px` to prevent overlap with the text. ## Testing Checked that buttons now correctly update their background color on hover/exit/press. --- ## Showcase https://github.com/user-attachments/assets/8f7ede9b-c271-4b59-91f9-27d9e3db1429 --- examples/games/game_menu.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/games/game_menu.rs b/examples/games/game_menu.rs index 5c5f1c4752..5e64a164c4 100644 --- a/examples/games/game_menu.rs +++ b/examples/games/game_menu.rs @@ -345,16 +345,16 @@ mod menu { // This system handles changing all buttons color based on mouse interaction fn button_system( mut interaction_query: Query< - (&Interaction, &mut UiImage, Option<&SelectedOption>), + (&Interaction, &mut BackgroundColor, Option<&SelectedOption>), (Changed, With