Game Development Reference
In-Depth Information
Here is a screenshot of the final
Options
window, menu screen, and the opened
Options
window:
The thin pixel lines that are drawn all over the widgets are the enabled debug visuals
of
TableLayout
.
The
Options
window is now fully functional. It shows up when the
Options
button
is clicked and hides when the
Save
or
Cancel
button is clicked. The settings are only
applied and saved with a click on the
Save
button.
Using the game settings
A lot of work went into the creation of our menu screen and also into the
Options
window in order to allow the change of certain game settings. What is still missing
is the actual usage of the set values in our game. Luckily, this can be achieved very
easily now with just a couple of additional lines of code.
Add the following import line to
GameScreen
:
import com.packtpub.libgdx.canyonbunny.util.GamePreferences;