Question

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]; 
Was it helpful?

Solution

CCMenuItemFont is derived from CCMenuItemLabel which has a label property:

CCMenuItemLabel *play = [CCMenuItemFont itemFromString:@"Play" 
                         target:self selector:@selector(goToLevelSelect:)];
play.color = ccRED;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top