Game Development Reference
In-Depth Information
As the name of this API suggests, it requires IwGx in order to work. We also need
IwResManager so we can load the font data into memory, so the initialization call for
IwGxFont must occur after these two modules have been initialized, as shown in the
following code snippet:
IwGxInit();
IwResManagerInit();
IwGxFontInit();
Creating a font resource
The first thing we need to do is create a CIwGxFont resource describing the font that
we want to use. This is easily done thanks to the Marmalade Studio - Font Builder
utility that is installed as part of the Marmalade SDK. The following image shows a
screenshot of this program in action:
The IwGxFont API renders text by drawing each character individually by using
sections of a large bitmap that contains an image of all the characters we need to
render. Generating the bitmap itself is fairly trivial and could be done with any
art package, but we need to somehow be able to specify which part of the bitmap
represents which character. This is where IwGxFont and the font builder utility come
to our aid.
 
Search WWH ::




Custom Search