In this section, we will take a look at how to add text to a scene. In Cocos2d, there are two ways in which we can add text: the
CCLabelTTF way and the
CCLabelBMFont way. We will look at
CCLabelBMFont later in the book when we cover Glyph Designer in Chapter 9, Game Tools. For now, we will consider what CCLabels are and how they work.
CCLabelsTTF uses system fonts that are already present on our Mac system. So, additional work is required here. We will just call the name of the font, the text we want to display, and the size of the font, and we are good to go!
Note that there may be cases where the font is installed on your system and it still isn't displayed in the game. This is because Cocos2d includes ...