开发者

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)];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