UnrealScript Game Programming Cookbook

(Chris Devlin) #1

7


HUD


In this chapter, we will cover:


f Displaying a bar for the player's health
f Drawing text for the player's health
f Displaying a bar for the player's ammo
f Drawing text for the player's ammo
f Drawing the player's name on screen
f Creating a crosshair

Introduction


A heads-up display, or HUD, in addition to providing a user interface (UI), offers a means
of providing information to a player to allow them to interact with the game world.


UDK offers two methods for creating a HUD. The first and most simple method which
we'll be covering here is Canvas. The other method, which requires knowledge of the
flash language ActionScript and some fancy art skills, allows UDK to make use of a
third-party tool called Scaleform to draw the HUD.


Scaleform is probably what you see in most TripleA games, as it offers a far more impressive
and professional aesthetic, albeit at a greater time commitment, in addition to an expensive
suite of tools. There are a number of free flash editors available, however, including Ajax
Animator, FlashDevelop, and Open Dialect.

Free download pdf