Help with creating custom Transitions (layers or sprites)

Help with creating custom Transitions (layers or sprites)
0.0 0



I’m a noob at cocos2d. Started less than 2 weeks ago. I’ve been assigned a task at office to render a left - right fade animation (similar to CCTransitionFadeDown, which I have managed to somehow reverse engineer). The problem is, same for the iphone has been implemented in an even where there is NO SCENE CHANGE using a UIKit (on the background image layer which is the only child available on the scene at that point). I’m unable to implement it for win32 (using CCTransitionScene) and always get the error that the incoming scene must be different from outgoing one. I’ve tried introducing a dummy scene and transition it into my former scene but got the same error. Thus I’m trying to try a new approach. I think I read somewhere that CCTransitions can be implemented for other classes as well including CCLayer and CCSprite (I’m not entirely sure if it’s possible). If anyone can help me with this, I’d be thankful. I need to create an identical animation on either the background image or its layer.
If anyone can recommend any better solution, I’ll be happy to try that as well. :slight_smile:
Thanks in advance.


Yeah, you can pass the object of CCLayer into CCTransition, it works.


Hi Walzer,

When I am trying to pass CClayer object into CCTransition object, its giving error for no method matching as it takes as parameter a CCScene object. So make it a CCScene object I am upcasting CClayer to CCScene which results in a severe crash.

Can we similarly pass the CCSprite object to CCTransition.
Actually I want to replace one sprite by other with in the same layer along with animation.

Is it possible ?

Need help.