HUD

The HUD is "everything on screen that isn't the game world". For Death Dawn, this means:

Onscreen text messages

There are several types of text message that can be displayed on screen at any one time. The message types are as follows:

To save screen space, each message is only displayed when it is needed to be seen by the user. Some message types (location, car, pickup, radio) are generated by the engine automatically; other types (mission title, mission text, pager) are generated by the mission script. Script-generated messages are displayed using a queue system, so that the mission script doesn't have to worry about waiting for the user to read each message before displaying the next. The other engine messages do not use a queue however, as they are used to show the momentary state of the player rather than information which the player must digest.

The mission text message type allows for multi-colour text, via the use of special character sequences. The sequence %RGB in the text will trigger a change to 12-bit RGB colour 'RGB' (specified in hex). The sequence %% results in a literal % being displayed. Also, the wordwrap code used will translate sequences of spaces into a single space (including spaces around colour-change codes).

Each time a new message is triggered, a sound appropriate to the message type is played (once implemented, that is).

Player status

This HUD element is a composite element, displaying several different pieces of data at different locations on the screen. The mission script can enable/disable different elements by using the HUDFLAG command. Current elements are:

Compass

The compass is overlayed ontop of the player and is used to indicate the direction(s) to travel to reach certain mission objectives. The compass consists of a series of coloured arrows; the colour and target of each arrow can be specified by the mission script, using the COMPASS command. If the target for an arrow is visible on screen, then the arrow will fly out and point directly at it; otherwise it will sit near to the player and point in the general direction.

UI sprites

Without the UI sprites (and font system), the HUD would be rather boring. The UI sprites code maintains a hash map of sprites used by the HUD and loading screens; however the interface is currently rather simplistic as it does not support any form of auto-animated sprite.

TODO:
DOCS: MED: Minimap? Possible to generate simple cartoony one using the map structure? grey = road, yellow = pavement, green = ground, blue = water, red = building, etc.
MUST-DOCS: MED: Respect meter - showing factions indicated by mission script
MUST-CODE: QUICK: Message sounds!
CODE: QUICK: Check how savegames handle compass colours defined in a constant var
CODE: MED: Improve text messages. Flashing pager light, PAGER timing tweaks, CLEARMESSAGES script command, animated TEXT logos (requires animated UI sprites of some kind - just use custom anim code rather than integrate into UI sprite code?)
CODE: MED: Fix any HUD elements that overlap (pager vs. weapon indicator?)
CODE: MED: Allow pager to be used as timer device, ala GTA 1/2?
MUST-CODE: MED: (Debug?) HUD elements showing car health/state
CODE: MED: Implement spinner number things that flip through numbers one at a time?
MUST-CODE: MED: Fix compass needle jumping!
???
Profit!