如何设置CCMenuItemFont的颜色。我一直在搜索几个小时,返回0个有效结果。他们都过时了。
[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];
答案 0 :(得分:6)
CCMenuItemFont派生自CCMenuItemLabel,其标签属性为:
CCMenuItemLabel *play = [CCMenuItemFont itemFromString:@"Play"
target:self selector:@selector(goToLevelSelect:)];
play.color = ccRED;