本文整理汇总了C++中CCScene::getChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ CCScene::getChildren方法的具体用法?C++ CCScene::getChildren怎么用?C++ CCScene::getChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCScene
的用法示例。
在下文中一共展示了CCScene::getChildren方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void LoadManager::load(SCENE target)
{
clearCache();
mNextScene = target;
if (mAllNum + mArmatureNum <= 0)
{
changeScene();
return;
}
CCScene* tempSc = LoadScene::scene();
mLoadScene = (LoadScene*)(tempSc->getChildren()->objectAtIndex(0));
CCDirector::sharedDirector()->replaceScene(tempSc);
if (mLoadArray->count() == 0)
{
loadArmature();
return;
}
for (int i = mLoadArray->count() - 1; i >= 0; i--)
{
LoadInfoVo* pObj = (LoadInfoVo*)mLoadArray->objectAtIndex(i);
switch (pObj->mType)
{
//case LArmature:
// CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfoAsync(pObj->mImagePath.c_str(),
// pObj->mPlistPath.c_str(),
// pObj->mJsonPath.c_str(),
// this,
// schedule_selector(LoadManager::loadedArmatureCall));
// break;
case LSprite:
mSpriteLoadArray->addObject(pObj);
CCTextureCache::sharedTextureCache()->addImageAsync(pObj->mImagePath.c_str(),
this,
callfuncO_selector(LoadManager::loadedImageCall));
break;
case LImage:
CCTextureCache::sharedTextureCache()->addImageAsync(pObj->mImagePath.c_str(),
this,
callfuncO_selector(LoadManager::loadedImageCall));
break;
}
mLoadArray->removeObject(pObj);
}
}
示例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(SimpleAudioEngine::sharedEngine()->isBackgroundMusicPlaying()) {
SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
}
// if you use SimpleAudioEngine, it must be pause
// CocosDenshion::SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
#ifdef MULTIPLAY
UserData * userData = GameController::getGameController()->getUserData();
if(userData->pvpMode != NONE) {
CCScene * currentScene = CCDirector::sharedDirector()->getRunningScene();
MultiPlayScene * multiPlayScene = (MultiPlayScene *)currentScene->getChildren()->objectAtIndex(0);
multiPlayScene->gameOver();
CCDirector::sharedDirector()->replaceScene(StartMenuScene::scene());
}
#endif
}