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


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

本文整理汇总了C++中CCScene::getChildByTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CCScene::getChildByTag方法的具体用法?C++ CCScene::getChildByTag怎么用?C++ CCScene::getChildByTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCScene的用法示例。


在下文中一共展示了CCScene::getChildByTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setVisible

void HSGameShopLayer::setVisible(bool visible)
{
	#define HS_Shop_Tag 0x75699

	CCLayer::setVisible(visible);
	if(visible)
	{

		Shop_FlyIn(*m_p_shop_frame,m_shop_frame_Position);

		CCScene* pScene = CCDirector::sharedDirector()->getRunningScene();

		if (!pScene->getChildByTag(HS_Shop_Tag))
		{
			pScene->addChild(this,HS_Shop_Tag,HS_Shop_Tag);
		}
	}
	else
	{
		CCScene* pScene = CCDirector::sharedDirector()->getRunningScene();
		if (pScene->getChildByTag(HS_Shop_Tag))
		{
			pScene->removeChildByTag(HS_Shop_Tag);
		}
	}
}
开发者ID:wanggan768q,项目名称:GameWork,代码行数:26,代码来源:HSGameShopLayer.cpp

示例2: setVisible

void HSLoadingLayer::setVisible(bool visible)
{
#define HS_Loadong_Tag 0x75698
    
	if (visible)
    {
        if(!this->isVisible())
        {
            CCScene* pScene = CCDirector::sharedDirector()->getRunningScene();
            if (pScene && !pScene->getChildByTag(HS_Loadong_Tag))
            {
                this->schedule(schedule_selector(HSLoadingLayer::Updata), 1.f);
                m_time = 15;
                pScene->addChild(this, HS_Loadong_Tag, HS_Loadong_Tag);
            }
        }
	}
	else
	{
		this->SetTipsUp("");
		this->m_pTipsTTFUp->setString("");
        this->removeFromParent();
        
	}
	CCLayer::setVisible(visible);
}
开发者ID:wanggan768q,项目名称:GameWork,代码行数:26,代码来源:HSLoadingLayer.cpp

示例3: singlePlayerScene

cocos2d::CCScene* BYGameScene::singlePlayerScene() {
    CCScene* scene = BYGameScene::scene();
    
    BYGameScene*    layer = (BYGameScene*) scene->getChildByTag(GUI_MainLayer);
    layer->initWithSinglePlayer();
    
    return scene;
}
开发者ID:myeyesareblind,项目名称:touchHockey,代码行数:8,代码来源:BYGameScene.cpp

示例4: 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;
}
开发者ID:jackmichel,项目名称:Elis-Escape,代码行数:8,代码来源:Utils.cpp

示例5: GameInToSectionLayer

void LevelManager::GameInToSectionLayer()
{
	setNext(false);
	ResManager::getManager()->removeAllArmatureInfo();
	CCScene* pScene = Starseneui::scene();
	Starseneui* pLayer = (Starseneui*)pScene->getChildByTag(Starseneui_tag);
	pLayer->Goxiaogk(Smalllayer_tag);

	CCTransitionFade* pTran = CCTransitionFade::create(0.5f, pScene, ccWHITE);
	CCDirector::sharedDirector()->replaceScene(pTran);
}
开发者ID:SongCF,项目名称:game-LostStar,代码行数:11,代码来源:LevelManager.cpp

示例6: setVisible

void HSDailyRewardSystemLayer::setVisible( bool visible )
{
#define HS_DailyRewardSystemLayer_Tag 0x75699
	if (visible)
	{
		CCScene* pScene = CCDirector::sharedDirector()->getRunningScene();
		if (!pScene->getChildByTag(HS_DailyRewardSystemLayer_Tag))
		{
			pScene->addChild(this,HS_DailyRewardSystemLayer_Tag);
		}

	}else{
		CCScene* pScene = CCDirector::sharedDirector()->getRunningScene();
		if (pScene->getChildByTag(HS_DailyRewardSystemLayer_Tag))
		{
			pScene->removeChildByTag(HS_DailyRewardSystemLayer_Tag);
		}
	}
	CCLayer::setVisible(visible);
}
开发者ID:wanggan768q,项目名称:GameWork,代码行数:20,代码来源:HSDailyRewardSystemLayer.cpp

示例7: 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();

    //Retrieve HelloWorld scene by using the tag and call the pauseGame method
    CCScene* scene = (CCDirector::sharedDirector()->getRunningScene());
    if (scene !=NULL) {
    	HelloWorld* helloWorldScene = dynamic_cast <HelloWorld*>(scene->getChildByTag(100));
    	if (helloWorldScene != NULL) {
    		helloWorldScene->pauseGame();
    	}
    }


}
开发者ID:DevJay22,项目名称:Core-Native-Community-Samples,代码行数:15,代码来源:AppDelegate.cpp

示例8: 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;
    }
}
开发者ID:JungHanter,项目名称:SWMTAMA,代码行数:15,代码来源:InGameScene.cpp

示例9: GetBattleLayer

BattleLayer* CommonLookUpUtils::GetBattleLayer()
{
	CCScene* pRunningScene = CCDirector::sharedDirector()->getRunningScene();
	if (pRunningScene)
	{
		CCNode* pNode = pRunningScene->getChildByTag(TAG_LAYER_BATTLE);
		if (pNode)
		{
			BattleLayer* pBattleLayer = dynamic_cast<BattleLayer*>(pNode);
			return pBattleLayer;			
		}				
	}

	return NULL;
}
开发者ID:niuzb,项目名称:hellopet,代码行数:15,代码来源:CommonLookUpUtils.cpp

