--cocos2dx场景切换--

前端之家收集整理的这篇文章主要介绍了--cocos2dx场景切换--前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

转自虫子http://blog.csdn.net/ac_huang/article/details/29380893

  1. //场景切换
  2. //[1]TransitionJumpZoom
  3. /*
  4. *作用:场景缩小跳出消失,目标场景跳入
  5. */
  6. Director::getInstance()->replaceScene(TransitionJumpZoom::create(1.2f,scene));
  7. //[1]
  8. //[2]TransitionFade
  9. /*
  10. *作用:淡出淡入,原场景淡出,新场景淡入
  11. */
  12. Director::getInstance()->replaceScene(TransitionFade::create(1.2f,scene));
  13. //[2]
  14. //[3]TransitionFlipX
  15. *作用:水平方向翻页
  16. Director::getInstance()->replaceScene(TransitionFlipX::create(1.2f,0); background-color:inherit">//[3]
  17. //[4]TransitionFlipY
  18. *作用:竖直方向翻页
  19. Director::getInstance()->replaceScene(TransitionFlipX::create(1.2f,0); background-color:inherit">//[4]
  20. //[5]TransitionFlipAngular
  21. *作用:左上右下轴翻入
  22. Director::getInstance()->replaceScene(TransitionFlipAngular::create(1.2f,scene,TransitionScene::Orientation::UP_OVER));
  23. //[5]
  24. //[6]TransitionZoomFlipX
  25. *作用:带缩放效果x轴翻转
  26. Director::getInstance()->replaceScene(TransitionZoomFlipX::create(1.2f,TransitionScene::Orientation::UP_OVER));
  27. //[6]
  28. //[7]TransitionZoomFlipY
  29. *作用:带缩放效果Y轴翻转
  30. Director::getInstance()->replaceScene(TransitionZoomFlipY::create(1.2f,0); background-color:inherit">//[7]
  31. //[8]TransitionZoomFlipAngular
  32. *作用:带缩放效果且有角度的翻转
  33. Director::getInstance()->replaceScene(TransitionZoomFlipAngular::create(1.2f,0); background-color:inherit">//[8]
  34. //[9]TransitionShrinkGrow
  35. *作用:原始场景收缩消失,目标场景伸展放大出现
  36. Director::getInstance()->replaceScene(TransitionShrinkGrow::create(1.2f,0); background-color:inherit">//[9]
  37. //[10]TransitionRotoZoom
  38. *作用:原始场景旋转收缩消失,目标场景旋转伸展放大出现
  39. Director::getInstance()->replaceScene(TransitionRotoZoom::create(1.2f,0); background-color:inherit">//[10]
  40. //[11]TransitionMoveInL
  41. *作用:新场景从左"乱入"(慢慢出现)
  42. Director::getInstance()->replaceScene(TransitionMoveInL::create(1.2f,0); background-color:inherit">//[11]
  43. //[12]TransitionMoveInR
  44. *作用:新场景从右"乱入"(慢慢出现)
  45. Director::getInstance()->replaceScene(TransitionMoveInR::create(1.2f,0); background-color:inherit">//[12]
  46. //[13]TransitionMoveInT
  47. *作用:新场景从上"乱入"(慢慢出现)
  48. Director::getInstance()->replaceScene(TransitionMoveInT::create(1.2f,0); background-color:inherit">//[13]
  49. //[14]TransitionMoveInB
  50. *作用:新场景从上"乱入"(慢慢出现)
  51. Director::getInstance()->replaceScene(TransitionMoveInB::create(1.2f,0); background-color:inherit">//[14]
  52. //[15]TransitionSlideInL
  53. *作用:新场景从左慢慢移入,推出旧场景
  54. Director::getInstance()->replaceScene(TransitionSlideInL::create(1.2f,0); background-color:inherit">//[15]
  55. //[16]TransitionSlideInR
  56. *作用:新场景从右慢慢移入,推出旧场景
  57. Director::getInstance()->replaceScene(TransitionSlideInR::create(1.2f,0); background-color:inherit">//[16]
  58. //[17]TransitionSlideInT
  59. *作用:新场景从上慢慢移入,推出旧场景
  60. Director::getInstance()->replaceScene(TransitionSlideInT::create(1.2f,0); background-color:inherit">//[17]
  61. //[18]TransitionSlideInB
  62. Director::getInstance()->replaceScene(TransitionSlideInB::create(1.2f,0); background-color:inherit">//[18]
  63. //[19]TransitionCrossFade
  64. *作用:淡出淡入交叉,同时进行
  65. Director::getInstance()->replaceScene(TransitionCrossFade::create(1.2f,0); background-color:inherit">//[19]
  66. //[20]TransitionProgressRadialCW
  67. *作用:顺时针消失,新场景出现
  68. Director::getInstance()->replaceScene(TransitionProgressRadialCW::create(1.2f,0); background-color:inherit">//[20]
  69. //[21]TransitionProgressHorizontal
  70. *作用:场景从左到右消失同时另一场景出现
  71. Director::getInstance()->replaceScene(TransitionProgressHorizontal::create(1.2f,0); background-color:inherit">//[21]
  72. //[22]TransitionProgressRadialCCW
  73. *作用:原场景逆时针消失,新场景出现
  74. Director::getInstance()->replaceScene(TransitionProgressRadialCCW::create(1.2f,0); background-color:inherit">//[22]
  75. //[23]TransitionPageTurn
  76. *作用:翻页切换,bool为true是向左上往右下翻,false从右下往左上翻
  77. Director::getInstance()->replaceScene(TransitionPageTurn::create(1.2f,true));
  78. //[23]
  79. //[24]TransitionFadeTR
  80. *作用:往右上波浪(一部分一部分消失)
  81. Director::getInstance()->replaceScene(TransitionFadeTR::create(1.2f,0); background-color:inherit">//[24]
  82. //[25]TransitionFadeBL
  83. *作用:往左下波浪(一部分一部分消失)
  84. Director::getInstance()->replaceScene(TransitionFadeBL::create(1.2f,0); background-color:inherit">//[25]
  85. //[26]TransitionFadeUp
  86. *作用:向上百叶窗式的消失
  87. Director::getInstance()->replaceScene(TransitionFadeUp::create(1.2f,0); background-color:inherit">//[26]
  88. //[27]TransitionFadeDown
  89. *作用:向上百叶窗式的消失
  90. Director::getInstance()->replaceScene(TransitionFadeDown::create(1.2f,0); background-color:inherit">//[27]
  91. //[28]TransitionTurnOffTiles
  92. *作用:随机小方块式的消失
  93. Director::getInstance()->replaceScene(TransitionTurnOffTiles::create(1.2f,0); background-color:inherit">//[28]
  94. //[29]TransitionSplitRows
  95. *作用:按行切开,新场景出现
  96. Director::getInstance()->replaceScene(TransitionSplitRows::create(1.2f,0); background-color:inherit">//[29]
  97. //[30]TransitionSplitCols
  98. *作用:按列切开,新场景出现
  99. Director::getInstance()->replaceScene(TransitionSplitCols::create(1.2f,0); background-color:inherit">//[30]
  100. //[31]TransitionProgressInOut
  101. *作用:场景从中间到四周消失同时另一场景出现
  102. Director::getInstance()->replaceScene(TransitionProgressInOut::create(1.2f,0); background-color:inherit">//[31]
  103. //[32]TransitionProgressOutIn
  104. *作用:场景从四周到中间消失同时另一场景出现
  105. Director::getInstance()->replaceScene(TransitionProgressOutIn::create(1.2f,0); background-color:inherit">//[32]
  106. //[33]TransitionProgressVertical
  107. *作用:场景从四周到中间消失同时另一场景出现
  108. Director::getInstance()->replaceScene(TransitionProgressVertical::create(1.2f,0); background-color:inherit">//[33]

和3.0以前的还是有很大的区别的,不过里面有很多方法不止提供了这一种创建法。具体用到哪个,可以进去看看。放这里方便查找

猜你在找的Cocos2d-x相关文章