Examples
We will continue to work on the UI we have been building for the last two chapters. To help organize the project, duplicate the Chapter7
scene that you created in the last chapter; it will automatically be named Chapter8
.
Note
If you did not work through the examples for Chapter 6, and Chapter 7, but would like to work through the examples in this chapter, you can import the package labeled Chapter 08
– Examples 1 - Start
. You can also view the completed examples in the Chapter 08
– Examples 1 –
End
package.
Showing and hiding pop-up menus with keypress
So far, we have made two Panels that we plan on turning into popups: the Pause Panel
from Chapter 6, and the Inventory Panel
from Chapter 7. Right now, they are both visible in the scene (even though Pause Panel
is hidden behind the Inventory Panel
). We want them to pop up when we press P and I on the keyboard. For demonstration purposes, we’ll access the keyboard keys differently for...