Game Development Reference
In-Depth Information
Chapter 8
Graphical User Interfaces
In this chapter we'll create a basic graphical user interface (GUI) system for CMOD. This includes
a main menu and a HUD (head-up display). The main menu will appear when the user presses the
Escape key on the keyboard, allowing him to restart, load, save, and exit the game. And the head-up
display will continually show Player health, as well as the ammo status for the active weapon. In
creating the GUI, we'll explore a range of subjects, including screen dimensions, the aspect ratio,
widgets, anchoring, GUI scaling, and resolution independence. As always, these subjects apply
practically, not just for CMOD or Unity specifically, but for game engines and games, as well as
software and web sites in general. So, let's get started with creating GUIs.
GUIs in Games
Graphical user interfaces refer to, in sum, all 2D graphics rendered in screen space, such as
menus, health bars, and buttons. These let the gamer interact with the game, performing critical
functions. Using GUIs, gamers can load and save their game states, monitor their health status,
consult minimaps and radar displays, see the ammo status of their weapons, and lots more besides,
depending on the types of games they're playing.
GUIs are, in many respects, unique among all other assets and objects in a video game. Specifically,
they're not supposed to exist within the game world itself. Enemies, like the drone and boss
characters for CMOD, live within the game world and interact directly with the Player, attacking or
chasing. Weapons and props also exist in game space; they can be collected and used by the Player
to attack Enemies. With these objects and more, the Player can do things, and the presence of these
objects makes a substantive difference on the course of events in-game . But GUIs are different.
They work at a different level; existing outside the game space, and working at a level of abstraction
from the game. Their purpose is either to provide information in an augmented reality sense, such as
displaying the health status of the Player, or to provide access to fundamental game functionality at
a system level, such as exiting , restarting , or pausing the game.
255
 
Search WWH ::




Custom Search