From d9716326b18b3fe5d529685a173b37f91ff25a2b Mon Sep 17 00:00:00 2001 From: "Jordan \"Heroic\" Hunt" Date: Thu, 27 Nov 2025 19:19:30 -0600 Subject: [PATCH 1/2] Add music and sound effects labels to options panel Added labels for music and sound effects options in the UI. --- .../snippets/titlescene/createoptionspanel.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/titlescene/createoptionspanel.cs b/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/titlescene/createoptionspanel.cs index e88fbc8c..975fa36f 100644 --- a/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/titlescene/createoptionspanel.cs +++ b/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/titlescene/createoptionspanel.cs @@ -11,6 +11,12 @@ private void CreateOptionsPanel() optionsText.Text = "OPTIONS"; _optionsPanel.AddChild(optionsText); + Label musicLabel = new Label(); + musicLabel.Text = "Music"; + musicLabel.X = 35; + musicLabel.Y = 35; + optionsPanel.AddChild(musicLabel); + var musicSlider = new Slider(); musicSlider.Anchor(Gum.Wireframe.Anchor.Top); musicSlider.Visual.Y = 30f; @@ -23,6 +29,13 @@ private void CreateOptionsPanel() musicSlider.ValueChangeCompleted += HandleMusicSliderValueChangeCompleted; _optionsPanel.AddChild(musicSlider); + Label soundEffectsLabel = new Label(); + soundEffectsLabel.Text = "Sound Effects"; + soundEffectsLabel.X = 20; + soundEffectsLabel.Y = 80; + optionsPanel.AddChild(soundEffectsLabel); + + var sfxSlider = new Slider(); sfxSlider.Anchor(Gum.Wireframe.Anchor.Top); sfxSlider.Visual.Y = 93; @@ -42,4 +55,4 @@ private void CreateOptionsPanel() _optionsBackButton.Y = -10f; _optionsBackButton.Click += HandleOptionsButtonBack; _optionsPanel.AddChild(_optionsBackButton); -} \ No newline at end of file +} From 10cb46c93bb1d9342967e282fed44772c857aca9 Mon Sep 17 00:00:00 2001 From: "Jordan \"Heroic\" Hunt" Date: Thu, 27 Nov 2025 19:21:03 -0600 Subject: [PATCH 2/2] Refactor CreateOptionsPanel for consistency --- .../snippets/titlescene/createoptionspanel.cs | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/titlescene/createoptionspanel.cs b/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/titlescene/createoptionspanel.cs index 975fa36f..9cd19de2 100644 --- a/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/titlescene/createoptionspanel.cs +++ b/articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/titlescene/createoptionspanel.cs @@ -1,5 +1,4 @@ -private void CreateOptionsPanel() -{ +private void CreateOptionsPanel() { _optionsPanel = new Panel(); _optionsPanel.Dock(Gum.Wireframe.Dock.Fill); _optionsPanel.IsVisible = false; @@ -11,11 +10,11 @@ private void CreateOptionsPanel() optionsText.Text = "OPTIONS"; _optionsPanel.AddChild(optionsText); - Label musicLabel = new Label(); - musicLabel.Text = "Music"; - musicLabel.X = 35; - musicLabel.Y = 35; - optionsPanel.AddChild(musicLabel); + var musicLabel = new Label(); + musicLabel.Text = "Music"; + musicLabel.X = 35; + musicLabel.Y = 35; + optionsPanel.AddChild(musicLabel); var musicSlider = new Slider(); musicSlider.Anchor(Gum.Wireframe.Anchor.Top); @@ -29,13 +28,12 @@ private void CreateOptionsPanel() musicSlider.ValueChangeCompleted += HandleMusicSliderValueChangeCompleted; _optionsPanel.AddChild(musicSlider); - Label soundEffectsLabel = new Label(); - soundEffectsLabel.Text = "Sound Effects"; - soundEffectsLabel.X = 20; - soundEffectsLabel.Y = 80; - optionsPanel.AddChild(soundEffectsLabel); + var sfxLabel = new Label(); + sfxLabel.Text = "SFX"; + sfxLabel.X = 20; + sfxLabel.Y = 80; + optionsPanel.AddChild(sfxLabel); - var sfxSlider = new Slider(); sfxSlider.Anchor(Gum.Wireframe.Anchor.Top); sfxSlider.Visual.Y = 93;