Chapter 5. HUD, Parallax Background, and the Pause Button

In this chapter, we will see how to create a custom font for the game, like the font we added in the last chapter. We will create a new layer for HUD and the pause button. We will also create a scrolling background layer and remove the current static image we have been using so far.

We will cover the following topics in this chapter:

  • Text and fonts
  • Creating HUD layer and displaying as well as updating scores
  • Adding the pause and resume buttons
  • Implementing pause and resume in the game
  • Adding the scrolling layer class
  • Creating the parallax scrolling layer

Texts and fonts

So, you might be wondering why initially in Chapter 1, Getting Started, Cocos2d-x we used CCLabelTTF, but in the previous chapter, ...

Get Learning Cocos2d-x Game Development 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.