issue with setting anchors of menu items

issue with setting anchors of menu items
0.0 0


I have been trying to create a vertically aligned menu that is left-aligned and includes sub items that are themselves horizontally aligned menus.

You can see an example of this working perfectly for centre aligned menus at

However, I’ve tried setting the anchors of all of the menu items (and the sub-menu) and the result is this:
All the items are now correctly justified, except for the row that is made up of a set of horizontally aligned controls. No matter what I try, I can’t get it to align properly. Any ideas?

The code that’s used to set it up is:

`quickPlayButton=standardButtonWithTitle(“Quick Play”);
customGameButton=standardButtonWithTitle(“Custom Game”);

CCMenuPassive* tempMenu=CCMenuPassive::menuWithItems( standardButtonWithTitle(“1”), standardButtonWithTitle(“2”), standardButtonWithTitle(“3”), standardButtonWithTitle(“4”), NULL);


quickPlayButton->setAnchorPoint(ccp(0.0f, 0.5f));
customGameButton->setAnchorPoint(ccp(0.0f, 0.5f));
optionsButton->setAnchorPoint(ccp(0.0f, 0.5f));
tempMenu->setAnchorPoint(ccp(0.0f, 0.5f));

mainMenu = CCMenuPassive::menuWithItems(quickPlayButton, customGameButton, optionsButton, temp, NULL);


CCMenuPassive is almost identical to CCMenu, but it’s necessary to set the content size of the menu itself to the correct size (instead of defaulting to the screen size, as is done in CCMenu). I have checked the anchors and content sizes of the menus and they are all being set correctly, but for some reason, when it comes to the actual rendering, the anchor point doesn’t seem to make a difference. It’s almost as if the tempMenu object is being rendered as if it had zero content size.