O'Reilly logo

Learning Cocos2d-x Game Development by Siddharth Shekar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required