Game Development Reference
In-Depth Information
The menu controls, that is, the
Play
and
Options
buttons, will disappear when the
Options
window is shown. To close the
Options
window, the player has to choose
between saving and canceling any changes that have been made in the window.
When the
Options
window is hidden, the menu controls will appear again.
Usually, we would have to draw all of these textures that you see in the preceding
screenshot to use all of the shown widgets. Luckily, we can take a shortcut here by
taking a texture atlas, a suitable skin file, and a font definition file for the text to be
displayed in these widgets from LibGDX's test repository. It contains much more
than we need, so you might also want to take a closer look at the skin file to find out
how certain widgets need to be defined that are not covered here.
You will need the following files from LibGDX's test repository to put them into
CanyonBunny-android/assets/images/
:
•
uiskin.png
•
uiskin.atlas
•
uiskin.json
•
default.fnt
Alternatively, you can download these files from the code bundle of
Chapter 7
,
Menus
and Options
, and place them at
CanyonBunny-android/assets/images/
.
This is how the image of the file
uiskin.png
should look:
There are two more actions that we will do in advance before we go back to
implementing the actual layer for the
Options
menu.
The first action is to create a new class that abstracts the process of loading and
saving all of our game settings.