.h文件
void menuCallBack(CCObject* pSender);
.cpp
CCMenuItemSprite* item = CCMenuItemSprite::create( menuCB1, menuCB2, this, menu_selector(helloworld::menuCallBack)); item->setTag(m);
回调方法
void helloworld::menuCallBack(CCObject* pSender) { CCNode* node = dynamic_cast<CCNode*>(pSender); CCLog("【====PopupLayer::buttonCallBack====】touch tag: %d", node->getTag()); }
获取点击的菜单按钮tag
cocos2dx 菜单按钮回调方法传参 tag传参,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/ADaii/p/3806215.html