I was just wondering what tool was used to create the bitmap font atlas files that are used in the cocos2d demos, such as:
bitmapFontTest
bitmapFontTest2
bitmapFontTest3
A fast, easy to use, free, and community supported 2D game engine
I was just wondering what tool was used to create the bitmap font atlas files that are used in the cocos2d demos, such as:
bitmapFontTest
bitmapFontTest2
bitmapFontTest3
I'm glad you asked. The Hiero tool linked above is alright, but it has some shortcomings. For instance, you can't turn off anti-aliasing with it, which is a real problem for small/pixel fonts. When I need more control I use http://www.angelcode.com/products/bmfont/ - unfortunately it's Windows only, but for the extra options it gives you, it's worth the trouble of copying the files over from my Windows machine to my Mac. The files it generates are 100% compatible with Cocos2D.
I used Bitmap Font Maker and it creates beautiful .png files. Oddly BitmapFontAtlas is doing something odd to in translating those fonts to screen though.
I wrote more about the issue in this posting: http://www.cocos2d-iphone.org/forum/topic/3560#post-21641.
I am puzzled:
If I have a PNG-Spritesheet with letters from A-Z how do I generate a fnt file with hiero? Or do I need some other program?
I've the same question. There doesn't seem to be a whole lot of tools knowing about FNT :/
Ha! At least I am not the only one. I ended up in creating the "fnt" file manually. The format seems easy enough, just open it with a text editor:
http://www.gamedev.net/community/forums/topic.asp?topic_id=284560
'x, y, width, and height: give the position and size of the character image in the texture.
xoffset and yoffset: hold the offset with which to offset the cursor position when drawing the character image. Note, these shouldn't actually change the cursor position.
xadvance: is how much the cursor position should be moved after each character.
page: gives the texture where the character image is found.'
Hope this helps you. Also take a look at the example *.fnt files in the cocos2D/Resources/Fonts folder.
Sorry to bump this thread, but I'm struggling with hiero right now. The generated fonts look really superb, but the export doesn't work in cocos2D so far. There are about 15 .png files and one .fnt and it seems cocos2D can't manage with thos files...
Anybdy managed to generate a working bitmap font with hiero ?
I used Heiro, however....
It did NOT work correctly on my Mac, which runs Snow Leopard. I tried with many different fonts. It looked ok on the screen, but the image files it produced were clearly messed up, and nothing would show up in my game.
I tried Heiro on my Win 7 (64-bit, virtualized in Parallels), and the app constantly froze, so that was no good. However, the AngelCode thing DID work on my Win 7 virtualized machine...
Eventually, I tried Heiro on a macbook that was running Leopard (10.5) and it was able to export the image files correctly, and everything runs perfectly in cocos2d.
When executing my code it was causing an exception. I guess the problem was that hiero was generating 15 .png files. Now I've understand that you have to select teh "glyph cache" option and select the width and height of your bitmap in order it fits in one file. And it works now.
You must log in to post.