当前位置: 首页>>代码示例>>C++>>正文


C++ CCScene::getChildren方法代码示例

本文整理汇总了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);
	}
}
开发者ID:flashsong,项目名称:firstTest,代码行数:50,代码来源:LoadManger.cpp

示例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
}
开发者ID:jiz869,项目名称:Game2,代码行数:18,代码来源:AppDelegate.cpp


注:本文中的CCScene::getChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。