cocos2d-x在菜单中如何点击一张图片进入另一个场景,求详解代码
CCMenuItemImage *pHelpItem = CCMenuItemImage::create("help.png","help2.png",this,NULL);如上,NULL处应改成响应的,其函数应该怎么写
void HelloWorld::menuHelpCallback(CCObject* pSender)
{
????????????
} null --------------------编程问答-------------------- CCMenuItemImage *pHelpItem = CCMenuItemImage::create("help.png","help2.png",this,menu_selector(HelloWorld::menuHelpCallback));
pHelpItem->setTags(1);
void HelloWorld::menuHelpCallback(CCObject* pSender)
{
int tag = pSender->getTags();
switch(tag)
{
case 1:
break;
}
}
补充:移动开发 , iPhone