Pergunta

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]; 
Foi útil?

Solução

CCMenuItemFont is derived from CCMenuItemLabel which has a label property:

CCMenuItemLabel *play = [CCMenuItemFont itemFromString:@"Play" 
                         target:self selector:@selector(goToLevelSelect:)];
play.color = ccRED;
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top