Hello
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.
For example:
- create a new cocos2d-x project
- in HelloWorld::init() add
pCloseItem->setTag(23);
- update the
menuCloseCallback
to receive(CCMenuItemImage* pSender)
as parameter in the header and the implementation file - set a breakpoint inside the
menuCloseCallback
method
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?
Thanks!