I have a CCGLView in my viewController, after completing the animations I'm trying to replace scene in the CCGLView with an empty scene. The issue is that while replacing the scene there is a flicker which I can observe. I want to avoid it, I'm providing the code below. What I have to change to avoid that flicker?
CC3Layer* layer=[[CC3Layer alloc]init];
CC3Scene* scene= (CC3Scene*)layer.scene;
scene.backdrop= [CC3Backdrop nodeWithColor:ccc4f(0.0/255.0, 0.0/255.0, 0.0/255.0, 0.0)];
[scene updateScene];
[self.director replaceScene:[layer asCCScene] withTransition:[CCTransition transitionCrossFadeWithDuration:1.0]];
[self.director stopAnimation];
One issue is that the
sceneproperty ofCC3Layerreturns theCCSceneinstance, and not theCC3Sceneinstance you are expecting. In any case, in your code, thesceneproperty will returnnil, because it has not yet been set. Try using thecc3Sceneproperty, instead.You haven't indicated where you are trying to run this code, but if I add the following code to the
nodeSelected:byTouchEvent:at:method of theCC3HelloWorldtemplate app, the transition runs smoothly, without any kind of flicker:...Bill