本文整理汇总了C++中CCScene::getTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CCScene::getTag方法的具体用法?C++ CCScene::getTag怎么用?C++ CCScene::getTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCScene
的用法示例。
在下文中一共展示了CCScene::getTag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: layerWithTag
CCLayer* Utils::layerWithTag(int tag) {
CCScene *sc = CCDirector::sharedDirector()->getRunningScene();
if (sc->getTag() == TAG_GAME_SCENE) {
CCLayer *layer = (CCLayer *)sc->getChildByTag(tag);
return layer;
}
return NULL;
}
示例2: applicationDidEnterBackground
// This function will be called when the app is inactive. When comes a phone call,it's be invoked too
void AppDelegate::applicationDidEnterBackground() {
CCDirector::sharedDirector()->stopAnimation();
// if you use SimpleAudioEngine, it must be pause
// SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
// Alert::create(ALERTTEXT_UNCONNECT,"",this,touchesureventselector(AppDelegate::clickedSureCallback))->show();
CCScene* scene = CCDirector::sharedDirector()->getRunningScene();
if (SceneTypeStart != scene->getTag())
{
SceneManager::getInstance()->replaceScene(SceneTypeStart);
}
}
示例3: getGameLayer
InGameScene* InGameScene::getGameLayer() {
CCDirector* pDirector = CCDirector::sharedDirector();
CCScene* pScene = pDirector->getRunningScene();
int tag = pScene->getTag();
if(tag == TAG_INGAMESCENE) {
CCNode* pNode = pScene->getChildByTag(TAG_INGAMELAYER);
if(pNode != NULL) {
return (InGameScene*)pNode;
} else {
return NULL;
}
} else {
return NULL;
}
}