-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Mastering Cocos2d Cross-Platform Game Development
By :
If you want to place a line of text on the screen, you need to create a label. There are two types of labels in Cocos2d: CCLabelBMFont and CCLabelTTF. Bitmap Font labels are the fancy labels created with Glyph Designer, mentioned earlier in this book. TrueType Font labels are regular, unformatted text labels that use either a font file that's already on the phone or a file you've added to your project.
Note that if you have a label that often needs updating, for example, a score counter or a health value, it's more efficient to use BMFonts in those cases, even if the font is a plain white font and looks exactly the same in TTF format.
As mentioned earlier, TTF labels are simple, unformatted labels. How are these useful? The answer is, you can quickly get the prototype of your game going, and so you can better understand the flow of the game. Then, once it's ready, you can switch...
Change the font size
Change margin width
Change background colour