The quick version of the question is: Is there a way to provide spacing or padding arguments to Menu - alignItemsInRows/Columns?
The long version follows:
When the user clicks on Start Game on my main menu I switch the scene to a new Menu Scene with a Menu that I want to have two MenuItemLabels (titles) each above their corresponding MenuItemToggles followed by a blank row, followed by a row with MenuItems that allow the user to Go Back or Start Game.
I have this set up using the following code:
[MenuItemFont setFontName:@"Courier-Bold"];
[MenuItemFont setFontSize:26];
MenuItemLabel *leftTitle = [MenuItemFont itemFromString:@"Left Player"];
leftTitle.disabledColor = [leftTitle color];
[leftTitle setIsEnabled:NO];
MenuItemLabel *rightTitle = [MenuItemFont itemFromString:@"Right Player"];
rightTitle.disabledColor = [rightTitle color];
[rightTitle setIsEnabled:NO];
MenuItem *back = [MenuItemFont itemFromString:@"Go Back"
target:self
selector:@selector(goBack:)];
MenuItem *play = [MenuItemFont itemFromString:@"Play"
target:self
selector:@selector(play:)];
[MenuItemFont setFontName:@"Courier"];
[MenuItemFont setFontSize:24];
MenuItemToggle *leftType = [MenuItemToggle itemWithTarget:self selector:@selector(typeChanged:) items:
[MenuItemFont itemFromString:@"Local"],
[MenuItemFont itemFromString:@"Computer"],
[MenuItemFont itemFromString:@"Network"],
nil];
MenuItemToggle *rightType = [MenuItemToggle itemWithTarget:self selector:@selector(typeChanged:) items:
[MenuItemFont itemFromString:@"Local"],
[MenuItemFont itemFromString:@"Computer"],
[MenuItemFont itemFromString:@"Network"],
nil];
MenuItemLabel *spacer = [MenuItemFont itemFromString:@" "];
MenuItemLabel *spacer2 = [MenuItemFont itemFromString:@" "];
MenuItemLabel *spacer3 = [MenuItemFont itemFromString:@" "];
MenuItemLabel *spacer4 = [MenuItemFont itemFromString:@" "];
Menu *menu = [Menu menuWithItems:
leftTitle, leftType, spacer, back,
rightTitle, rightType, spacer2, play,
nil];
[menu alignItemsInRows:
[NSNumber numberWithInt:4],
[NSNumber numberWithInt:4],
nil];
It works and is laid out pretty much how I'd like, the only problem is the two title labels butt right up against each other so I was hoping to find some way of feeding alignItemsInRows (or Columns) a padding or spacing argument, but so far have been unsuccessful in that search.
Any tips on how to get this done correctly will be greatly appreciated!
