本文整理汇总了C++中MenuItemFont::getTag方法的典型用法代码示例。如果您正苦于以下问题:C++ MenuItemFont::getTag方法的具体用法?C++ MenuItemFont::getTag怎么用?C++ MenuItemFont::getTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuItemFont
的用法示例。
在下文中一共展示了MenuItemFont::getTag方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: menuCallback
void CocosGUITestScene::menuCallback(Object *pSender)
{
MenuItemFont* pItem = dynamic_cast<MenuItemFont*>(pSender);
switch (pItem->getTag())
{
case 0:
{
UISceneManager* pManager = UISceneManager::sharedUISceneManager();
Scene* pScene = pManager->currentUIScene();
CCDirector::getInstance()->replaceScene(pScene);
}
break;
/*
case 1:
{
CocosGUIExamplesRegisterScene* pScene = new CocosGUIExamplesRegisterScene();
pScene->runThisTest();
pScene->release();
}
*/
break;
default:
break;
}
}
示例2: onClick
void MenuScene::onClick(Ref* sender)
{
MenuItemFont* pFont = (MenuItemFont*) sender;
switch( pFont->getTag() )
{
case 1:
{
CSceneManager::getInstance()->pushScene(
CCSceneExTransitionFade::create(1.0f, LoadScene("BasicSceneTest"))
);
}
break;
}
}
示例3: menuCallback
void HelloWorld::menuCallback(Ref* pSender)
{
MenuItemFont *pItem = (MenuItemFont*) pSender;
Scene* newScene = NULL;
switch (pItem->getTag()) {
case 0:
// newScene = TestAds::scene();
break;
case 1:
// newScene = TestAnalytics::scene();
break;
case 2:
// newScene = TestShare::scene();
break;
case 3:
newScene = TestFacebookUser::scene();
break;
case 4:
newScene = TestFacebookShare::scene();
break;
case 5:
// newScene = TestIAP::scene();
break;
case 6:
// newScene = TestIAPOnline::scene();
break;
case 7:
// newScene = TestUser::scene();
break;
case 8:
// newScene = TestSocial::scene();
break;
case 9:
break;
default:
break;
}
if (newScene) {
Director::getInstance()->replaceScene(newScene);
}
}
示例4: menuCloseCallback
void HelloWorld::menuCloseCallback(Ref* pSender)
{
MenuItemFont * aItem = (MenuItemFont *)pSender;
switch (aItem->getTag())
{
case 0:
//Director::getInstance()->replaceScene( GameOverScene::scene() );
break;
case 1:
//Director::getInstance()->replaceScene( GameOverScene::scene() );
break;
case 2:
//Director::getInstance()->replaceScene( GameOverScene::scene() );
break;
case 3:
//Director::getInstance()->replaceScene( GameOverScene::scene() );
break;
default:
break;
}
}