Skip to content

Commit 4a1d4ca

Browse files
committed
Add missing snippets
1 parent 8372d0d commit 4a1d4ca

File tree

1 file changed

+12
-0
lines changed
  • articles/tutorials/building_2d_games/20_implementing_ui_with_gum

1 file changed

+12
-0
lines changed

articles/tutorials/building_2d_games/20_implementing_ui_with_gum/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,18 @@ Next, we will create a method that builds our pause panel with resume and quit b
534534
535535
[!code-csharp[](./snippets/gamescene/createpausepanel.cs)]
536536
537+
Now we should implement the event handlers for these controls. First, we will implement the handler for the "Resume" button. Add the following method to the `GameScene` class after the `CreatePausePanel` method:
538+
539+
[!code-csharp[](./snippets/gamescene/handleresumebuttonclicked.cs)]
540+
541+
This method plays the UI sound effect for auditory feedback and then hides the pause panel so that the game can resume.
542+
543+
Next is the handler for the "Quit" button. Add the following method to the `GameScene` class after the `HandleResumeButtonClicked` method:
544+
545+
[!code-csharp[](./snippets/gamescene/handlequitbuttonclicked.cs)]
546+
547+
This method as well plays the UI sound effect for auditory feedback, then quits the game by changing scenes back to the title scene.
548+
537549
#### Initializing the UI
538550
539551
Now that we have implemented the method to create the pause panel, we can implement the main UI initializations method that will call them. Add the following method to the `GameScene` class after the `CreatePausePanel` method:

0 commit comments

Comments
 (0)