0
votes

I am looking at the various transitions between CCScenes using Spritebuilder. Currently I can do a fade transition using

CCScene *gameplayScene = [CCBReader loadAsScene:@"kitchen"];
CCTransition *crossFade = [CCTransition transitionCrossFadeWithDuration:0.6];
[[CCDirector sharedDirector] replaceScene:gameplayScene withTransition:crossFade];

However standard transitions using Cocos2d do not seem to work with SpriteBuilder (or I am missing something!)

I looked at This Website tutorial which provided the code below. However it I cannot get it working with Spritebuilder

[[CCDirector sharedDirector] replaceScene:[CCTransitionCrossFade transitionWithDuration:0.5f scene:[NewScene scene]]];
1
"not working" is not a problem description. Your first code fragment should work, so what exactly is the problem with it? - LearnCocos2D
sorry. What I meant is how to do other transitions as I cannot find anything on how to do it with SpriteBuilder. The tutorial linked above has various transitions but I cannot apply them when using SpriteBuilder - Allreadyhome
type CCTransition tran.. in Xcode and you'll get completion suggestions for all the other transitions. And check the cocos2d api reference. - LearnCocos2D
my issue is that when I include a CCTransition it says no known class... - Allreadyhome
again, type this in xcode and you will get code completion suggestions: [CCTransition tran - LearnCocos2D

1 Answers

1
votes

Try this

CCScene *gameplayScene = [CCBReader loadAsScene:@"kitchen"];
CCTransition *crossFade = [CCTransition CCTransitionSplitRowsWithDuration:0.6];
[[CCDirector sharedDirector] replaceScene:gameplayScene withTransition:crossFade];

Replace CCTransitionSplitRows with the transition you want. Keep the WithDuration:0.6