Displaying the power cell HUD
Now that we have our power cell collectables and inventory in place, we'll need to show the player a visual representation of what the player has collected. The textures imported with the Book
Assets
have been designed to clearly show that the player will need to collect four power cells to fully charge the door. By swapping an empty power cell texture image on-screen for one with 1
unit of charge, then for an image with 2
units of charge, and so on, we can create the illusion of a dynamic interface element. This is shown in the following image:
The Book Assets | Textures folder contains the five image files we need for this GUI Texture-based HUD—one of an empty power cell and the others of the four stages of charge. Created in Adobe Photoshop, these images have a transparent background, and are saved in a PNG (Portable Network Graphics ) format. The PNG format was selected because it is compressed but still supports high quality alpha channels. Alpha channels...