I used the code as 开发者_开发知识库follow to implement the effect of replace scenes:
[[CCDirector sharedDirector] replaceScene:[CCTransitionPageTurn transitionWithDuration:0.5f scene:alterScene backwards:NO]];
Now, the back of turned page is transparent. The effect I want to do is make it to white color .How can I get this?
If I want a white background on my CCTransitionPageTurn I would probably just create a CCLayerColor instance behind everything in my scene. This would ensure when the page is turned the color would be white.
////////////////////////////////////////////
/////create white layer background
fadeLayer = [CCLayerColor layerWithColor: ccc4(255, 255, 255, 255) width: 1024 height: 768];
fadeLayer.position = ccp(512, 384);
fadeLayer.isRelativeAnchorPoint = YES;
[self addChild: fadeLayer z:105];
Look here, message by MichaelB: http://www.cocos2d-iphone.org/forum/topic/15523/page/2
精彩评论