From 8775459883ba06748cd2d23f158a429254b8ef4d Mon Sep 17 00:00:00 2001 From: Andrew William Watson Date: Tue, 12 Mar 2024 09:09:19 -0400 Subject: [PATCH] rebased on latest main --- examples/games/game_menu.rs | 44 +++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/examples/games/game_menu.rs b/examples/games/game_menu.rs index 21f3f087520f15..88886b55e2acd3 100644 --- a/examples/games/game_menu.rs +++ b/examples/games/game_menu.rs @@ -45,9 +45,9 @@ use bevy::prelude::*; -const TEXT_COLOR: Color = Color::rgb(0.9, 0.9, 0.9); +const TEXT_COLOR: Color = Color::srgb(0.9, 0.9, 0.9); -const RED: Color = Color::CRIMSON; +const RED: Color = Color::srgba(0.863, 0.078, 0.235, 1.0); // Enum that will be used as a global state for the game #[derive(Clone, Copy, Default, Eq, PartialEq, Debug, Hash, States)] @@ -245,12 +245,12 @@ mod game { TextBundle::from_sections([ TextSection::new( format!("quality: {:?}", *display_quality), - default_font(60., Color::BLUE), + default_font(60., Color::srgb(0.0, 0.0, 1.0)), ), TextSection::new(" - ", default_font(60., TEXT_COLOR)), TextSection::new( format!("volume: {:?}", *volume), - default_font(60., Color::GREEN), + default_font(60., Color::srgb(0.0, 1.0, 0.0)), ), ]) .with_style(Style { @@ -357,10 +357,10 @@ mod menu { #[derive(Component)] struct OnSoundSettingsMenuScreen; - const NORMAL_BUTTON: Color = Color::rgb(0.15, 0.15, 0.15); - const HOVERED_BUTTON: Color = Color::rgb(0.25, 0.25, 0.25); - const HOVERED_PRESSED_BUTTON: Color = Color::rgb(0.25, 0.65, 0.25); - const PRESSED_BUTTON: Color = Color::rgb(0.35, 0.75, 0.35); + const NORMAL_BUTTON: Color = Color::srgb(0.15, 0.15, 0.15); + const HOVERED_BUTTON: Color = Color::srgb(0.25, 0.25, 0.25); + const HOVERED_PRESSED_BUTTON: Color = Color::srgb(0.25, 0.65, 0.25); + const PRESSED_BUTTON: Color = Color::srgb(0.35, 0.75, 0.35); // Tag component used to mark which setting is currently selected #[derive(Component)] @@ -381,17 +381,19 @@ mod menu { // This system handles changing all buttons color based on mouse interaction fn button_system( mut interaction_query: Query< - (&Interaction, &mut BackgroundColor, Option<&SelectedOption>), + (&Interaction, &mut UiImage, Option<&SelectedOption>), (Changed, With