开发者

how to set the back of page to white color when I use CCTransitionPageTurn to replace Scene?

开发者 https://www.devze.com 2023-03-13 10:48 出处:网络
I used the code as 开发者_开发知识库follow to implement the effect of replace scenes: [[CCDirector sharedDirector] replaceScene:[CCTransitionPageTurn transitionWithDuration:0.5f scene:alterScene back

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

0

精彩评论

暂无评论...
验证码 换一张
取 消