Does someone could explain me the whole process to renderize a simple text using the FontManager.
What I have right know is the .fnt and the .fnt.json files. And the mapping table looks like this:
mapping {
"font/ka1.fnt": "font/ka1.fnt.json"
}
The font glyphs are stored in a file called ka1_0.png
And the code to create the font object is the following:
var requestHandler = RequestHandler.create({});
var fontManager = FontManager.create(graphicsDevice, requestHandler);
fontManager.setPathRemapping(config.mappingFont, '');
var gameFont;
fontManager.load('font/ka1.fnt', function (font) {
if (font) {
console.log('Font manager loaded');
gameFont = font;
}
});
The message 'Font manager loaded' is displayed on the browser console, but when I try to render my text using the
gameFont.drawTextRect method, nothing is displayed.
There is something I could be missing?
Thanks in advance for your answers.