Game Development Reference
In-Depth Information
Chapter
6
Menus & Popovers
By this point, you have a level and game elements that make the game playable in prin-
ciple. Before expanding upon more game elements and additional levels, I would like to
take some time to connect the dots...the menus to be precise.
The saws should probably kill the player, but this requires a Game over menu to allow the
player to retry or end the level. You can't pause the game either, nor does it pause automat-
ically when the app is sent to the background.
You'll learn how menus can be designed to scale easily with varying screen resolutions, as
well as how to present them as popovers or full-screen views without having to change
scenes. You will also find use for the Callbacks feature of the Timeline.
Static In-game Menus
For user interface elements such as a pause button or score display, you'll need a way to
fixate these elements on the screen so that they don't move along when the level scrolls.
But before you do that, you should add the prepared user interface graphics.
Adding Menu Graphics
In the topic's downloadable archive in the Graphics folder, you'll find the Menu and
UserInterface folders. You should drag both folders onto the SpriteSheets folder in
SpriteBuilder. Then turn these two folders into Sprite Sheets by right-clicking them and se-
lecting Make Smart Sprite Sheet . As usual, you should change the format to PVR
RGBA8888 with Compress checked.
If you want to use your own menu and UI images, you can do so. There are no fixed sizes
for the individual images except for the menu background, which should fill the entire
screen. Though if you use custom graphics, you may need to use different values for certain
property values (position, content size) to make your images fit.
Search WWH ::




Custom Search