I can’t understand why it works well most time, but it can’t be touched sometimes.
It may show the bug when loaded iad/admob sometimes I think.
just like this:
mnResume=[CCMenuItemImage itemFromNormalImage:@"bt_ps_continue.png" selectedImage:@"bt_ps_continue.png" target:self selector:@selector(menuResume)];
mnStore = [CCMenuItemImage itemFromNormalImage:@"bt_ps_havearest.png" selectedImage:@"bt_ps_havearest.png" target:self selector:@selector(menuStore)];
mnExit=[CCMenuItemImage itemFromNormalImage:@"bt_ps_endgame.png" selectedImage:@"bt_ps_endgame.png" target:self selector:@selector(menuExit)];
//mnResume.anchorPoint=ccp(1,0);
//mnExit.anchorPoint=ccp(0,0);
mnResume.position=ccp(size.width*.5,180);
mnStore.position=ccp(size.width*.5,120);
mnExit.position=ccp(size.width*.5,60);
menu = [CCMenu menuWithItems:mnResume,mnStore,mnExit, nil];
//menu = [CCMenu menuWithItems:nil];
menu.position=ccp(0,0);
[self addChild:menu];
From what I understand about CCMenu is that you should never change the CCMenuItem position yourself, otherwise the area that reacts to touches and the graphics of the menu item may not overlap, giving you the impression that it doesn’t work (correctly).
If you need to position each menu item independently, wrap each of them into a CCMenu node and change only the position of the CCMenu nodes.