示例#1
0
void SceneManager::fillStack()
{
	// Get instance of director
	Director* director = Director::getInstance();

	// Empty the stack
	director->popToRootScene();

	// Add scenes to stack
	director->replaceScene(TransitionFade::create(4, generateLevel(1, 0), Color3B::BLACK));
	level = 1;
}
示例#2
0
void handle_signal(int signal) {
    static int internal_state = 0;
    ScriptingCore* sc = ScriptingCore::getInstance();
    // should start everything back
    Director* director = Director::getInstance();
    if (director->getRunningScene()) {
        director->popToRootScene();
    } else {
        PoolManager::sharedPoolManager()->finalize();
        if (internal_state == 0) {
            //sc->dumpRoot(NULL, 0, NULL);
            sc->start();
            internal_state = 1;
        } else {
            sc->runScript("hello.js");
            internal_state = 0;
        }
    }
}