ReplaceScene itself not work on wp8

Assume in scene HelloWordScene i want to replace itseft, i call Director::getInstance()->replaceScene(HelloWorld::createScene(););
in an callback button of HelloWordScene . On win32 it works fine, but on wp8 it not work.

Here is code

    void HelloWorld::menuCloseCallback(Ref* pSender)
{
	auto scene = HelloWorld::createScene();
	// run
	auto tran  = TransitionFade::create(1, scene);
	Director::getInstance()->replaceScene(tran);
}

I’m using Cocos2d-x V3.2. Who can help me? Sory for my bad English :slight_smile:

What is happening when you try? I just tried replacing the current scene with the same scene using TranstionFade on a Nokia Lumia 1020 and it works just fine there… This is with a startup scene from one of our games displaying a logo, which replace itself over and over again, fading out, then fading in again without problem. Cocos2d-x v3.2

Cheers,

Eirik

1 Like

Hi!
I try it on a Nokia Lumia 925. When i click button, my game is freezes, no break, no exception. I call CCLog in init() and destroy method. When it replace current scene, init is called, but destroy is not called, and my game is freezes. May be i should try on a different device.
Thank you.

replaceScene works just fine for me. It might be your buggy code to cause the freezing.

1 Like

Hi kaseru, it is unlikely this is caused by the device so I doubt it will help trying on different device. This is most likely a bug in your code. It is difficult to answer unless you show the code in question.