Skip to content

Commit d971632

Browse files
authored
Add music and sound effects labels to options panel
Added labels for music and sound effects options in the UI.
1 parent 7db0752 commit d971632

File tree

1 file changed

+14
-1
lines changed
  • articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/titlescene

1 file changed

+14
-1
lines changed

articles/tutorials/building_2d_games/20_implementing_ui_with_gum/snippets/titlescene/createoptionspanel.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ private void CreateOptionsPanel()
1111
optionsText.Text = "OPTIONS";
1212
_optionsPanel.AddChild(optionsText);
1313

14+
Label musicLabel = new Label();
15+
musicLabel.Text = "Music";
16+
musicLabel.X = 35;
17+
musicLabel.Y = 35;
18+
optionsPanel.AddChild(musicLabel);
19+
1420
var musicSlider = new Slider();
1521
musicSlider.Anchor(Gum.Wireframe.Anchor.Top);
1622
musicSlider.Visual.Y = 30f;
@@ -23,6 +29,13 @@ private void CreateOptionsPanel()
2329
musicSlider.ValueChangeCompleted += HandleMusicSliderValueChangeCompleted;
2430
_optionsPanel.AddChild(musicSlider);
2531

32+
Label soundEffectsLabel = new Label();
33+
soundEffectsLabel.Text = "Sound Effects";
34+
soundEffectsLabel.X = 20;
35+
soundEffectsLabel.Y = 80;
36+
optionsPanel.AddChild(soundEffectsLabel);
37+
38+
2639
var sfxSlider = new Slider();
2740
sfxSlider.Anchor(Gum.Wireframe.Anchor.Top);
2841
sfxSlider.Visual.Y = 93;
@@ -42,4 +55,4 @@ private void CreateOptionsPanel()
4255
_optionsBackButton.Y = -10f;
4356
_optionsBackButton.Click += HandleOptionsButtonBack;
4457
_optionsPanel.AddChild(_optionsBackButton);
45-
}
58+
}

0 commit comments

Comments
 (0)