示例10: happen

void DuelEvent::happen()
{
	CCScene* pScene = Combat::scene();
	Combat* pLayer = (Combat*)pScene->getChildByTag(COMBATLAYER);
	//pass args(defined in CSV) here 
	CCInteger* intg = (CCInteger*) this->args->lastObject();
	if(intg!=NULL && pLayer!=NULL) 
		pLayer->setMonsterType( intg->getValue() );
	else if(intg==NULL && pLayer!=NULL)
		pLayer->setMonsterType( 1 );
	else
		CCLog("Combat Layer get fail. ");

	CCTransitionFade *scenetrans = CCTransitionFade::create(0.7, pScene);
	CCDirector::sharedDirector()->pushScene(scenetrans);
}
开发者ID:ranf999,项目名称:Blue-MY-Lake,代码行数:16,代码来源:DuelEvent.cpp

示例11:

	void Java_org_cocos2dx_hellocpp_HelloCpp_controllerMotion(JNIEnv*  env, jobject thiz, jint player, jfloat LS_X, jfloat LS_Y, jfloat RS_X, jfloat RS_Y)
	{
		CCDirector *pDirector = CCDirector::sharedDirector();
		if(pDirector != NULL)
		{
			CCScene *scene = pDirector->getRunningScene();
			if(scene != NULL)
			{
				Game* layer = (Game*)scene->getChildByTag(1001);
				if(layer != NULL)
				{
					layer->controllerMotion(player, LS_X, LS_Y, RS_X, RS_Y);
				}
			}
		}
	}
开发者ID:OneGameAMonth,项目名称:Cocos2d-x,代码行数:16,代码来源:main.cpp

示例12: screenshot

void ConfigMenu::screenshot()
{
	std::string sdcard = getSDCard();
	CCSize size = CCDirector::sharedDirector()->getWinSize();

	const char* imgName = "/bug_screenshot.jpg";
	sdcard = sdcard.append(imgName);
	CCRenderTexture* pScreen = CCRenderTexture::create(size.width, size.height);
	CCScene* pTempScene = CCDirector::sharedDirector()->getRunningScene();
	pScreen->begin();
	//pTempScene->visit();
	pTempScene->getChildByTag(TAG_RUNNING_LAYER)->visit();
	pScreen->end();
	pScreen->saveToFile(sdcard.c_str());
	CC_SAFE_DELETE(pScreen);
	share();
	CCLOG("sdcard %s", sdcard.c_str());
}
开发者ID:laogong5i0,项目名称:MiniGame,代码行数:18,代码来源:ConfigMenu.cpp

示例13: loadResource

void LoadingScene::loadResource()
{
    unloadResource();
    
    
    AnimationLoader::loadData();
  
    CCScene* scene = TestScene::scene();
    CCDirector::sharedDirector()->popToRootScene();
    CCDirector::sharedDirector()->pushScene(scene);
       for(int i=0; i<DataCollector::getInstance()->getMatchData()->resourcePackList.size(); i++)
    {
        ResourceLoader::loadResourcePack(DataCollector::getInstance()->getMatchData()->resourcePackList[i]);
    }
    ((TestScene*)scene->getChildByTag(1))->loadResource();
    ((TestScene*)scene->getChildByTag(1))->initScene();

}
开发者ID:quinsmpang,项目名称:TinyZodiacs,代码行数:18,代码来源:LoadingScene.cpp

示例14: onMessageCallBack

/**
@brief 消息回调
@param uMsgId 消息ID
@param wParam
@param lParam
@param nTouchID
@return true 表示可以忽略后面调用 false 则表示还要继续执行
*/
bool WareAppDelegate::onMessageCallBack( unsigned long uMsgId, unsigned long wParam, unsigned long lParam, int nTouchID )
{
	IRenderSystem* pRenderSystem = getRenderSystem();
	if( pRenderSystem == NULL )
	{
		return false;
	}

	CCScene* pRootScene = pRenderSystem->getRootScene();

	/// 10000 系统定义的UILayerID
	ui::TouchGroup* pUILayer = (ui::TouchGroup*)pRootScene->getChildByTag( EGameLayerDepth_GUI );
	if( pUILayer == NULL )
	{
		return false;
	}

	return pUILayer->onMessageProc(uMsgId,wParam,lParam,nTouchID);
}
开发者ID:gameview,项目名称:WareCocos2dx,代码行数:27,代码来源:WareAppDelegate.cpp

示例15: starNewGame

void Game::starNewGame(Player* player1, Player* player2, bool restart)
{
    CCScene *pScene = GameLayer::scene();
    GameLayer* gameLayer = (GameLayer*)pScene->getChildByTag(1337);
    
    if(!restart) {
        addPlayer(player1);
        addPlayer(player2);
    }
    gameLayer->startGame(player1, player2);
    
    if(CCDirector::sharedDirector()->getRunningScene()){
        CCDirector::sharedDirector()->replaceScene(pScene);
    }else{
        CCDirector::sharedDirector()->runWithScene(pScene);
    }
    
    setCurrentScreen(GAME_SCREEN);
    currentGameType = player2->isAI() ? VS_AI : VS_HUMAN;
}
开发者ID:Stals,项目名称:TilesFight,代码行数:20,代码来源:Game.cpp


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