So I want my main menu to have a ccMenu. I tried exploring with align vertically and alignItemsInColumns but all these options center the items within the menu. If I wanted something that looked like this:
Title
Option 1 has a very long name
Option 2 is short
Shorter
instead of this:
Title
Option 1 has a very long name
Option 2 is short
Shorter
How could I achieve this in cocos2d? Thanks for the help.
EDIT:
I tried using this code but I got this result:
CCLabelTTF * sin = [CCLabelTTF labelWithString:@"Single Player" dimensions:CGSizeMake(120, 25) alignment:UITextAlignmentLeft fontName:font fontSize:20];
CCMenuItem * item1 = [CCMenuItemLabel itemWithLabel:sin target:self selector:@selector(goToSinglePlayer:)];
CCLabelTTF * spl = [CCLabelTTF labelWithString:@"Splitscreen" dimensions:CGSizeMake(100, 25) alignment:UITextAlignmentLeft fontName:font fontSize:20];
CCMenuItem * item2 = [CCMenuItemLabel itemWithLabel:spl target:self selector:@selector(goToSplitscreen:)];
CCLabelTTF * ach = [CCLabelTTF labelWithString:@"Achievements" dimensions:CGSizeMake(130, 25) alignment:UITextAlignmentLeft fontName:font fontSize:20];
CCMenuItem * item3 = [CCMenuItemLabel itemWithLabel:ach target:self selector:@selector(goToAchievements:)];
CCLabelTTF * str = [CCLabelTTF labelWithString:@"Store" dimensions:CGSizeMake(50, 25) alignment:UITextAlignmentLeft fontName:font fontSize:20];
CCMenuItem * item4 = [CCMenuItemLabel itemWithLabel:str target:self selector:@selector(goToStore:)];
CCLabelTTF * set = [CCLabelTTF labelWithString:@"Settings" dimensions:CGSizeMake(80, 25) alignment:UITextAlignmentLeft fontName:font fontSize:20];
CCMenuItem * item5 = [CCMenuItemLabel itemWithLabel:set target:self selector:@selector(goToSettings:)];
CCMenu * mainMenu = [CCMenu menuWithItems:item1, item2, item3, item4, item5, nil];
[mainMenu setColor:ccBLACK];
[mainMenu alignItemsVerticallyWithPadding:10];
mainMenu.position = ccp(size.width/6, size.height/2);
[self addChild:mainMenu];

Seems like it didn’t do anything. What’s wrong with the code?
Make a menu with CCMenuItemLabel items. Create each label with CCLabelTTF, giving it left alignment and known dimensions. When you add the menuItems to the menu, they will align if all have the same dimensions.
added :
you can set whatever properties you like to the labels (color, etc…) and the menuItem’s (callback target and selector).