Pages

Using a CCLabelBMFont in a menu item

If you want to use a custom font (ie one created in something like Hiero) in Cocos2d, it's easy to do it in a label, but less obvious how to do it in a menu. Here's how

:


CCLabelBMFont *rFont = [CCLabelBMFont labelWithString:@"Return to Main Menu" fntFile:@"quark18.fnt"];

CCMenuItemLabel *Play = [CCMenuItemLabel itemWithLabel:rFont target:self selector:@selector(goToGameplay:)];

CCMenu *menu = [CCMenu menuWithItems: Play, nil];

No comments:

Post a comment