Adding a Heads-up Display

Most games display information onscreen about the players, such as their health, names, any power-ups they may have, or other useful information. This data usually displays near the top of the main game display in what’s known as a Heads-Up Display (HUD)—named after some really cool military hardware that lets pilots see data about their aircraft without looking down at an instrument panel.

You need the Heads-Up Display to render on top of the map, in a smaller font so that it is both easier to read and can contain more detail than you would fit on a layer with huge graphical tiles.

Adding Another Rendering Layer

The game currently has two layers: the map and entities. The HUD lives on a third layer, rendered on top ...

Get Hands-on Rust now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.