13
Layering Views and Implementing the HUD
In this chapter, we will get to see the real value of SFML Views. We will add a selection of SFML Text
objects and manipulate them as we did before in the Timber!!! project and the Pong project. What’s new is that we will draw the HUD using a second View
instance. This way, the HUD will stay neatly positioned over the top of the main game action, regardless of what the background, player, zombies, and other game objects are doing.
Here is what we will do in this chapter:
- Adding all the
Text
and HUD objects - Updating the HUD
- Drawing the HUD, home, and level-up screens
Adding all the Text and HUD objects
We will be manipulating a few strings in this chapter. We are doing this so that we can format the ...
Get Beginning C++ Game Programming - Third Edition 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.