[Programming] Everything CC


The new version of Cocos2D is simply superb. I did some basic stuff, like making couple of scenes and moving in between them. The latest versions of Cocos2D have updated the library to have a prefix ‘CC’ before each and every class……which has made coding easy as well. I think I must also adopt similar kind of practice to add ‘RH’ before all my classes :p

Well, I can discuss here some transition related stuff, which might be helpful for everyone. When you are replacing/pushing scenes, we can perform some transition on those scenes. There are many types of transition effects provided in Cocos2D. To perform transition on Scene; one has to write this basic line:

[[CCDirector sharedDirector] replaceScene:[CCFadeTRTransition transitionWithDuration:0.5
scene:[StartingMenuScene scene]]];

In the above example, the screen will fade towards TR (top right) of the screen with the duration of 0.5 seconds and another scene (e.g. StartingMenuScene in this case will appear). Simple 😉
Other types of transition effects available are:
  • CCOrientedTransitionScene
  • CCRotoZoomTransition
  • CCJumpZoomTransition
  • CCMoveInLTransition
  • CCMoveInRTransition
  • CCMoveInTTransition
  • CCMoveInBTransition
  • CCSlideInLTransition
  • CCSlideInRTransition
  • CCSlideInTTransition
  • CCSlideInBTransition
  • CCShrinkGrowTransition
  • CCFlipXTransition
  • CCFlipYTransition
  • CCFlipAngularTransition
  • CCZoomFlipXTransition
  • CCZoomFlipYTransition
  • CCZoomFlipAngularTransition
  • CCFadeTransition
  • CCCrossFadeTransition
  • CCTurnOffTilesTransition
  • CCSplitColsTransition
  • CCSplitRowsTransition
  • CCFadeTRTransition
  • CCFadeBLTransition
  • CCFadeUpTransition
  • CCFadeDownTransition

    Happy Transitioning 😉

    Advertisements