create a CCMenuItemLabel with a custom font file
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 fn开发者_开发知识库tFile:@"good_dog_plain_32.fnt"];
thanks
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)];
精彩评论