I feel very strange about my CCMenuItemSprite, I add many CCMenuItemSprite to my game,
most of them work fine, but now when I added a CCMenuItemSprite to a layer, and I'm sure this layer has been removed and cleaned from parent, and my menu is invisible,but it's very strange! when I touch specific point on my screen, it triggers my menu event,
Does any body also has this problem?
My code is as the following:
menu added to background, and background added to a layer, on close button click,I remove and clean layer from parent.
CCSprite * fight = CCSprite::create(); and here is my code for firing onFightClick event.
CCSprite * fightClicked = CCSprite::create();
CCSprite * fightDisabled = CCSprite::create();
fightMenuItem = CCMenuItemSprite::create(fight,fightClicked,fightDisabled,this,menu_selector(WuXiaSpecialItem::onFightClick));
CCMenu* fightMenu = CCMenu::create(fightMenuItem,NULL);
CCSize visibleSize = CCDirector::sharedDirector()->getWinSize();
float scaleFactor = CCDirector::sharedDirector()->getContentScaleFactor();
CCSprite* msgText = CCSprite::create();
msg = WuXiaMsgBox::create();
CCLabelTTF* costTTF = CCLabelTTF::create(energy.c_str(),"Marker Felt",30.0/800*visibleSize.width);