Scene transition from CATransition to Cocos2D

I'm currently trying to migrate my project from SpriteKitto Cocos2D. And I'm stuck with the transition. In SpriteKitI could use CATransitionto go to another scene.

But I can’t figure out how to do this Cocos2D. Or perhaps there is another way to achieve a similar effect in Cocos2D. The effect I'm going to do is the pixelate " effect , which is created using CATransition . If I could use it, it would be awesome. If there is another way to achieve the same effect, which is also good.

It may be worth noting that I'm using Cocos2D3.

+4
source share
2 answers

According to your video, you can click one scene to another scene using CCTransition in cocos2d with the same effect. code below

-(void)YourButtonToPush
{
   [[CCDirector sharedDirector] replaceScene:[CCTransitionTurnOffTiles transitionWithDuration:1.0 scene:[HelloWorldLayer scene]]];  
}

enter image description here

if you want to quickly replace method decrees with the transition time.

+1
source

You can try looking at the source code for CCTransitionTurnOffTiles. You can then copy it and create your own transition with several settings so that it is closer to the pixilate transition from SpriteKit.

I did not look at the source for this, but I suspect that setting it to what you want should be just a change in the sequence of actions that it uses for each block.

+1
source

All Articles