Introduction
Almost all the recipes in this chapter involve different interactive UI controls. Although there are different kinds of interactive UI controls, the basic way to work with them, and have scripted actions respond to user actions, is all based on the same idea: events triggering the execution of object method functions.
Then, for fun, and an example of a very different kind of UI, the final recipe demonstrates how to add to your game a sophisticated real-time communication of the relative positions of objects in the scene (that is, a radar!).
The big picture
The UI can be used for three main purposes:
- To display static (unchanging) values, such as the name or logo image of the game, or word labels such as Level and Score, that tell us what the numbers next to them indicate (recipes for these can be found in the Chapter 1, Displaying Data with Core UI Elements).
- To display values that change due to our scripts, such as timers, scores, or the distance from our Player character to some...