Game Development Reference
In-Depth Information
the bitmap font to be supplied in four resolutions, which typically implies different scaling
for each font.
Assuming you created a single font named gd.fnt with an accompanying gd.png , you can
make this font compatible with SpriteBuilder by creating a folder named gd.bmfont . In-
side that folder, create four additional subfolders named resources-phone , resources-
phonehd , resources-tablet , and resources-tablethd . Then add a copy of the gd.fnt and
gd.png files to each resources subfolder. The resulting structure should be like the one in
Figure 11-14 .
Figure 11-14 . SpriteBuilder requires bitmap fonts to be in a .bmfont folder with additional subfolders
Caution Be sure to use the same name (excluding the extension) for the .bm-
font folder and the actual font files. If you were to rename gd.bmfont to my-
font.bmfont , the font would no longer work because SpriteBuilder would be
looking for myfont.fnt and myfont.png files.
However, you'll probably want the bitmap font to have a different scaling for each resolu-
tion. There are two variants that will work well for SpriteBuilder that resemble the two
scaling options available in SpriteBuilder: absolute scaling (iPad screen is assumed to be
512x384 points) and UI scaling (iPad screen is assumed to be the original size of
1024x768 points). The default option should be absolute scaling unless you designed your
game to use UI scaling throughout. Table 11-2 shows the bitmap font scaling factors for
each folder and an example of what this means specifically for a given font size of 48 at
100% scaling.
Search WWH ::




Custom Search