I’ve updated my AS3 Starling TD Demo today. Thankfully, a very courteous person emailed me today letting me know that my Bitmap Fonts were not showing up if you didn’t actually have the fonts installed on your machine. Whoops!

Now that the BitmapFonts are actually working using the proper output from Glyph Designer, I think I need a few more tutorials on how to use that program. Let’s just chalk it up to my complete inexperience with Glyph Designer, but, I wanted to use the same font and have it be different colors in different TextFields. And the problem with this is that it seems if your font png that you export from Glyph Designer has a color (solid/gradient) that if you try to tell the TextField.color that you want this TextField to be white (0xFFFFFF) it tried to blend the color of the BitmapFont with white… never really giving me an actual crisp white that I wanted. Also, in some other case when I tried to assign a color to the TextField it seemed to think I was saying “I want no fill color at all” and you could see through the letters. I’m almost positive this is all my own fault.

I updated some of my posts to include the minor code changes I made to a few files. They’re mostly very small x/y/fontSize kinds of changes.

So what was the culprit? When I exported my fonts from Glyph Designer, I chose “.fnt (Plain Text)”. Well, I didn’t “choose” it, it’s the default setting. My eyes read “FNT” and my brain said “Yup! That’s the file type we want! Export it!” and really if I would’ve clicked the dropdown, there’s a “.fnt (XML)” that I should’ve changed it to. So now the *.fnt files are all actually XML. I’m really curious why Flash was totally fine with me taking straight plain text and typecasting it to XML without complaining. There was not even any semblance of or any structure whatsoever. I guess maybe in typecasting it to XML, it just returned null or an empty XML Object or something. Ooooh well… it’s all fixed now.

Remember, if you’re exporting from Glyph Designer for use in Starling’s BitmapFont, export from Glyph Designer using the “.fnt (XML)” Export Type option!

Thanks again Christophe for letting me know!
-Travis

Categories:

0 Comments

Leave a Reply

Avatar placeholder