iphone - CCLabelBMFont on CCMenuItemFont -
i'm trying change "classic" mark felt font whit personal fnt font on menu voices. code,for example want change font "resume" , "quit".
cclabelbmfont* label = [cclabelbmfont labelwithstring:@"paused" fntfile:@"score.fnt"]; label.position = ccp(240, 160); [self addchild: label]; [ccmenuitemfont setfontname:@"marker felt"]; [ccmenuitemfont setfontsize:35]; ccmenuitem *resume = [ccmenuitemfont itemfromstring:@"resume" target:self selector:@selector(resume:)]; ccmenuitem *quit = [ccmenuitemfont itemfromstring:@"quit" target:self selector:@selector(gotomainmenu:)];
ok, cclabelbmfont pause works, other doesn't.
cclabelbmfont
expects bitmap font, while ccmenuitem
takes normal font.
if want create menu item bitmap font, first have create cclabelbmfont
, wrap ccmenuitemlabel
cclabelbmfont* label = [cclabelbmfont labelwithstring:@"resume" fntfile:@"score.fnt"]; ccmenuitemlabel* item = [ccmenuitemlabel itemwithlabel:label target:self selector:@selector(resume:)];
you might try ccmenuitematlasfont
works atlas fonts
Comments
Post a Comment