如何设置 CCMenuItemFont 的颜色.我一直在搜索几个小时,返回 0 个有效结果.它们都已经过时了.
How can I set the color of a CCMenuItemFont. I've been searching for hours, returning 0 valid results. They're all outdated.
[CCMenuItemFont setFontName:@"Futura"];
[CCMenuItemFont setFontSize:40];
CCMenuItem *Play = [CCMenuItemFont itemFromString:@"Play" target:self selector:@selector(goToLevelSelect:)];
CCMenu *menuPlay = [CCMenu menuWithItems: Play, nil];
menuPlay.position = ccp(50,100);
[menuPlay alignItemsVerticallyWithPadding:10];
[self addChild:menuPlay];
CCMenuItemFont 源自 CCMenuItemLabel 具有标签属性:
CCMenuItemFont is derived from CCMenuItemLabel which has a label property:
CCMenuItemLabel *play = [CCMenuItemFont itemFromString:@"Play"
target:self selector:@selector(goToLevelSelect:)];
play.color = ccRED;
这篇关于CCMenuItem字体颜色变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!