I am trying to catch all the menu events using a method that will identify which menu item was tapped based on its tag. However, in the callback method the tag is some random number, and not the number that I set.
- create a new cocos2d-x project
- in HelloWorld::init() add
- update the
(CCMenuItemImage* pSender)as parameter in the header and the implementation file
- set a breakpoint inside the
When the breakpoint is hit, run
p pSender->getTag() in the debugger. Instead of getting 23, I am getting some random number.
Am I doing something wrong?