[MenuItemFont setFontSize:20]; [MenuItemFont setFontName:@'Helvetica']; //I'm trying to change the color of start (below item) MenuItem *start = [MenuItemFont itemFromString:@'Start Game' target:self selector:@selector(startGame:)]; MenuItem *help = [MenuItemFont itemFromString:@'Help' target:self selector:@selector(help:)]; Menu *startMenu = [Menu menuWithItems:start, help, nil]; [startMenu alignItemsVertically]; [self add:startMenu];
[MenuItemFont setFontSize:20]; [MenuItemFont setFontName:@Helvetica]; //I’m trying to change the color of start (below item)
Share
Label is a property of MenuItemFont, a subclass of MenuItem, so you lose it during the implicit cast to MenuItem.
Alternatively, you could do:
(but that’s ugly, and startMenu will take a MenuItemFont with no complaints).
Keep in mind that the colors are for the most part hardcoded in MenuItemFont, so calling ‘setIsEnabled’ will set the colors back to grey or white. This happens around line 239 of MenuItem.m if you need to tweak it. If I get around to making a patch to expose this functionality on MenuItemFont (assuming it’s not already in the pre-.7.1 sources) I’ll update my post.