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


C++ CCDirector::getRunningScene方法代码示例

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


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

示例1: handle_signal

void handle_signal(int signal) 
{
	static int internal_state = 0;
	ScriptingCore* sc = ScriptingCore::getInstance();
	// should start everything back
	CCDirector* director = CCDirector::sharedDirector();
	if (director->getRunningScene()) 
	{
		director->popToRootScene();
	} 
	else
	{
		CCPoolManager::sharedPoolManager()->finalize();
		if (internal_state == 0) 
		{
			//sc->dumpRoot(NULL, 0, NULL);
			sc->start();
			internal_state = 1;
		} 
		else
		{
			sc->runScript("hello.js");
			internal_state = 0;
		}
	}
}
开发者ID:wanghehacker,项目名称:jsb2cpp2java,代码行数:26,代码来源:AppDelegate.cpp

示例2: go

void TFBaseLayer::go(TFBaseLayer* pLayer)
{
    if (pLayer)
    {
        TRANSIT_LAYER->setFromLayer(this);
        TRANSIT_LAYER->setToLayer(pLayer);
    }
    else
    {
        TRANSIT_LAYER->setFromLayer(NULL);
        TRANSIT_LAYER->setToLayer(this);
    }

    CCDirector* pDirector = CCDirector::sharedDirector();
    CCScene* pScene = this->wrap(TRANSIT_LAYER);
    
    if (pDirector->getRunningScene())
    {
        pDirector->replaceScene(pScene);
    }
    else
    {
        pDirector->runWithScene(pScene);
    }
}
开发者ID:jobine,项目名称:TheForce,代码行数:25,代码来源:TFBaseLayer.cpp

示例3: pop

void SceneManager::pop()
{
	CCDirector* director = CCDirector::sharedDirector();  
	if (director->getRunningScene())
	{  
		director->popScene();
	}
}
开发者ID:wyklion,项目名称:Flyup,代码行数:8,代码来源:SceneManager.cpp

示例4: push

void SceneManager::push(CCLayer* layer)
{
	CCDirector* director = CCDirector::sharedDirector();
	CCScene* newScene = SceneManager::wrap(layer);
	if (director->getRunningScene()) //这句话 很有可能写的不对啊  有哪位大侠知道怎么写 告知下...   
	{  
		director->pushScene( newScene);
	}
}
开发者ID:wyklion,项目名称:Flyup,代码行数:9,代码来源:SceneManager.cpp

示例5: go

void SceneManager::go(CCLayer* layer, int transType)  
{
	CCDirector* director = CCDirector::sharedDirector();
	CCScene* newScene = SceneManager::wrap(layer);
	if (director->getRunningScene()) //这句话 很有可能写的不对啊  有哪位大侠知道怎么写 告知下...   
	{
		CCTransitionScene* transScene = SceneManager::createTransition(newScene, transType);
		director->replaceScene(transScene);
	}
	else
	{
		director->runWithScene(newScene);
	}
}
开发者ID:wyklion,项目名称:Flyup,代码行数:14,代码来源:SceneManager.cpp

示例6: 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

示例7:

	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


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