Reputation: 689
I have a CCMenuitemLabel
CCMenuItemLabel *startGame = [CCMenuItemLabel itemWithLabel:str target:self selector:@selector(startGamefn)];
and I was wondering how I would load a font file as you would do in CCLabelBMFont (example :
CCLabelBMFont *label = [CCLabelBMFont labelWithString:str fntFile:@"good_dog_plain_32.fnt"];
thanks
Upvotes: 2
Views: 3053
Reputation: 19164
CCMenuItemLabel can accept CCLabelBMFont so you can just past the label
object in the function call to CCMenuItemLabel
:
CCLabelBMFont *label = [CCLabelBMFont labelWithString:str fntFile:@"good_dog_plain_32.fnt"];
CCMenuItemLabel *startGame = [CCMenuItemLabel itemWithLabel:label target:self selector:@selector(startGamefn)];
Upvotes: 5