You know that Cocos2d-x has a lot of transitioning effects. However, if it does not have an effect that you need, it is difficult to create an original transitioning effect. However, you can create it if you have the basic knowledge of transitioning effects. In this recipe, we will show you how to create original transitions.
Even though Cocos2d-x has a lot of different types of Transition
classes, you may not find a transition effect that you need. In this recipe, you can create an original transition effect such as opening a door. When the replacement of a scene begins, the previous scene is divided into two and open to the left or right.
You have to create new files named "TransactionDoor.h
" and "TransactionDoor.cpp
," and add them to your project.
TransactionDoor.h
has the following code:
#ifndef __TRANSITIONDOOR_H__ #define __TRANSITIONDOOR_H__ #include "cocos2d.h" NS_CC_BEGIN class CC_DLL TransitionDoor : public TransitionScene...