本文整理汇总了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;
}
}
}
示例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);
}
}
示例3: pop
void SceneManager::pop()
{
CCDirector* director = CCDirector::sharedDirector();
if (director->getRunningScene())
{
director->popScene();
}
}
示例4: push
void SceneManager::push(CCLayer* layer)
{
CCDirector* director = CCDirector::sharedDirector();
CCScene* newScene = SceneManager::wrap(layer);
if (director->getRunningScene()) //这句话 很有可能写的不对啊 有哪位大侠知道怎么写 告知下...
{
director->pushScene( newScene);
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
}
}
}