Is there any utilities out there for generating an a file that I can use with an atlas label from a font file?
Creating an atlas sprite file for a font
(6 posts) (5 voices)-
Posted 2 years ago #
-
In v0.8 you have BitmapFontAtlas.
http://www.cocos2d-iphone.org/wiki/doku.php/release_8_0#bitmap_fontsPosted 2 years ago # -
You can use the charmap tool that's talked about in the following page :
http://silentmac.com/?p=411Posted 2 years ago # -
Posted 2 years ago #
-
You can generate a fontatlas using http://slick.cokeandcode.com/demos/hiero.jnlp
There is sample code in the cocos distribution, the following worked for me (after adding the generated files to the project);
BitmapFontAtlas *score_label = [BitmapFontAtlas bitmapFontAtlasWithString:@"" fntFile:@"stap_text.fnt"]; // left align the text score_label.anchorPoint = ccp(0.0f, 0.0f); score_label.position = ccp(127,268); [self addChild:score_label]; [score setString:string];To change the alignment try changing the anchorPoint, setting it to ccp(0.5f, 0.0f) should give you a center alignment. ccp(1.0f, 0.0f) a right alignment. Change the second value in each case to alter the vertical alignment.
You may also want to check the license on the font before you distribute it.
Posted 2 years ago # -
I think this is the link Riq meant;
http://www.cocos2d-iphone.org/wiki/doku.php/release_notes:0_8#bitmap_fonts
Posted 2 years ago #
Reply
You must log in to post.