CCMenu responds to touches when touched elsewhere

257 Views Asked by At

This is the code I'm using to display the menu.

CCMenu *topMenu = [CCMenu menuWithItems:menuItem1, menuItem2, menuItem3, menuItem4, menuItem5, menuItem6, menuItem7, menuItem8, nil];
[topMenu alignItemsHorizontallyWithPadding:0.0f];
topMenu.position = ccp(winSize.width/2, 725);
[self addChild:topMenu];

I'm sure that this menu gets added only once. But for some strange reasons, touching on the area shown in the attached photo activates my menu. (You can see the "Home" menu item selected when my finger is totally somewhere else.

Touch issue with CCMenu showing Home button in depressed state when touched elsewhere

Touching on areas slightly to the right makes the "Level" menu activate and touching areas further right makes "Chapters" menu activate. It appears as if there is another "invisible" menu getting added.

The right pane is a UIViewController from a XIB adding onto the CCDirector's view. I'm currently eating touches in this view controller to avoid the said behaviour. Any ideas why this is happening?

0

There are 0 best solutions below