The first step toward improving the look of our game is to say goodbye to the debug font and replace it with something a little more stylish. The Marmalade SDK comes complete with an API called IwGxFont dedicated to font rendering, so let's put it to good use.
By now I'm
sure you must be able to hazard a guess as to how this is done. That's right, just add iwgxfont
to the subprojects section in the MKB file, and then make a call to IwGxFontInit
to initialize the API, and IwGxFontTerminate
to free it at shutdown time.
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();