Game Development Reference
In-Depth Information
Chapter 2. GUI Time
In video games, the GUI is one of the most important parts of the game. It's where you
see how much health you have, what level you are at, how much gold you're carrying,
and so on. It's how you gather information on your character and the world you are in.
In this chapter, we'll be covering the following topics:
• Both 2D and 3D GUI elements
• How to create GUI buttons
• How to create a 2D health bar
• Tracking the player's level by using a GUI label
• Using two GUI boxes to make an experience bar
• Creating a 3D health bar
• Showing 3D damage reports
• Showing enemy name tags
A traditional 2D UI
To start our GUI programming, we'll create some buttons, a health bar, a level counter,
and an experience counter. All of these are common in a variety of video games and
are key elements to game design.
Setting up our scene
Since in this part of the chapter we will be dealing with 3D space, we'll need to set
up a scene to test with. We'll only need a basic test level, so create a new scene and
name it Chapter 2 . Add a cube or plane for the floor, a directional light, a GameOb-
ject for our enemy, and two quads. This is what my scene looks like:
Search WWH ::




Custom Search