Game Development Reference
In-Depth Information
It shows that the font family is oddly named “Fixed,” while the font name is identical to
the font's file name. In cases where you have a font file whose file name doesn't match
the font name, you should simply rename the font, re-import it in SpriteBuilder, and up-
date any labels in question to use the font with the new name.
Note Using a custom TrueType font with SpriteBuilder does not require editing
the Info.plist file. You would only have to if you wanted to add a custom
TrueType font but aren't using SpriteBuilder to do so.
Whether the importing of the TrueType font was successful can only be determined by
running the app. SpriteBuilder will use and display the font correctly. However, when you
run the game and there's a mismatch between the font name and the font's file name, the
font will be replaced with a font of a closely related (or wild guess) font family. More of-
ten than not, this means that Arial will be used in place of the custom font. It shouldn't be
too hard to notice, but a safe indicator is when the label's dimensions aren't the same as in
SpriteBuilder.
Editing Label Properties
The CCLabelTTF properties were partially covered in Figure 6-4 where the label is edited
as part of a Button node. Now let's look at the label properties as shown by an actual La-
bel TTF node. See Figure 11-5 for reference.
Search WWH ::




Custom Search