ccb 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +20 -0
  3. data/README.md +31 -0
  4. data/bin/ccb +4 -0
  5. data/lib/ccb/builder/project_builder.rb +14 -0
  6. data/lib/ccb/builder/scene_builder.rb +9 -0
  7. data/lib/ccb/builder/templates/project/GameConfig.js.tt +21 -0
  8. data/lib/ccb/builder/templates/project/_cocos-project.json +4 -0
  9. data/lib/ccb/builder/templates/project/folder/CMakeLists.txt +295 -0
  10. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/Base64Images.js +32 -0
  11. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/CCBoot.js +2271 -0
  12. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/CCDebugger.js +336 -0
  13. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCAction.js +694 -0
  14. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCActionCamera.js +293 -0
  15. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCActionCatmullRom.js +605 -0
  16. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCActionEase.js +3681 -0
  17. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCActionInstant.js +757 -0
  18. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCActionInterval.js +3554 -0
  19. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCActionTween.js +166 -0
  20. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions3d/CCActionGrid.js +372 -0
  21. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions3d/CCActionGrid3D.js +1257 -0
  22. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions3d/CCActionPageTurn3D.js +113 -0
  23. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions3d/CCActionTiledGrid.js +1289 -0
  24. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/audio/CCAudio.js +1024 -0
  25. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/clipping-nodes/CCClippingNode.js +224 -0
  26. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/clipping-nodes/CCClippingNodeCanvasRenderCmd.js +227 -0
  27. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/clipping-nodes/CCClippingNodeWebGLRenderCmd.js +226 -0
  28. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/compression/ZipUtils.js +82 -0
  29. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/compression/base64.js +95 -0
  30. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/compression/gzip.js +731 -0
  31. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/compression/zlib.min.js +55 -0
  32. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCActionManager.js +378 -0
  33. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCCamera.js +290 -0
  34. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCConfiguration.js +294 -0
  35. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCDirector.js +1019 -0
  36. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCDirectorWebGL.js +329 -0
  37. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCDrawingPrimitivesCanvas.js +438 -0
  38. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCDrawingPrimitivesWebGL.js +464 -0
  39. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCScheduler.js +744 -0
  40. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/BaseNodesPropertyDefine.js +127 -0
  41. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCAtlasNode.js +294 -0
  42. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCAtlasNodeCanvasRenderCmd.js +138 -0
  43. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCAtlasNodeWebGLRenderCmd.js +145 -0
  44. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCNode.js +2386 -0
  45. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCNodeCanvasRenderCmd.js +504 -0
  46. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCNodeWebGLRenderCmd.js +254 -0
  47. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/cocoa/CCAffineTransform.js +259 -0
  48. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/cocoa/CCGeometry.js +327 -0
  49. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/event-manager/CCEvent.js +449 -0
  50. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/event-manager/CCEventExtension.js +126 -0
  51. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/event-manager/CCEventListener.js +519 -0
  52. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/event-manager/CCEventManager.js +1025 -0
  53. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/event-manager/CCTouch.js +175 -0
  54. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/labelttf/CCLabelTTF.js +829 -0
  55. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/labelttf/CCLabelTTFCanvasRenderCmd.js +420 -0
  56. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/labelttf/CCLabelTTFWebGLRenderCmd.js +101 -0
  57. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/labelttf/LabelTTFPropertyDefine.js +88 -0
  58. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/layers/CCLayer.js +642 -0
  59. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/layers/CCLayerCanvasRenderCmd.js +434 -0
  60. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/layers/CCLayerWebGLRenderCmd.js +248 -0
  61. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCClass.js +333 -0
  62. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCCommon.js +303 -0
  63. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCConfig.js +303 -0
  64. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCEGLView.js +1245 -0
  65. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCInputExtension.js +135 -0
  66. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCInputManager.js +616 -0
  67. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCLoaders.js +142 -0
  68. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCMacro.js +830 -0
  69. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCSAXParser.js +160 -0
  70. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCScreen.js +155 -0
  71. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCTypes.js +374 -0
  72. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCTypesPropertyDefine.js +165 -0
  73. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCTypesWebGL.js +689 -0
  74. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCVisibleRect.js +100 -0
  75. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/miniFramework.js +264 -0
  76. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/renderer/RendererCanvas.js +274 -0
  77. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/renderer/RendererWebGL.js +137 -0
  78. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/scenes/CCLoaderScene.js +149 -0
  79. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/scenes/CCScene.js +62 -0
  80. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCAnimation.js +477 -0
  81. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCAnimationCache.js +213 -0
  82. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCBakeSprite.js +71 -0
  83. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSprite.js +1014 -0
  84. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteBatchNode.js +676 -0
  85. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteBatchNodeCanvasRenderCmd.js +101 -0
  86. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteBatchNodeWebGLRenderCmd.js +243 -0
  87. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteCanvasRenderCmd.js +518 -0
  88. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteFrame.js +420 -0
  89. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteFrameCache.js +341 -0
  90. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteWebGLRenderCmd.js +493 -0
  91. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/SpritesPropertyDefine.js +67 -0
  92. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/support/CCPointExtension.js +515 -0
  93. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/support/CCVertex.js +170 -0
  94. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/support/TransformUtils.js +62 -0
  95. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/textures/CCTexture2D.js +455 -0
  96. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/textures/CCTextureAtlas.js +653 -0
  97. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/textures/CCTextureCache.js +371 -0
  98. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/textures/TexturesPropertyDefine.js +221 -0
  99. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/textures/TexturesWebGL.js +899 -0
  100. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/utils/BinaryLoader.js +151 -0
  101. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/effects/CCGrabber.js +110 -0
  102. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/effects/CCGrid.js +737 -0
  103. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/aabb.js +68 -0
  104. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/gl/mat4stack.js +59 -0
  105. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/gl/matrix.js +169 -0
  106. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/mat3.js +329 -0
  107. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/mat4.js +810 -0
  108. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/plane.js +184 -0
  109. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/quaternion.js +497 -0
  110. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/ray2.js +163 -0
  111. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/utility.js +76 -0
  112. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/vec2.js +107 -0
  113. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/vec3.js +205 -0
  114. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/vec4.js +158 -0
  115. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/labels/CCLabelAtlas.js +239 -0
  116. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/labels/CCLabelAtlasCanvasRenderCmd.js +95 -0
  117. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/labels/CCLabelAtlasWebGLRenderCmd.js +132 -0
  118. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/labels/CCLabelBMFont.js +958 -0
  119. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/labels/CCLabelBMFontCanvasRenderCmd.js +142 -0
  120. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/labels/CCLabelBMFontWebGLRenderCmd.js +87 -0
  121. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/menus/CCMenu.js +600 -0
  122. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/menus/CCMenuItem.js +1422 -0
  123. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/motion-streak/CCMotionStreak.js +517 -0
  124. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/motion-streak/CCMotionStreakWebGLRenderCmd.js +66 -0
  125. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/node-grid/CCNodeGrid.js +129 -0
  126. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/node-grid/CCNodeGridWebGLRenderCmd.js +98 -0
  127. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/parallax/CCParallaxNode.js +252 -0
  128. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/parallax/CCParallaxNodeRenderCmd.js +69 -0
  129. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCPNGReader.js +330 -0
  130. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleBatchNode.js +527 -0
  131. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleBatchNodeCanvasRenderCmd.js +38 -0
  132. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleBatchNodeWebGLRenderCmd.js +74 -0
  133. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleExamples.js +1006 -0
  134. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleSystem.js +2294 -0
  135. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleSystemCanvasRenderCmd.js +217 -0
  136. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleSystemWebGLRenderCmd.js +402 -0
  137. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCTIFFReader.js +692 -0
  138. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/physics/CCPhysicsDebugNode.js +212 -0
  139. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/physics/CCPhysicsDebugNodeCanvasRenderCmd.js +52 -0
  140. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/physics/CCPhysicsDebugNodeWebGLRenderCmd.js +53 -0
  141. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/physics/CCPhysicsSprite.js +447 -0
  142. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/physics/CCPhysicsSpriteCanvasRenderCmd.js +93 -0
  143. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/physics/CCPhysicsSpriteWebGLRenderCmd.js +87 -0
  144. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/progress-timer/CCActionProgressTimer.js +227 -0
  145. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/progress-timer/CCProgressTimer.js +345 -0
  146. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/progress-timer/CCProgressTimerCanvasRenderCmd.js +270 -0
  147. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/progress-timer/CCProgressTimerWebGLRenderCmd.js +486 -0
  148. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/render-texture/CCRenderTexture.js +395 -0
  149. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/render-texture/CCRenderTextureCanvasRenderCmd.js +105 -0
  150. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/render-texture/CCRenderTextureWebGLRenderCmd.js +367 -0
  151. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shaders/CCGLProgram.js +767 -0
  152. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shaders/CCGLStateCache.js +340 -0
  153. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shaders/CCShaderCache.js +301 -0
  154. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shaders/CCShaders.js +280 -0
  155. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shape-nodes/CCDrawNode.js +940 -0
  156. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shape-nodes/CCDrawNodeCanvasRenderCmd.js +129 -0
  157. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shape-nodes/CCDrawNodeWebGLRenderCmd.js +41 -0
  158. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/text-input/CCIMEDispatcher.js +526 -0
  159. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/text-input/CCTextFieldTTF.js +472 -0
  160. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTGAlib.js +437 -0
  161. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTMXLayer.js +914 -0
  162. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTMXLayerCanvasRenderCmd.js +232 -0
  163. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTMXLayerWebGLRenderCmd.js +67 -0
  164. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTMXObjectGroup.js +146 -0
  165. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTMXTiledMap.js +479 -0
  166. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTMXXMLParser.js +950 -0
  167. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/transitions/CCTransition.js +1971 -0
  168. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/transitions/CCTransitionPageTurn.js +152 -0
  169. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/transitions/CCTransitionProgress.js +458 -0
  170. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBAnimationManager.js +770 -0
  171. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBKeyframe.js +60 -0
  172. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBReader.js +1129 -0
  173. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBReaderUtil.js +61 -0
  174. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBRelativePositioning.js +90 -0
  175. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBSequence.js +114 -0
  176. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBValue.js +81 -0
  177. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCControlLoader.js +318 -0
  178. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCNodeLoader.js +905 -0
  179. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCNodeLoaderLibrary.js +101 -0
  180. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCSpriteLoader.js +544 -0
  181. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccpool/CCPool.js +146 -0
  182. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/CCProtectedNode.js +305 -0
  183. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/CCProtectedNodeCanvasRenderCmd.js +246 -0
  184. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/CCProtectedNodeWebGLRenderCmd.js +159 -0
  185. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/UIScale9Sprite.js +1105 -0
  186. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/UIScale9SpriteCanvasRenderCmd.js +142 -0
  187. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/UIScale9SpriteWebGLRenderCmd.js +129 -0
  188. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/UIWidget.js +2059 -0
  189. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/UIWidgetRenderCmd.js +100 -0
  190. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UIHBox.js +80 -0
  191. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UILayout.js +1558 -0
  192. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UILayoutCanvasRenderCmd.js +179 -0
  193. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UILayoutComponent.js +585 -0
  194. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UILayoutManager.js +457 -0
  195. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UILayoutParameter.js +576 -0
  196. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UILayoutWebGLRenderCmd.js +240 -0
  197. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UIRelativeBox.js +79 -0
  198. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UIVBox.js +79 -0
  199. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/system/CocosGUI.js +62 -0
  200. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/system/UIHelper.js +164 -0
  201. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UIButton.js +987 -0
  202. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UICheckBox.js +737 -0
  203. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UIImageView.js +337 -0
  204. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UILoadingBar.js +432 -0
  205. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UIRichText.js +579 -0
  206. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UISlider.js +762 -0
  207. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UIText.js +512 -0
  208. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UITextAtlas.js +229 -0
  209. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UITextBMFont.js +216 -0
  210. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UITextField.js +915 -0
  211. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/scroll-widget/UIListView.js +602 -0
  212. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/scroll-widget/UIPageView.js +657 -0
  213. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/scroll-widget/UIScrollView.js +1884 -0
  214. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/CocoStudio.js +68 -0
  215. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/action/CCActionFrame.js +528 -0
  216. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/action/CCActionManager.js +112 -0
  217. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/action/CCActionNode.js +417 -0
  218. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/action/CCActionObject.js +263 -0
  219. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/CCArmature.js +579 -0
  220. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/CCArmatureCanvasRenderCmd.js +190 -0
  221. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/CCArmatureWebGLRenderCmd.js +167 -0
  222. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/CCBone.js +711 -0
  223. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/animation/CCArmatureAnimation.js +669 -0
  224. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/animation/CCProcessBase.js +365 -0
  225. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/animation/CCTween.js +448 -0
  226. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/datas/CCDatas.js +807 -0
  227. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/display/CCDecorativeDisplay.js +118 -0
  228. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/display/CCDisplayFactory.js +220 -0
  229. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/display/CCDisplayManager.js +465 -0
  230. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/display/CCSkin.js +215 -0
  231. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/display/CCSkinCanvasRenderCmd.js +58 -0
  232. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/display/CCSkinWebGLRenderCmd.js +146 -0
  233. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/physics/CCColliderDetector.js +397 -0
  234. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCArmatureDataManager.js +325 -0
  235. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCArmatureDefine.js +45 -0
  236. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCDataReaderHelper.js +1223 -0
  237. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCSpriteFrameCacheHelper.js +68 -0
  238. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCTransformHelp.js +183 -0
  239. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCTweenFunction.js +501 -0
  240. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCUtilMath.js +69 -0
  241. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/components/CCComAttribute.js +210 -0
  242. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/components/CCComAudio.js +285 -0
  243. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/components/CCComController.js +76 -0
  244. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/components/CCComRender.js +91 -0
  245. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/components/CCComponent.js +136 -0
  246. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/components/CCComponentContainer.js +159 -0
  247. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/load.js +221 -0
  248. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/action-1.x.js +238 -0
  249. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/action-2.x.js +266 -0
  250. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/compatible.js +251 -0
  251. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/scene-1.x.js +262 -0
  252. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/timelineParser-1.x.js +292 -0
  253. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/timelineParser-2.x.js +1288 -0
  254. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/uiParser-1.x.js +680 -0
  255. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/timeline/ActionTimeline.js +448 -0
  256. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/timeline/Frame.js +1268 -0
  257. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/timeline/Timeline.js +321 -0
  258. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/trigger/ObjectFactory.js +99 -0
  259. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/trigger/TriggerBase.js +49 -0
  260. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/trigger/TriggerMng.js +301 -0
  261. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/trigger/TriggerObj.js +263 -0
  262. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/editbox/CCEditBox.js +716 -0
  263. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/editbox/CCdomNode.js +657 -0
  264. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControl.js +381 -0
  265. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlButton.js +688 -0
  266. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlColourPicker.js +187 -0
  267. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlHuePicker.js +218 -0
  268. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlPotentiometer.js +300 -0
  269. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlSaturationBrightnessPicker.js +257 -0
  270. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlSlider.js +308 -0
  271. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlStepper.js +390 -0
  272. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlSwitch.js +425 -0
  273. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlUtils.js +177 -0
  274. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCInvocation.js +65 -0
  275. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCMenuPassive.js +415 -0
  276. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCScale9Sprite.js +1099 -0
  277. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCScale9SpriteCanvasRenderCmd.js +142 -0
  278. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCScale9SpriteWebGLRenderCmd.js +129 -0
  279. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/scrollview/CCScrollView.js +827 -0
  280. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/scrollview/CCScrollViewCanvasRenderCmd.js +79 -0
  281. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/scrollview/CCScrollViewWebGLRenderCmd.js +108 -0
  282. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/scrollview/CCSorting.js +239 -0
  283. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/scrollview/CCTableView.js +718 -0
  284. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/spine/CCSkeleton.js +357 -0
  285. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/spine/CCSkeletonAnimation.js +340 -0
  286. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/spine/CCSkeletonCanvasRenderCmd.js +165 -0
  287. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/spine/CCSkeletonWebGLRenderCmd.js +165 -0
  288. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/spine/Spine.js +2239 -0
  289. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/external/box2d/box2d.js +10882 -0
  290. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/external/chipmunk/chipmunk.js +6196 -0
  291. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/external/pluginx/Plugin.js +254 -0
  292. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/external/pluginx/platform/facebook.js +557 -0
  293. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/external/pluginx/platform/facebook_sdk.js +151 -0
  294. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/external/socketio/socket.io.min.js +2 -0
  295. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/jsb_apis.js +618 -0
  296. data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/moduleConfig.json +453 -0
  297. data/lib/ccb/builder/templates/project/folder/project.json +42 -0
  298. data/lib/ccb/builder/templates/project/folder/res/CloseNormal.png +0 -0
  299. data/lib/ccb/builder/templates/project/folder/res/CloseSelected.png +0 -0
  300. data/lib/ccb/builder/templates/project/folder/res/HelloWorld.png +0 -0
  301. data/lib/ccb/builder/templates/project/folder/res/favicon.ico +0 -0
  302. data/lib/ccb/builder/templates/project/folder/res/gameOver/cocos2d-html5.png +0 -0
  303. data/lib/ccb/builder/templates/project/folder/res/gameOver/gameOver.png +0 -0
  304. data/lib/ccb/builder/templates/project/folder/res/mainMenu/bg.png +0 -0
  305. data/lib/ccb/builder/templates/project/folder/res/mainMenu/menu.png +0 -0
  306. data/lib/ccb/builder/templates/project/folder/res/setting/menuTitle.png +0 -0
  307. data/lib/ccb/builder/templates/project/folder/res/shared/arial-14.fnt +182 -0
  308. data/lib/ccb/builder/templates/project/folder/res/shared/arial-14.png +0 -0
  309. data/lib/ccb/builder/templates/project/folder/res/sound/music/bgMusic.mp3 +0 -0
  310. data/lib/ccb/builder/templates/project/folder/src/about/layer/ABBackgroundLayer.js +23 -0
  311. data/lib/ccb/builder/templates/project/folder/src/about/layer/ABTouchLayer.js +51 -0
  312. data/lib/ccb/builder/templates/project/folder/src/about/scene/About.js +36 -0
  313. data/lib/ccb/builder/templates/project/folder/src/config/Level.js +7 -0
  314. data/lib/ccb/builder/templates/project/folder/src/gameOver/layer/GOBackgroundLayer.js +50 -0
  315. data/lib/ccb/builder/templates/project/folder/src/gameOver/layer/GOTouchLayer.js +51 -0
  316. data/lib/ccb/builder/templates/project/folder/src/gameOver/scene/GameOver.js +38 -0
  317. data/lib/ccb/builder/templates/project/folder/src/gamePlay/classes/LevelManager.js +21 -0
  318. data/lib/ccb/builder/templates/project/folder/src/gamePlay/layer/GPBackgroundLayer.js +25 -0
  319. data/lib/ccb/builder/templates/project/folder/src/gamePlay/layer/GPTouchLayer.js +51 -0
  320. data/lib/ccb/builder/templates/project/folder/src/gamePlay/scene/GamePlay.js +44 -0
  321. data/lib/ccb/builder/templates/project/folder/src/mainMenu/layer/MMBackgroundLayer.js +43 -0
  322. data/lib/ccb/builder/templates/project/folder/src/mainMenu/layer/MMMainMenuLayer.js +38 -0
  323. data/lib/ccb/builder/templates/project/folder/src/mainMenu/layer/MMTouchLayer.js +96 -0
  324. data/lib/ccb/builder/templates/project/folder/src/mainMenu/scene/MainMenu.js +45 -0
  325. data/lib/ccb/builder/templates/project/folder/src/resource.js +29 -0
  326. data/lib/ccb/builder/templates/project/folder/src/setting/layer/STBackgroundLayer.js +25 -0
  327. data/lib/ccb/builder/templates/project/folder/src/setting/layer/STTouchLayer.js +89 -0
  328. data/lib/ccb/builder/templates/project/folder/src/setting/scene/Setting.js +40 -0
  329. data/lib/ccb/builder/templates/project/index.html.tt +27 -0
  330. data/lib/ccb/builder/templates/project/main.js.tt +62 -0
  331. data/lib/ccb/cli.rb +32 -0
  332. data/lib/ccb/ext/method_hooker.rb +68 -0
  333. data/lib/ccb/ext/string_extention.rb +7 -0
  334. data/lib/ccb.rb +1 -0
  335. metadata +449 -0
@@ -0,0 +1,1971 @@
1
+ /****************************************************************************
2
+ Copyright (c) 2008-2010 Ricardo Quesada
3
+ Copyright (c) 2011-2012 cocos2d-x.org
4
+ Copyright (c) 2013-2014 Chukong Technologies Inc.
5
+
6
+ http://www.cocos2d-x.org
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+ ****************************************************************************/
26
+ /**
27
+ * A tag constant for identifying fade scenes
28
+ * @constant
29
+ * @type Number
30
+ */
31
+ cc.SCENE_FADE = 4208917214;
32
+
33
+ /**
34
+ * horizontal orientation Type where the Left is nearer
35
+ * @constant
36
+ * @type Number
37
+ */
38
+ cc.TRANSITION_ORIENTATION_LEFT_OVER = 0;
39
+ /**
40
+ * horizontal orientation type where the Right is nearer
41
+ * @constant
42
+ * @type Number
43
+ */
44
+ cc.TRANSITION_ORIENTATION_RIGHT_OVER = 1;
45
+ /**
46
+ * vertical orientation type where the Up is nearer
47
+ * @constant
48
+ * @type Number
49
+ */
50
+ cc.TRANSITION_ORIENTATION_UP_OVER = 0;
51
+ /**
52
+ * vertical orientation type where the Bottom is nearer
53
+ * @constant
54
+ * @type Number
55
+ */
56
+ cc.TRANSITION_ORIENTATION_DOWN_OVER = 1;
57
+
58
+ /**
59
+ * @class
60
+ * @extends cc.Scene
61
+ * @param {Number} t time in seconds
62
+ * @param {cc.Scene} scene the scene to transit with
63
+ * @example
64
+ * var trans = new TransitionScene(time,scene);
65
+ */
66
+ cc.TransitionScene = cc.Scene.extend(/** @lends cc.TransitionScene# */{
67
+ _inScene:null,
68
+ _outScene:null,
69
+ _duration:null,
70
+ _isInSceneOnTop:false,
71
+ _isSendCleanupToScene:false,
72
+ _className:"TransitionScene",
73
+
74
+ /**
75
+ * creates a base transition with duration and incoming scene
76
+ * Constructor of cc.TransitionScene
77
+ * @param {Number} t time in seconds
78
+ * @param {cc.Scene} scene the scene to transit with
79
+ */
80
+ ctor:function (t, scene) {
81
+ cc.Scene.prototype.ctor.call(this);
82
+ if(t !== undefined && scene !== undefined)
83
+ this.initWithDuration(t, scene);
84
+ },
85
+
86
+ //private
87
+ _setNewScene:function (dt) {
88
+ this.unschedule(this._setNewScene);
89
+ // Before replacing, save the "send cleanup to scene"
90
+ var director = cc.director;
91
+ this._isSendCleanupToScene = director.isSendCleanupToScene();
92
+ director.runScene(this._inScene);
93
+
94
+ // enable events while transitions
95
+ cc.eventManager.setEnabled(true);
96
+
97
+ // issue #267
98
+ this._outScene.visible = true;
99
+ },
100
+
101
+ //protected
102
+ _sceneOrder:function () {
103
+ this._isInSceneOnTop = true;
104
+ },
105
+
106
+ /**
107
+ * stuff gets drawn here
108
+ */
109
+ visit:function () {
110
+ if (this._isInSceneOnTop) {
111
+ this._outScene.visit();
112
+ this._inScene.visit();
113
+ } else {
114
+ this._inScene.visit();
115
+ this._outScene.visit();
116
+ }
117
+ cc.Node.prototype.visit.call(this);
118
+ },
119
+
120
+ /**
121
+ * <p>
122
+ * Event callback that is invoked every time when cc.TransitionScene enters the 'stage'. <br/>
123
+ * If the TransitionScene enters the 'stage' with a transition, this event is called when the transition starts. <br/>
124
+ * During onEnter you can't access a "sister/brother" node. <br/>
125
+ * If you override onEnter, you must call its parent's onEnter function with this._super().
126
+ * </p>
127
+ */
128
+ onEnter:function () {
129
+ cc.Node.prototype.onEnter.call(this);
130
+
131
+ // disable events while transitions
132
+ cc.eventManager.setEnabled(false);
133
+
134
+ // outScene should not receive the onEnter callback
135
+ // only the onExitTransitionDidStart
136
+ this._outScene.onExitTransitionDidStart();
137
+
138
+ this._inScene.onEnter();
139
+ },
140
+
141
+ /**
142
+ * <p>
143
+ * callback that is called every time the cc.TransitionScene leaves the 'stage'. <br/>
144
+ * If the cc.TransitionScene leaves the 'stage' with a transition, this callback is called when the transition finishes. <br/>
145
+ * During onExit you can't access a sibling node. <br/>
146
+ * If you override onExit, you shall call its parent's onExit with this._super().
147
+ * </p>
148
+ */
149
+ onExit:function () {
150
+ cc.Node.prototype.onExit.call(this);
151
+
152
+ // enable events while transitions
153
+ cc.eventManager.setEnabled(true);
154
+
155
+ this._outScene.onExit();
156
+
157
+ // _inScene should not receive the onEnter callback
158
+ // only the onEnterTransitionDidFinish
159
+ this._inScene.onEnterTransitionDidFinish();
160
+ },
161
+
162
+ /**
163
+ * custom cleanup
164
+ */
165
+ cleanup:function () {
166
+ cc.Node.prototype.cleanup.call(this);
167
+
168
+ if (this._isSendCleanupToScene)
169
+ this._outScene.cleanup();
170
+ },
171
+
172
+ /**
173
+ * initializes a transition with duration and incoming scene
174
+ * @param {Number} t time in seconds
175
+ * @param {cc.Scene} scene a scene to transit to
176
+ * @return {Boolean} return false if error
177
+ */
178
+ initWithDuration:function (t, scene) {
179
+ if(!scene)
180
+ throw "cc.TransitionScene.initWithDuration(): Argument scene must be non-nil";
181
+
182
+ if (this.init()) {
183
+ this._duration = t;
184
+ this.attr({
185
+ x: 0,
186
+ y: 0,
187
+ anchorX: 0,
188
+ anchorY: 0
189
+ });
190
+ // retain
191
+ this._inScene = scene;
192
+ this._outScene = cc.director.getRunningScene();
193
+ if (!this._outScene) {
194
+ this._outScene = new cc.Scene();
195
+ this._outScene.init();
196
+ }
197
+
198
+ if(this._inScene == this._outScene)
199
+ throw "cc.TransitionScene.initWithDuration(): Incoming scene must be different from the outgoing scene";
200
+
201
+ this._sceneOrder();
202
+ return true;
203
+ } else {
204
+ return false;
205
+ }
206
+ },
207
+
208
+ /**
209
+ * called after the transition finishes
210
+ */
211
+ finish:function () {
212
+ // clean up
213
+ this._inScene.attr({
214
+ visible: true,
215
+ x: 0,
216
+ y: 0,
217
+ scale: 1.0,
218
+ rotation: 0.0
219
+ });
220
+ if(cc._renderType === cc._RENDER_TYPE_WEBGL)
221
+ this._inScene.getCamera().restore();
222
+
223
+ this._outScene.attr({
224
+ visible: false,
225
+ x: 0,
226
+ y: 0,
227
+ scale: 1.0,
228
+ rotation: 0.0
229
+ });
230
+ if(cc._renderType === cc._RENDER_TYPE_WEBGL)
231
+ this._outScene.getCamera().restore();
232
+
233
+ //[self schedule:@selector(setNewScene:) interval:0];
234
+ this.schedule(this._setNewScene, 0);
235
+ },
236
+
237
+ /**
238
+ * set hide the out scene and show in scene
239
+ */
240
+ hideOutShowIn:function () {
241
+ this._inScene.visible = true;
242
+ this._outScene.visible = false;
243
+ }
244
+ });
245
+ /**
246
+ * creates a base transition with duration and incoming scene
247
+ * @deprecated since v3.0, please use new cc.TransitionScene(t,scene) instead
248
+ * @param {Number} t time in seconds
249
+ * @param {cc.Scene} scene the scene to transit with
250
+ * @return {cc.TransitionScene|Null}
251
+ */
252
+ cc.TransitionScene.create = function (t, scene) {
253
+ return new cc.TransitionScene(t, scene);
254
+ };
255
+
256
+ /**
257
+ * A cc.Transition that supports orientation like.<br/>
258
+ * Possible orientation: LeftOver, RightOver, UpOver, DownOver<br/>
259
+ * useful for when you want to make a transition happen between 2 orientations
260
+ * @class
261
+ * @extends cc.TransitionScene
262
+ * @param {Number} t time in seconds
263
+ * @param {cc.Scene} scene
264
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} orientation
265
+ * @example
266
+ * var trans = new cc.TransitionSceneOriented(time,scene,orientation);
267
+ */
268
+ cc.TransitionSceneOriented = cc.TransitionScene.extend(/** @lends cc.TransitionSceneOriented# */{
269
+ _orientation:0,
270
+
271
+ /**
272
+ * Constructor of TransitionSceneOriented
273
+ * @param {Number} t time in seconds
274
+ * @param {cc.Scene} scene
275
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} orientation
276
+ */
277
+ ctor:function (t, scene, orientation) {
278
+ cc.TransitionScene.prototype.ctor.call(this);
279
+ orientation != undefined && this.initWithDuration(t, scene, orientation);
280
+ },
281
+ /**
282
+ * initialize the transition
283
+ * @param {Number} t time in seconds
284
+ * @param {cc.Scene} scene
285
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} orientation
286
+ * @return {Boolean}
287
+ */
288
+ initWithDuration:function (t, scene, orientation) {
289
+ if (cc.TransitionScene.prototype.initWithDuration.call(this, t, scene)) {
290
+ this._orientation = orientation;
291
+ }
292
+ return true;
293
+ }
294
+ });
295
+
296
+ /**
297
+ * creates a base transition with duration and incoming scene
298
+ * @deprecated since v3.0 ,please use new cc.TransitionSceneOriented(t, scene, orientation) instead.
299
+ * @param {Number} t time in seconds
300
+ * @param {cc.Scene} scene
301
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} orientation
302
+ * @return {cc.TransitionSceneOriented}
303
+ */
304
+ cc.TransitionSceneOriented.create = function (t, scene, orientation) {
305
+ return new cc.TransitionSceneOriented(t, scene, orientation);
306
+ };
307
+
308
+ /**
309
+ * Rotate and zoom out the outgoing scene, and then rotate and zoom in the incoming
310
+ * @class
311
+ * @extends cc.TransitionScene
312
+ * @param {Number} t time in seconds
313
+ * @param {cc.Scene} scene
314
+ * @example
315
+ * var trans = new cc.TransitionRotoZoom(t, scene);
316
+ */
317
+ cc.TransitionRotoZoom = cc.TransitionScene.extend(/** @lends cc.TransitionRotoZoom# */{
318
+
319
+ /**
320
+ * Constructor of TransitionRotoZoom
321
+ * @function
322
+ * @param {Number} t time in seconds
323
+ * @param {cc.Scene} scene
324
+ */
325
+ ctor:function (t, scene) {
326
+ cc.TransitionScene.prototype.ctor.call(this);
327
+ scene && this.initWithDuration(t, scene);
328
+ },
329
+ /**
330
+ * Custom On Enter callback
331
+ * @override
332
+ */
333
+ onEnter:function () {
334
+ cc.TransitionScene.prototype.onEnter.call(this);
335
+
336
+ this._inScene.attr({
337
+ scale: 0.001,
338
+ anchorX: 0.5,
339
+ anchorY: 0.5
340
+ });
341
+ this._outScene.attr({
342
+ scale: 1.0,
343
+ anchorX: 0.5,
344
+ anchorY: 0.5
345
+ });
346
+
347
+ var rotoZoom = cc.sequence(
348
+ cc.spawn(cc.scaleBy(this._duration / 2, 0.001),
349
+ cc.rotateBy(this._duration / 2, 360 * 2)),
350
+ cc.delayTime(this._duration / 2));
351
+
352
+ this._outScene.runAction(rotoZoom);
353
+ this._inScene.runAction(
354
+ cc.sequence(rotoZoom.reverse(),
355
+ cc.callFunc(this.finish, this)));
356
+ }
357
+ });
358
+
359
+ /**
360
+ * Creates a Transtion rotation and zoom
361
+ * @deprecated since v3.0,please use new cc.TransitionRotoZoom(t, scene) instead
362
+ * @param {Number} t time in seconds
363
+ * @param {cc.Scene} scene the scene to work with
364
+ * @return {cc.TransitionRotoZoom}
365
+ */
366
+ cc.TransitionRotoZoom.create = function (t, scene) {
367
+ return new cc.TransitionRotoZoom(t, scene);
368
+ };
369
+
370
+ /**
371
+ * Zoom out and jump the outgoing scene, and then jump and zoom in the incoming
372
+ * @class
373
+ * @extends cc.TransitionScene
374
+ * @param {Number} t time in seconds
375
+ * @param {cc.Scene} scene
376
+ * @example
377
+ * var trans = new cc.TransitionJumpZoom(t, scene);
378
+ */
379
+ cc.TransitionJumpZoom = cc.TransitionScene.extend(/** @lends cc.TransitionJumpZoom# */{
380
+ /**
381
+ * Constructor of TransitionJumpZoom
382
+ * @param {Number} t time in seconds
383
+ * @param {cc.Scene} scene
384
+ */
385
+ ctor:function (t, scene) {
386
+ cc.TransitionScene.prototype.ctor.call(this);
387
+ scene && this.initWithDuration(t, scene);
388
+ },
389
+ /**
390
+ * Custom on enter
391
+ */
392
+ onEnter:function () {
393
+ cc.TransitionScene.prototype.onEnter.call(this);
394
+ var winSize = cc.director.getWinSize();
395
+
396
+ this._inScene.attr({
397
+ scale: 0.5,
398
+ x: winSize.width,
399
+ y: 0,
400
+ anchorX: 0.5,
401
+ anchorY: 0.5
402
+ });
403
+ this._outScene.anchorX = 0.5;
404
+ this._outScene.anchorY = 0.5;
405
+
406
+ var jump = cc.jumpBy(this._duration / 4, cc.p(-winSize.width, 0), winSize.width / 4, 2);
407
+ var scaleIn = cc.scaleTo(this._duration / 4, 1.0);
408
+ var scaleOut = cc.scaleTo(this._duration / 4, 0.5);
409
+
410
+ var jumpZoomOut = cc.sequence(scaleOut, jump);
411
+ var jumpZoomIn = cc.sequence(jump, scaleIn);
412
+
413
+ var delay = cc.delayTime(this._duration / 2);
414
+ this._outScene.runAction(jumpZoomOut);
415
+ this._inScene.runAction(cc.sequence(delay, jumpZoomIn, cc.callFunc(this.finish, this)));
416
+ }
417
+ });
418
+
419
+ /**
420
+ * creates a scene transition that zooms then jump across the screen, the same for the incoming scene
421
+ * @deprecated since v3.0,please use new cc.TransitionJumpZoom(t, scene);
422
+ * @param {Number} t time in seconds
423
+ * @param {cc.Scene} scene
424
+ * @return {cc.TransitionJumpZoom}
425
+ */
426
+ cc.TransitionJumpZoom.create = function (t, scene) {
427
+ return new cc.TransitionJumpZoom(t, scene);
428
+ };
429
+
430
+ /**
431
+ * Move in from to the left the incoming scene.
432
+ * @class
433
+ * @extends cc.TransitionScene
434
+ * @param {Number} t time in seconds
435
+ * @param {cc.Scene} scene
436
+ * @example
437
+ * var trans = new cc.TransitionMoveInL(time,scene);
438
+ */
439
+ cc.TransitionMoveInL = cc.TransitionScene.extend(/** @lends cc.TransitionMoveInL# */{
440
+ /**
441
+ * Constructor of TransitionMoveInL
442
+ * @param {Number} t time in seconds
443
+ * @param {cc.Scene} scene
444
+ */
445
+ ctor:function (t, scene) {
446
+ cc.TransitionScene.prototype.ctor.call(this);
447
+ scene && this.initWithDuration(t, scene);
448
+ },
449
+ /**
450
+ * Custom on enter
451
+ */
452
+ onEnter:function () {
453
+ cc.TransitionScene.prototype.onEnter.call(this);
454
+ this.initScenes();
455
+
456
+ var action = this.action();
457
+ this._inScene.runAction(
458
+ cc.sequence(this.easeActionWithAction(action), cc.callFunc(this.finish, this))
459
+ );
460
+ },
461
+
462
+ /**
463
+ * initializes the scenes
464
+ */
465
+ initScenes:function () {
466
+ this._inScene.setPosition(-cc.director.getWinSize().width, 0);
467
+ },
468
+
469
+ /**
470
+ * returns the action that will be performed
471
+ */
472
+ action:function () {
473
+ return cc.moveTo(this._duration, cc.p(0, 0));
474
+ },
475
+
476
+ /**
477
+ * creates an ease action from action
478
+ * @param {cc.ActionInterval} action
479
+ * @return {cc.EaseOut}
480
+ */
481
+ easeActionWithAction:function (action) {
482
+ return new cc.EaseOut(action, 2.0);
483
+ }
484
+ });
485
+
486
+ /**
487
+ * creates an action that Move in from to the left the incoming scene.
488
+ * @deprecated since v3.0,please use new cc.TransitionMoveInL(t, scene) instead
489
+ * @param {Number} t time in seconds
490
+ * @param {cc.Scene} scene
491
+ * @return {cc.TransitionMoveInL}
492
+ */
493
+ cc.TransitionMoveInL.create = function (t, scene) {
494
+ return new cc.TransitionMoveInL(t, scene);
495
+ };
496
+
497
+ /**
498
+ * Move in from to the right the incoming scene.
499
+ * @class
500
+ * @extends cc.TransitionMoveInL
501
+ * @param {Number} t time in seconds
502
+ * @param {cc.Scene} scene
503
+ * @example
504
+ * var trans = new cc.TransitionMoveInR(time,scene);
505
+ */
506
+ cc.TransitionMoveInR = cc.TransitionMoveInL.extend(/** @lends cc.TransitionMoveInR# */{
507
+ /**
508
+ * Constructor of TransitionMoveInR
509
+ * @param {Number} t time in seconds
510
+ * @param {cc.Scene} scene
511
+ */
512
+ ctor:function (t, scene) {
513
+ cc.TransitionMoveInL.prototype.ctor.call(this);
514
+ scene && this.initWithDuration(t, scene);
515
+ },
516
+ /**
517
+ * Init function
518
+ */
519
+ initScenes:function () {
520
+ this._inScene.setPosition(cc.director.getWinSize().width, 0);
521
+ }
522
+ });
523
+
524
+ /**
525
+ * create a scene transition that Move in from to the right the incoming scene.
526
+ * @deprecated since v3.0,please use new cc.TransitionMoveInR(t, scene) instead
527
+ * @param {Number} t time in seconds
528
+ * @param {cc.Scene} scene
529
+ * @return {cc.TransitionMoveInR}
530
+ */
531
+ cc.TransitionMoveInR.create = function (t, scene) {
532
+ return new cc.TransitionMoveInR(t, scene);
533
+ };
534
+
535
+ /**
536
+ * Move in from to the top the incoming scene.
537
+ * @class
538
+ * @extends cc.TransitionMoveInL
539
+ * @param {Number} t time in seconds
540
+ * @param {cc.Scene} scene
541
+ * @example
542
+ * var trans = new cc.TransitionMoveInT(time,scene);
543
+ */
544
+ cc.TransitionMoveInT = cc.TransitionMoveInL.extend(/** @lends cc.TransitionMoveInT# */{
545
+ /**
546
+ * Constructor of TransitionMoveInT
547
+ * @param {Number} t time in seconds
548
+ * @param {cc.Scene} scene
549
+ */
550
+ ctor:function (t, scene) {
551
+ cc.TransitionMoveInL.prototype.ctor.call(this);
552
+ scene && this.initWithDuration(t, scene);
553
+ },
554
+ /**
555
+ * init function
556
+ */
557
+ initScenes:function () {
558
+ this._inScene.setPosition(0, cc.director.getWinSize().height);
559
+ }
560
+ });
561
+
562
+ /**
563
+ * Move in from to the top the incoming scene.
564
+ * @deprecated since v3.0,please use new cc.TransitionMoveInT(t, scene) instead
565
+ * @param {Number} t time in seconds
566
+ * @param {cc.Scene} scene
567
+ * @return {cc.TransitionMoveInT}
568
+ */
569
+ cc.TransitionMoveInT.create = function (t, scene) {
570
+ return new cc.TransitionMoveInT(t, scene);
571
+ };
572
+
573
+ /**
574
+ * Move in from to the bottom the incoming scene.
575
+ * @class
576
+ * @extends cc.TransitionMoveInL
577
+ * @param {Number} t time in seconds
578
+ * @param {cc.Scene} scene
579
+ * @example
580
+ * var trans = new cc.TransitionMoveInB(time,scene);
581
+ */
582
+ cc.TransitionMoveInB = cc.TransitionMoveInL.extend(/** @lends cc.TransitionMoveInB# */{
583
+ /**
584
+ * Constructor of TransitionMoveInB
585
+ * @param {Number} t time in seconds
586
+ * @param {cc.Scene} scene
587
+ */
588
+ ctor:function (t, scene) {
589
+ cc.TransitionMoveInL.prototype.ctor.call(this);
590
+ scene && this.initWithDuration(t, scene);
591
+ },
592
+
593
+ /**
594
+ * init function
595
+ */
596
+ initScenes:function () {
597
+ this._inScene.setPosition(0, -cc.director.getWinSize().height);
598
+ }
599
+ });
600
+
601
+ /**
602
+ * create a scene transition that Move in from to the bottom the incoming scene.
603
+ * @deprecated since v3.0,please use new cc.TransitionMoveInB(t, scene) instead
604
+ * @param {Number} t time in seconds
605
+ * @param {cc.Scene} scene
606
+ * @return {cc.TransitionMoveInB}
607
+ */
608
+ cc.TransitionMoveInB.create = function (t, scene) {
609
+ return new cc.TransitionMoveInB(t, scene);
610
+ };
611
+
612
+ /**
613
+ * The adjust factor is needed to prevent issue #442<br/>
614
+ * One solution is to use DONT_RENDER_IN_SUBPIXELS images, but NO<br/>
615
+ * The other issue is that in some transitions (and I don't know why)<br/>
616
+ * the order should be reversed (In in top of Out or vice-versa).
617
+ * @constant
618
+ * @type Number
619
+ */
620
+ cc.ADJUST_FACTOR = 0.5;
621
+
622
+ /**
623
+ * a transition that a new scene is slided from left
624
+ * @class
625
+ * @extends cc.TransitionScene
626
+ * @param {Number} t time in seconds
627
+ * @param {cc.Scene} scene
628
+ * @example
629
+ * var trans = cc.TransitionSlideInL(time,scene);
630
+ */
631
+ cc.TransitionSlideInL = cc.TransitionScene.extend(/** @lends cc.TransitionSlideInL# */{
632
+ /**
633
+ * Constructor of TransitionSlideInL
634
+ * @param {Number} t time in seconds
635
+ * @param {cc.Scene} scene
636
+ */
637
+ ctor:function (t, scene) {
638
+ cc.TransitionScene.prototype.ctor.call(this);
639
+ scene && this.initWithDuration(t, scene);
640
+ },
641
+ _sceneOrder:function () {
642
+ this._isInSceneOnTop = false;
643
+ },
644
+
645
+ /**
646
+ * custom on enter
647
+ */
648
+ onEnter:function () {
649
+ cc.TransitionScene.prototype.onEnter.call(this);
650
+ this.initScenes();
651
+
652
+ var inA = this.action();
653
+ var outA = this.action();
654
+
655
+ var inAction = this.easeActionWithAction(inA);
656
+ var outAction = cc.sequence(this.easeActionWithAction(outA), cc.callFunc(this.finish, this));
657
+ this._inScene.runAction(inAction);
658
+ this._outScene.runAction(outAction);
659
+ },
660
+
661
+ /**
662
+ * initializes the scenes
663
+ */
664
+ initScenes:function () {
665
+ this._inScene.setPosition(-cc.director.getWinSize().width + cc.ADJUST_FACTOR, 0);
666
+ },
667
+ /**
668
+ * returns the action that will be performed by the incomming and outgoing scene
669
+ * @return {cc.MoveBy}
670
+ */
671
+ action:function () {
672
+ return cc.moveBy(this._duration, cc.p(cc.director.getWinSize().width - cc.ADJUST_FACTOR, 0));
673
+ },
674
+
675
+ /**
676
+ * @param {cc.ActionInterval} action
677
+ * @return {*}
678
+ */
679
+ easeActionWithAction:function (action) {
680
+ return new cc.EaseInOut(action, 2.0);
681
+ }
682
+ });
683
+
684
+ /**
685
+ * create a transition that a new scene is slided from left
686
+ * @deprecated since v3.0,please use new cc.TransitionSlideInL(t, scene) instead
687
+ * @param {Number} t time in seconds
688
+ * @param {cc.Scene} scene
689
+ * @return {cc.TransitionSlideInL}
690
+ */
691
+ cc.TransitionSlideInL.create = function (t, scene) {
692
+ return new cc.TransitionSlideInL(t, scene);
693
+ };
694
+
695
+ /**
696
+ * Slide in the incoming scene from the right border.
697
+ * @class
698
+ * @extends cc.TransitionSlideInL
699
+ * @param {Number} t time in seconds
700
+ * @param {cc.Scene} scene
701
+ * @example
702
+ * var trans = new cc.TransitionSlideInR(time,scene);
703
+ */
704
+ cc.TransitionSlideInR = cc.TransitionSlideInL.extend(/** @lends cc.TransitionSlideInR# */{
705
+ /**
706
+ * Constructor of TransitionSlideInR
707
+ * @param {Number} t time in seconds
708
+ * @param {cc.Scene} scene
709
+ */
710
+ ctor:function (t, scene) {
711
+ cc.TransitionSlideInL.prototype.ctor.call(this);
712
+ scene && this.initWithDuration(t, scene);
713
+ },
714
+ _sceneOrder:function () {
715
+ this._isInSceneOnTop = true;
716
+ },
717
+ /**
718
+ * initializes the scenes
719
+ */
720
+ initScenes:function () {
721
+ this._inScene.setPosition(cc.director.getWinSize().width - cc.ADJUST_FACTOR, 0);
722
+ },
723
+ /**
724
+ * returns the action that will be performed by the incomming and outgoing scene
725
+ * @return {cc.MoveBy}
726
+ */
727
+ action:function () {
728
+ return cc.moveBy(this._duration, cc.p(-(cc.director.getWinSize().width - cc.ADJUST_FACTOR), 0));
729
+ }
730
+ });
731
+
732
+ /**
733
+ * create Slide in the incoming scene from the right border.
734
+ * @deprecated since v3.0,please use new cc.TransitionSlideInR(t, scene) instead
735
+ * @param {Number} t time in seconds
736
+ * @param {cc.Scene} scene
737
+ * @return {cc.TransitionSlideInR}
738
+ */
739
+ cc.TransitionSlideInR.create = function (t, scene) {
740
+ return new cc.TransitionSlideInR(t, scene);
741
+ };
742
+
743
+ /**
744
+ * Slide in the incoming scene from the bottom border.
745
+ * @class
746
+ * @extends cc.TransitionSlideInL
747
+ * @param {Number} t time in seconds
748
+ * @param {cc.Scene} scene
749
+ * @example
750
+ * var trans = new cc.TransitionSlideInB(time,scene);
751
+ */
752
+ cc.TransitionSlideInB = cc.TransitionSlideInL.extend(/** @lends cc.TransitionSlideInB# */{
753
+ /**
754
+ * Constructor of TransitionSlideInB
755
+ * @param {Number} t time in seconds
756
+ * @param {cc.Scene} scene
757
+ */
758
+ ctor:function (t, scene) {
759
+ cc.TransitionSlideInL.prototype.ctor.call(this);
760
+ scene && this.initWithDuration(t, scene);
761
+ },
762
+ _sceneOrder:function () {
763
+ this._isInSceneOnTop = false;
764
+ },
765
+
766
+ /**
767
+ * initializes the scenes
768
+ */
769
+ initScenes:function () {
770
+ this._inScene.setPosition(0, -(cc.director.getWinSize().height - cc.ADJUST_FACTOR));
771
+ },
772
+
773
+ /**
774
+ * returns the action that will be performed by the incomming and outgoing scene
775
+ * @return {cc.MoveBy}
776
+ */
777
+ action:function () {
778
+ return cc.moveBy(this._duration, cc.p(0, cc.director.getWinSize().height - cc.ADJUST_FACTOR));
779
+ }
780
+ });
781
+
782
+ /**
783
+ * create a Slide in the incoming scene from the bottom border.
784
+ * @deprecated since v3.0,please use new cc.TransitionSlideInB(t, scene) instead.
785
+ * @param {Number} t time in seconds
786
+ * @param {cc.Scene} scene
787
+ * @return {cc.TransitionSlideInB}
788
+ */
789
+ cc.TransitionSlideInB.create = function (t, scene) {
790
+ return new cc.TransitionSlideInB(t, scene);
791
+ };
792
+
793
+ /**
794
+ * Slide in the incoming scene from the top border.
795
+ * @class
796
+ * @extends cc.TransitionSlideInL
797
+ * @param {Number} t time in seconds
798
+ * @param {cc.Scene} scene
799
+ * @example
800
+ * var trans = new cc.TransitionSlideInT(time,scene);
801
+ */
802
+ cc.TransitionSlideInT = cc.TransitionSlideInL.extend(/** @lends cc.TransitionSlideInT# */{
803
+ /**
804
+ * Constructor of TransitionSlideInT
805
+ * @param {Number} t time in seconds
806
+ * @param {cc.Scene} scene
807
+ */
808
+ ctor:function (t, scene) {
809
+ cc.TransitionSlideInL.prototype.ctor.call(this);
810
+ scene && this.initWithDuration(t, scene);
811
+ },
812
+ _sceneOrder:function () {
813
+ this._isInSceneOnTop = true;
814
+ },
815
+
816
+ /**
817
+ * initializes the scenes
818
+ */
819
+ initScenes:function () {
820
+ this._inScene.setPosition(0, cc.director.getWinSize().height - cc.ADJUST_FACTOR);
821
+ },
822
+
823
+ /**
824
+ * returns the action that will be performed by the incomming and outgoing scene
825
+ * @return {cc.MoveBy}
826
+ */
827
+ action:function () {
828
+ return cc.moveBy(this._duration, cc.p(0, -(cc.director.getWinSize().height - cc.ADJUST_FACTOR)));
829
+ }
830
+ });
831
+
832
+ /**
833
+ * create a Slide in the incoming scene from the top border.
834
+ * @deprecated since v3.0,please use new cc.TransitionSlideInT(t, scene) instead.
835
+ * @param {Number} t time in seconds
836
+ * @param {cc.Scene} scene
837
+ * @return {cc.TransitionSlideInT}
838
+ */
839
+ cc.TransitionSlideInT.create = function (t, scene) {
840
+ return new cc.TransitionSlideInT(t, scene);
841
+ };
842
+
843
+ /**
844
+ * Shrink the outgoing scene while grow the incoming scene
845
+ * @class
846
+ * @extends cc.TransitionScene
847
+ * @param {Number} t time in seconds
848
+ * @param {cc.Scene} scene
849
+ * @example
850
+ * var trans = new cc.TransitionShrinkGrow(time,scene);
851
+ */
852
+ cc.TransitionShrinkGrow = cc.TransitionScene.extend(/** @lends cc.TransitionShrinkGrow# */{
853
+ /**
854
+ * Constructor of TransitionShrinkGrow
855
+ * @param {Number} t time in seconds
856
+ * @param {cc.Scene} scene
857
+ */
858
+ ctor:function (t, scene) {
859
+ cc.TransitionScene.prototype.ctor.call(this);
860
+ scene && this.initWithDuration(t, scene);
861
+ },
862
+ /**
863
+ * Custom on enter
864
+ */
865
+ onEnter:function () {
866
+ cc.TransitionScene.prototype.onEnter.call(this);
867
+
868
+ this._inScene.attr({
869
+ scale: 0.001,
870
+ anchorX: 2 / 3.0,
871
+ anchorY: 0.5
872
+ });
873
+ this._outScene.attr({
874
+ scale: 1.0,
875
+ anchorX: 1 / 3.0,
876
+ anchorY: 0.5
877
+ });
878
+
879
+ var scaleOut = cc.scaleTo(this._duration, 0.01);
880
+ var scaleIn = cc.scaleTo(this._duration, 1.0);
881
+
882
+ this._inScene.runAction(this.easeActionWithAction(scaleIn));
883
+ this._outScene.runAction(
884
+ cc.sequence(this.easeActionWithAction(scaleOut), cc.callFunc(this.finish, this))
885
+ );
886
+ },
887
+
888
+ /**
889
+ * @param action
890
+ * @return {cc.EaseOut}
891
+ */
892
+ easeActionWithAction:function (action) {
893
+ return new cc.EaseOut(action, 2.0);
894
+ }
895
+ });
896
+
897
+ /**
898
+ * Shrink the outgoing scene while grow the incoming scene
899
+ * @deprecated since v3.0,please use new cc.TransitionShrinkGrow(t, scene) instead.
900
+ * @param {Number} t time in seconds
901
+ * @param {cc.Scene} scene
902
+ * @return {cc.TransitionShrinkGrow}
903
+ */
904
+ cc.TransitionShrinkGrow.create = function (t, scene) {
905
+ return new cc.TransitionShrinkGrow(t, scene);
906
+ };
907
+
908
+ /**
909
+ * Flips the screen horizontally.<br/>
910
+ * The front face is the outgoing scene and the back face is the incoming scene.
911
+ * @class
912
+ * @extends cc.TransitionSceneOriented
913
+ * @param {Number} t time in seconds
914
+ * @param {cc.Scene} scene
915
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
916
+ * @example
917
+ * var trans = new cc.TransitionFlipX(t,scene,o);
918
+ */
919
+ cc.TransitionFlipX = cc.TransitionSceneOriented.extend(/** @lends cc.TransitionFlipX# */{
920
+ /**
921
+ * Constructor of TransitionFlipX
922
+ * @function
923
+ * @param {Number} t time in seconds
924
+ * @param {cc.Scene} scene
925
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
926
+ */
927
+ ctor:function (t, scene, o) {
928
+ cc.TransitionSceneOriented.prototype.ctor.call(this);
929
+ if(o == null)
930
+ o = cc.TRANSITION_ORIENTATION_RIGHT_OVER;
931
+ scene && this.initWithDuration(t, scene, o);
932
+ },
933
+
934
+ /**
935
+ * custom on enter
936
+ */
937
+ onEnter:function () {
938
+ cc.TransitionScene.prototype.onEnter.call(this);
939
+
940
+ var inA, outA;
941
+ this._inScene.visible = false;
942
+
943
+ var inDeltaZ, inAngleZ, outDeltaZ, outAngleZ;
944
+
945
+ if (this._orientation === cc.TRANSITION_ORIENTATION_RIGHT_OVER) {
946
+ inDeltaZ = 90;
947
+ inAngleZ = 270;
948
+ outDeltaZ = 90;
949
+ outAngleZ = 0;
950
+ } else {
951
+ inDeltaZ = -90;
952
+ inAngleZ = 90;
953
+ outDeltaZ = -90;
954
+ outAngleZ = 0;
955
+ }
956
+
957
+ inA = cc.sequence(
958
+ cc.delayTime(this._duration / 2), cc.show(),
959
+ cc.orbitCamera(this._duration / 2, 1, 0, inAngleZ, inDeltaZ, 0, 0),
960
+ cc.callFunc(this.finish, this)
961
+ );
962
+
963
+ outA = cc.sequence(
964
+ cc.orbitCamera(this._duration / 2, 1, 0, outAngleZ, outDeltaZ, 0, 0),
965
+ cc.hide(), cc.delayTime(this._duration / 2)
966
+ );
967
+
968
+ this._inScene.runAction(inA);
969
+ this._outScene.runAction(outA);
970
+ }
971
+ });
972
+
973
+ /**
974
+ * Flips the screen horizontally.<br/>
975
+ * The front face is the outgoing scene and the back face is the incoming scene.
976
+ * @deprecated since v3.0,please use new cc.TransitionFlipX(t, scene,o) instead.
977
+ * @param {Number} t time in seconds
978
+ * @param {cc.Scene} scene
979
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
980
+ * @return {cc.TransitionFlipX}
981
+ */
982
+ cc.TransitionFlipX.create = function (t, scene, o) {
983
+ return new cc.TransitionFlipX(t, scene, o);
984
+ };
985
+
986
+ /**
987
+ * Flips the screen vertically.<br/>
988
+ * The front face is the outgoing scene and the back face is the incoming scene.
989
+ * @class
990
+ * @extends cc.TransitionSceneOriented
991
+ * @param {Number} t time in seconds
992
+ * @param {cc.Scene} scene
993
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
994
+ * @example
995
+ * var trans = new cc.TransitionFlipY(time,scene,0);
996
+ */
997
+ cc.TransitionFlipY = cc.TransitionSceneOriented.extend(/** @lends cc.TransitionFlipY# */{
998
+
999
+ /**
1000
+ * Constructor of TransitionFlipY
1001
+ * @param {Number} t time in seconds
1002
+ * @param {cc.Scene} scene
1003
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1004
+ */
1005
+ ctor:function (t, scene, o) {
1006
+ cc.TransitionSceneOriented.prototype.ctor.call(this);
1007
+ if(o == null)
1008
+ o = cc.TRANSITION_ORIENTATION_UP_OVER;
1009
+ scene && this.initWithDuration(t, scene, o);
1010
+ },
1011
+ /**
1012
+ * custom on enter
1013
+ */
1014
+ onEnter:function () {
1015
+ cc.TransitionScene.prototype.onEnter.call(this);
1016
+
1017
+ var inA, outA;
1018
+ this._inScene.visible = false;
1019
+
1020
+ var inDeltaZ, inAngleZ, outDeltaZ, outAngleZ;
1021
+
1022
+ if (this._orientation == cc.TRANSITION_ORIENTATION_UP_OVER) {
1023
+ inDeltaZ = 90;
1024
+ inAngleZ = 270;
1025
+ outDeltaZ = 90;
1026
+ outAngleZ = 0;
1027
+ } else {
1028
+ inDeltaZ = -90;
1029
+ inAngleZ = 90;
1030
+ outDeltaZ = -90;
1031
+ outAngleZ = 0;
1032
+ }
1033
+
1034
+ inA = cc.sequence(
1035
+ cc.delayTime(this._duration / 2), cc.show(),
1036
+ cc.orbitCamera(this._duration / 2, 1, 0, inAngleZ, inDeltaZ, 90, 0),
1037
+ cc.callFunc(this.finish, this)
1038
+ );
1039
+ outA = cc.sequence(
1040
+ cc.orbitCamera(this._duration / 2, 1, 0, outAngleZ, outDeltaZ, 90, 0),
1041
+ cc.hide(), cc.delayTime(this._duration / 2)
1042
+ );
1043
+
1044
+ this._inScene.runAction(inA);
1045
+ this._outScene.runAction(outA);
1046
+ }
1047
+ });
1048
+
1049
+ /**
1050
+ * Flips the screen vertically.<br/>
1051
+ * The front face is the outgoing scene and the back face is the incoming scene.
1052
+ * @deprecated since v3.0,please use new cc.TransitionFlipY(t, scene,o) instead.
1053
+ * @param {Number} t time in seconds
1054
+ * @param {cc.Scene} scene
1055
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1056
+ * @return {cc.TransitionFlipY}
1057
+ */
1058
+ cc.TransitionFlipY.create = function (t, scene, o) {
1059
+ return new cc.TransitionFlipY(t, scene, o);
1060
+ };
1061
+
1062
+ /**
1063
+ * Flips the screen half horizontally and half vertically.<br/>
1064
+ * The front face is the outgoing scene and the back face is the incoming scene.
1065
+ * @class
1066
+ * @extends cc.TransitionSceneOriented
1067
+ * @param {Number} t time in seconds
1068
+ * @param {cc.Scene} scene
1069
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1070
+ * @example
1071
+ * var trans = cc.TransitionFlipAngular(time,scene,o);
1072
+ */
1073
+ cc.TransitionFlipAngular = cc.TransitionSceneOriented.extend(/** @lends cc.TransitionFlipAngular# */{
1074
+ /**
1075
+ * Constructor of TransitionFlipAngular
1076
+ * @param {Number} t time in seconds
1077
+ * @param {cc.Scene} scene
1078
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1079
+ */
1080
+ ctor:function (t, scene, o) {
1081
+ cc.TransitionSceneOriented.prototype.ctor.call(this);
1082
+ if(o == null)
1083
+ o = cc.TRANSITION_ORIENTATION_RIGHT_OVER;
1084
+ scene && this.initWithDuration(t, scene, o);
1085
+ },
1086
+ /**
1087
+ * custom on enter
1088
+ */
1089
+ onEnter:function () {
1090
+ cc.TransitionScene.prototype.onEnter.call(this);
1091
+
1092
+ var inA, outA;
1093
+ this._inScene.visible = false;
1094
+
1095
+ var inDeltaZ, inAngleZ, outDeltaZ, outAngleZ;
1096
+
1097
+ if (this._orientation === cc.TRANSITION_ORIENTATION_RIGHT_OVER) {
1098
+ inDeltaZ = 90;
1099
+ inAngleZ = 270;
1100
+ outDeltaZ = 90;
1101
+ outAngleZ = 0;
1102
+ } else {
1103
+ inDeltaZ = -90;
1104
+ inAngleZ = 90;
1105
+ outDeltaZ = -90;
1106
+ outAngleZ = 0;
1107
+ }
1108
+
1109
+ inA = cc.sequence(
1110
+ cc.delayTime(this._duration / 2), cc.show(),
1111
+ cc.orbitCamera(this._duration / 2, 1, 0, inAngleZ, inDeltaZ, -45, 0),
1112
+ cc.callFunc(this.finish, this)
1113
+ );
1114
+ outA = cc.sequence(
1115
+ cc.orbitCamera(this._duration / 2, 1, 0, outAngleZ, outDeltaZ, 45, 0),
1116
+ cc.hide(), cc.delayTime(this._duration / 2)
1117
+ );
1118
+
1119
+ this._inScene.runAction(inA);
1120
+ this._outScene.runAction(outA);
1121
+ }
1122
+ });
1123
+
1124
+ /**
1125
+ * Flips the screen half horizontally and half vertically.<br/>
1126
+ * The front face is the outgoing scene and the back face is the incoming scene.
1127
+ * @deprecated since v3.0,please use new new cc.TransitionFlipAngular(t, scene, o) instead
1128
+ * @param {Number} t time in seconds
1129
+ * @param {cc.Scene} scene
1130
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1131
+ * @return {cc.TransitionFlipAngular}
1132
+ */
1133
+ cc.TransitionFlipAngular.create = function (t, scene, o) {
1134
+ return new cc.TransitionFlipAngular(t, scene, o);
1135
+ };
1136
+
1137
+ /**
1138
+ * Flips the screen horizontally doing a zoom out/in<br/>
1139
+ * The front face is the outgoing scene and the back face is the incoming scene.
1140
+ * @class
1141
+ * @extends cc.TransitionSceneOriented
1142
+ * @param {Number} t time in seconds
1143
+ * @param {cc.Scene} scene
1144
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1145
+ * @example
1146
+ * var trans = new cc.TransitionZoomFlipX(time,scene,o);
1147
+ */
1148
+ cc.TransitionZoomFlipX = cc.TransitionSceneOriented.extend(/** @lends cc.TransitionZoomFlipX# */{
1149
+
1150
+ /**
1151
+ * Constructor of TransitionZoomFlipX
1152
+ * @param {Number} t time in seconds
1153
+ * @param {cc.Scene} scene
1154
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1155
+ */
1156
+ ctor:function (t, scene, o) {
1157
+ cc.TransitionSceneOriented.prototype.ctor.call(this);
1158
+ if(o == null)
1159
+ o = cc.TRANSITION_ORIENTATION_RIGHT_OVER;
1160
+ scene && this.initWithDuration(t, scene, o);
1161
+ },
1162
+ /**
1163
+ * custom on enter
1164
+ */
1165
+ onEnter:function () {
1166
+ cc.TransitionScene.prototype.onEnter.call(this);
1167
+
1168
+ var inA, outA;
1169
+ this._inScene.visible = false;
1170
+
1171
+ var inDeltaZ, inAngleZ, outDeltaZ, outAngleZ;
1172
+
1173
+ if (this._orientation === cc.TRANSITION_ORIENTATION_RIGHT_OVER) {
1174
+ inDeltaZ = 90;
1175
+ inAngleZ = 270;
1176
+ outDeltaZ = 90;
1177
+ outAngleZ = 0;
1178
+ } else {
1179
+ inDeltaZ = -90;
1180
+ inAngleZ = 90;
1181
+ outDeltaZ = -90;
1182
+ outAngleZ = 0;
1183
+ }
1184
+
1185
+ inA = cc.sequence(
1186
+ cc.delayTime(this._duration / 2),
1187
+ cc.spawn(
1188
+ cc.orbitCamera(this._duration / 2, 1, 0, inAngleZ, inDeltaZ, 0, 0),
1189
+ cc.scaleTo(this._duration / 2, 1), cc.show()),
1190
+ cc.callFunc(this.finish, this)
1191
+ );
1192
+ outA = cc.sequence(
1193
+ cc.spawn(
1194
+ cc.orbitCamera(this._duration / 2, 1, 0, outAngleZ, outDeltaZ, 0, 0),
1195
+ cc.scaleTo(this._duration / 2, 0.5)),
1196
+ cc.hide(),
1197
+ cc.delayTime(this._duration / 2)
1198
+ );
1199
+
1200
+ this._inScene.scale = 0.5;
1201
+ this._inScene.runAction(inA);
1202
+ this._outScene.runAction(outA);
1203
+ }
1204
+ });
1205
+
1206
+ /**
1207
+ * Flips the screen horizontally doing a zoom out/in<br/>
1208
+ * The front face is the outgoing scene and the back face is the incoming scene.
1209
+ * @deprecated since v3.0,please use new new cc.TransitionZoomFlipX(t, scene, o) instead
1210
+ * @param {Number} t time in seconds
1211
+ * @param {cc.Scene} scene
1212
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1213
+ * @return {cc.TransitionZoomFlipX}
1214
+ */
1215
+ cc.TransitionZoomFlipX.create = function (t, scene, o) {
1216
+ return new cc.TransitionZoomFlipX(t, scene, o);
1217
+ };
1218
+
1219
+ /**
1220
+ * Flips the screen vertically doing a little zooming out/in<br/>
1221
+ * The front face is the outgoing scene and the back face is the incoming scene.
1222
+ * @class
1223
+ * @extends cc.TransitionSceneOriented
1224
+ * @param {Number} t time in seconds
1225
+ * @param {cc.Scene} scene
1226
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1227
+ * @example
1228
+ * var trans = new cc.TransitionZoomFlipY(t,scene,o);
1229
+ */
1230
+ cc.TransitionZoomFlipY = cc.TransitionSceneOriented.extend(/** @lends cc.TransitionZoomFlipY# */{
1231
+
1232
+ /**
1233
+ * Constructor of TransitionZoomFlipY
1234
+ * @param {Number} t time in seconds
1235
+ * @param {cc.Scene} scene
1236
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1237
+ */
1238
+ ctor:function (t, scene, o) {
1239
+ cc.TransitionSceneOriented.prototype.ctor.call(this);
1240
+ if(o == null)
1241
+ o = cc.TRANSITION_ORIENTATION_UP_OVER;
1242
+ scene && this.initWithDuration(t, scene, o);
1243
+ },
1244
+ /**
1245
+ * custom on enter
1246
+ */
1247
+ onEnter:function () {
1248
+ cc.TransitionScene.prototype.onEnter.call(this);
1249
+
1250
+ var inA, outA;
1251
+ this._inScene.visible = false;
1252
+
1253
+ var inDeltaZ, inAngleZ, outDeltaZ, outAngleZ;
1254
+
1255
+ if (this._orientation === cc.TRANSITION_ORIENTATION_UP_OVER) {
1256
+ inDeltaZ = 90;
1257
+ inAngleZ = 270;
1258
+ outDeltaZ = 90;
1259
+ outAngleZ = 0;
1260
+ } else {
1261
+ inDeltaZ = -90;
1262
+ inAngleZ = 90;
1263
+ outDeltaZ = -90;
1264
+ outAngleZ = 0;
1265
+ }
1266
+
1267
+ inA = cc.sequence(
1268
+ cc.delayTime(this._duration / 2),
1269
+ cc.spawn(
1270
+ cc.orbitCamera(this._duration / 2, 1, 0, inAngleZ, inDeltaZ, 90, 0),
1271
+ cc.scaleTo(this._duration / 2, 1), cc.show()),
1272
+ cc.callFunc(this.finish, this));
1273
+
1274
+ outA = cc.sequence(
1275
+ cc.spawn(
1276
+ cc.orbitCamera(this._duration / 2, 1, 0, outAngleZ, outDeltaZ, 90, 0),
1277
+ cc.scaleTo(this._duration / 2, 0.5)),
1278
+ cc.hide(), cc.delayTime(this._duration / 2));
1279
+
1280
+ this._inScene.scale = 0.5;
1281
+ this._inScene.runAction(inA);
1282
+ this._outScene.runAction(outA);
1283
+ }
1284
+ });
1285
+
1286
+ /**
1287
+ * Flips the screen vertically doing a little zooming out/in<br/>
1288
+ * The front face is the outgoing scene and the back face is the incoming scene.
1289
+ * @deprecated since v3.0,please use new new cc.TransitionZoomFlipY(t, scene, o) instead
1290
+ * @param {Number} t time in seconds
1291
+ * @param {cc.Scene} scene
1292
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1293
+ * @return {cc.TransitionZoomFlipY}
1294
+ */
1295
+ cc.TransitionZoomFlipY.create = function (t, scene, o) {
1296
+ return new cc.TransitionZoomFlipY(t, scene, o);
1297
+ };
1298
+
1299
+ /**
1300
+ * Flips the screen half horizontally and half vertically doing a little zooming out/in.<br/>
1301
+ * The front face is the outgoing scene and the back face is the incoming scene.
1302
+ * @class
1303
+ * @extends cc.TransitionSceneOriented
1304
+ * @param {Number} t time in seconds
1305
+ * @param {cc.Scene} scene
1306
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1307
+ * @example
1308
+ * var trans = new cc.TransitionZoomFlipAngular(time,scene,o);
1309
+ */
1310
+ cc.TransitionZoomFlipAngular = cc.TransitionSceneOriented.extend(/** @lends cc.TransitionZoomFlipAngular# */{
1311
+
1312
+ /**
1313
+ * Constructor of TransitionZoomFlipAngular
1314
+ * @param {Number} t time in seconds
1315
+ * @param {cc.Scene} scene
1316
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1317
+ */
1318
+ ctor:function (t, scene, o) {
1319
+ cc.TransitionSceneOriented.prototype.ctor.call(this);
1320
+ if(o == null)
1321
+ o = cc.TRANSITION_ORIENTATION_RIGHT_OVER;
1322
+ scene && this.initWithDuration(t, scene, o);
1323
+ },
1324
+ /**
1325
+ * custom on enter
1326
+ */
1327
+ onEnter:function () {
1328
+ cc.TransitionScene.prototype.onEnter.call(this);
1329
+
1330
+ var inA, outA;
1331
+ this._inScene.visible = false;
1332
+
1333
+ var inDeltaZ, inAngleZ, outDeltaZ, outAngleZ;
1334
+ if (this._orientation === cc.TRANSITION_ORIENTATION_RIGHT_OVER) {
1335
+ inDeltaZ = 90;
1336
+ inAngleZ = 270;
1337
+ outDeltaZ = 90;
1338
+ outAngleZ = 0;
1339
+ } else {
1340
+ inDeltaZ = -90;
1341
+ inAngleZ = 90;
1342
+ outDeltaZ = -90;
1343
+ outAngleZ = 0;
1344
+ }
1345
+
1346
+ inA = cc.sequence(
1347
+ cc.delayTime(this._duration / 2),
1348
+ cc.spawn(
1349
+ cc.orbitCamera(this._duration / 2, 1, 0, inAngleZ, inDeltaZ, -45, 0),
1350
+ cc.scaleTo(this._duration / 2, 1), cc.show()),
1351
+ cc.show(),
1352
+ cc.callFunc(this.finish, this));
1353
+ outA = cc.sequence(
1354
+ cc.spawn(
1355
+ cc.orbitCamera(this._duration / 2, 1, 0, outAngleZ, outDeltaZ, 45, 0),
1356
+ cc.scaleTo(this._duration / 2, 0.5)),
1357
+ cc.hide(), cc.delayTime(this._duration / 2));
1358
+
1359
+ this._inScene.scale = 0.5;
1360
+ this._inScene.runAction(inA);
1361
+ this._outScene.runAction(outA);
1362
+ }
1363
+ });
1364
+
1365
+ /**
1366
+ * Flips the screen half horizontally and half vertically doing a little zooming out/in.<br/>
1367
+ * The front face is the outgoing scene and the back face is the incoming scene.
1368
+ * @deprecated since v3.0,please use new new cc.TransitionZoomFlipAngular(t, scene, o) instead
1369
+ * @param {Number} t time in seconds
1370
+ * @param {cc.Scene} scene
1371
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1372
+ * @return {cc.TransitionZoomFlipAngular}
1373
+ */
1374
+ cc.TransitionZoomFlipAngular.create = function (t, scene, o) {
1375
+ return new cc.TransitionZoomFlipAngular(t, scene, o);
1376
+ };
1377
+
1378
+ /**
1379
+ * Fade out the outgoing scene and then fade in the incoming scene.
1380
+ * @class
1381
+ * @extends cc.TransitionScene
1382
+ * @param {Number} t time in seconds
1383
+ * @param {cc.Scene} scene
1384
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1385
+ * @example
1386
+ * var trans = new cc.TransitionFade(time,scene,color)
1387
+ */
1388
+ cc.TransitionFade = cc.TransitionScene.extend(/** @lends cc.TransitionFade# */{
1389
+ _color:null,
1390
+
1391
+ /**
1392
+ * Constructor of TransitionFade
1393
+ * @param {Number} t time in seconds
1394
+ * @param {cc.Scene} scene
1395
+ * @param {cc.TRANSITION_ORIENTATION_LEFT_OVER|cc.TRANSITION_ORIENTATION_RIGHT_OVER|cc.TRANSITION_ORIENTATION_UP_OVER|cc.TRANSITION_ORIENTATION_DOWN_OVER} o
1396
+ */
1397
+ ctor:function (t, scene, color) {
1398
+ cc.TransitionScene.prototype.ctor.call(this);
1399
+ this._color = cc.color();
1400
+ scene && this.initWithDuration(t, scene, color);
1401
+ },
1402
+
1403
+ /**
1404
+ * custom on enter
1405
+ */
1406
+ onEnter:function () {
1407
+ cc.TransitionScene.prototype.onEnter.call(this);
1408
+
1409
+ var l = new cc.LayerColor(this._color);
1410
+ this._inScene.visible = false;
1411
+
1412
+ this.addChild(l, 2, cc.SCENE_FADE);
1413
+ var f = this.getChildByTag(cc.SCENE_FADE);
1414
+
1415
+ var a = cc.sequence(
1416
+ cc.fadeIn(this._duration / 2),
1417
+ cc.callFunc(this.hideOutShowIn, this),
1418
+ cc.fadeOut(this._duration / 2),
1419
+ cc.callFunc(this.finish, this)
1420
+ );
1421
+ f.runAction(a);
1422
+ },
1423
+
1424
+ /**
1425
+ * custom on exit
1426
+ */
1427
+ onExit:function () {
1428
+ cc.TransitionScene.prototype.onExit.call(this);
1429
+ this.removeChildByTag(cc.SCENE_FADE, false);
1430
+ },
1431
+
1432
+ /**
1433
+ * initializes the transition with a duration and with an RGB color
1434
+ * @param {Number} t time in seconds
1435
+ * @param {cc.Scene} scene
1436
+ * @param {cc.Color} color
1437
+ * @return {Boolean}
1438
+ */
1439
+ initWithDuration:function (t, scene, color) {
1440
+ color = color || cc.color.BLACK;
1441
+ if (cc.TransitionScene.prototype.initWithDuration.call(this, t, scene)) {
1442
+ this._color.r = color.r;
1443
+ this._color.g = color.g;
1444
+ this._color.b = color.b;
1445
+ this._color.a = 0;
1446
+ }
1447
+ return true;
1448
+ }
1449
+ });
1450
+
1451
+
1452
+ /**
1453
+ * Fade out the outgoing scene and then fade in the incoming scene.
1454
+ * @deprecated since v3.0,please use new cc.TransitionFade(time,scene,color) instead.
1455
+ * @param {Number} t time in seconds
1456
+ * @param {cc.Scene} scene
1457
+ * @param {cc.Color} color
1458
+ * @return {cc.TransitionFade}
1459
+ */
1460
+ cc.TransitionFade.create = function (t, scene, color) {
1461
+ return new cc.TransitionFade(t, scene, color);
1462
+ };
1463
+
1464
+ /**
1465
+ * Cross fades two scenes using the cc.RenderTexture object.
1466
+ * @class
1467
+ * @extends cc.TransitionScene
1468
+ * @param {Number} t time in seconds
1469
+ * @param {cc.Scene} scene
1470
+ * @example
1471
+ * var trans = new cc.TransitionCrossFade(time,scene);
1472
+ */
1473
+ cc.TransitionCrossFade = cc.TransitionScene.extend(/** @lends cc.TransitionCrossFade# */{
1474
+ /**
1475
+ * Constructor of TransitionCrossFade
1476
+ * @param {Number} t time in seconds
1477
+ * @param {cc.Scene} scene
1478
+ */
1479
+ ctor:function (t, scene) {
1480
+ cc.TransitionScene.prototype.ctor.call(this);
1481
+ scene && this.initWithDuration(t, scene);
1482
+ },
1483
+ /**
1484
+ * custom on enter
1485
+ */
1486
+ onEnter:function () {
1487
+ cc.TransitionScene.prototype.onEnter.call(this);
1488
+
1489
+ // create a transparent color layer
1490
+ // in which we are going to add our rendertextures
1491
+ var color = cc.color(0, 0, 0, 0);
1492
+ var winSize = cc.director.getWinSize();
1493
+ var layer = new cc.LayerColor(color);
1494
+
1495
+ // create the first render texture for inScene
1496
+ var inTexture = new cc.RenderTexture(winSize.width, winSize.height);
1497
+
1498
+ if (null == inTexture)
1499
+ return;
1500
+
1501
+ inTexture.sprite.anchorX = 0.5;
1502
+ inTexture.sprite.anchorY = 0.5;
1503
+ inTexture.attr({
1504
+ x: winSize.width / 2,
1505
+ y: winSize.height / 2,
1506
+ anchorX: 0.5,
1507
+ anchorY: 0.5
1508
+ });
1509
+
1510
+ // render inScene to its texturebuffer
1511
+ inTexture.begin();
1512
+ this._inScene.visit();
1513
+ inTexture.end();
1514
+
1515
+ // create the second render texture for outScene
1516
+ var outTexture = new cc.RenderTexture(winSize.width, winSize.height);
1517
+ outTexture.setPosition(winSize.width / 2, winSize.height / 2);
1518
+ outTexture.sprite.anchorX = outTexture.anchorX = 0.5;
1519
+ outTexture.sprite.anchorY = outTexture.anchorY = 0.5;
1520
+
1521
+ // render outScene to its texturebuffer
1522
+ outTexture.begin();
1523
+ this._outScene.visit();
1524
+ outTexture.end();
1525
+
1526
+ inTexture.sprite.setBlendFunc(cc.ONE, cc.ONE); // inScene will lay on background and will not be used with alpha
1527
+ outTexture.sprite.setBlendFunc(cc.SRC_ALPHA, cc.ONE_MINUS_SRC_ALPHA); // we are going to blend outScene via alpha
1528
+
1529
+ // add render textures to the layer
1530
+ layer.addChild(inTexture);
1531
+ layer.addChild(outTexture);
1532
+
1533
+ // initial opacity:
1534
+ inTexture.sprite.opacity = 255;
1535
+ outTexture.sprite.opacity = 255;
1536
+
1537
+ // create the blend action
1538
+ var layerAction = cc.sequence(
1539
+ cc.fadeTo(this._duration, 0), cc.callFunc(this.hideOutShowIn, this),
1540
+ cc.callFunc(this.finish, this)
1541
+ );
1542
+
1543
+ // run the blend action
1544
+ outTexture.sprite.runAction(layerAction);
1545
+
1546
+ // add the layer (which contains our two rendertextures) to the scene
1547
+ this.addChild(layer, 2, cc.SCENE_FADE);
1548
+ },
1549
+
1550
+ /**
1551
+ * custom on exit
1552
+ */
1553
+ onExit:function () {
1554
+ this.removeChildByTag(cc.SCENE_FADE, false);
1555
+ cc.TransitionScene.prototype.onExit.call(this);
1556
+ },
1557
+
1558
+ /**
1559
+ * stuff gets drawn here
1560
+ */
1561
+ visit:function () {
1562
+ cc.Node.prototype.visit.call(this);
1563
+ },
1564
+
1565
+ /**
1566
+ * overide draw
1567
+ */
1568
+ draw:function () {
1569
+ // override draw since both scenes (textures) are rendered in 1 scene
1570
+ }
1571
+ });
1572
+
1573
+ /**
1574
+ * Cross fades two scenes using the cc.RenderTexture object.
1575
+ * @deprecated since v3.0,please use new cc.TransitionCrossFade(t, scene) instead.
1576
+ * @param {Number} t time in seconds
1577
+ * @param {cc.Scene} scene
1578
+ * @return {cc.TransitionCrossFade}
1579
+ */
1580
+ cc.TransitionCrossFade.create = function (t, scene) {
1581
+ return new cc.TransitionCrossFade(t, scene);
1582
+ };
1583
+
1584
+ /**
1585
+ * Turn off the tiles of the outgoing scene in random order
1586
+ * @class
1587
+ * @extends cc.TransitionScene
1588
+ * @param {Number} t time in seconds
1589
+ * @param {cc.Scene} scene
1590
+ * @example
1591
+ * var trans = new cc.TransitionTurnOffTiles(time,scene);
1592
+ */
1593
+ cc.TransitionTurnOffTiles = cc.TransitionScene.extend(/** @lends cc.TransitionTurnOffTiles# */{
1594
+ _gridProxy: null,
1595
+ /**
1596
+ * Constructor of TransitionCrossFade
1597
+ * @param {Number} t time in seconds
1598
+ * @param {cc.Scene} scene
1599
+ */
1600
+ ctor:function (t, scene) {
1601
+ cc.TransitionScene.prototype.ctor.call(this);
1602
+ this._gridProxy = new cc.NodeGrid();
1603
+ scene && this.initWithDuration(t, scene);
1604
+ },
1605
+
1606
+ _sceneOrder:function () {
1607
+ this._isInSceneOnTop = false;
1608
+ },
1609
+
1610
+ /**
1611
+ * custom on enter
1612
+ */
1613
+ onEnter:function () {
1614
+ cc.TransitionScene.prototype.onEnter.call(this);
1615
+ this._gridProxy.setTarget(this._outScene);
1616
+ this._gridProxy.onEnter();
1617
+
1618
+ var winSize = cc.director.getWinSize();
1619
+ var aspect = winSize.width / winSize.height;
1620
+ var x = 0 | (12 * aspect);
1621
+ var y = 12;
1622
+ var toff = cc.turnOffTiles(this._duration, cc.size(x, y));
1623
+ var action = this.easeActionWithAction(toff);
1624
+ this._gridProxy.runAction(cc.sequence(action, cc.callFunc(this.finish, this), cc.stopGrid()));
1625
+ },
1626
+
1627
+ visit: function(){
1628
+ this._inScene.visit();
1629
+ this._gridProxy.visit();
1630
+ },
1631
+
1632
+ /**
1633
+ * @param {cc.ActionInterval} action
1634
+ * @return {cc.ActionInterval}
1635
+ */
1636
+ easeActionWithAction:function (action) {
1637
+ return action;
1638
+ }
1639
+ });
1640
+
1641
+ /**
1642
+ * Turn off the tiles of the outgoing scene in random order
1643
+ * @deprecated since v3.0,please use new cc.TransitionTurnOffTiles(t, scene) instead.
1644
+ * @param {Number} t time in seconds
1645
+ * @param {cc.Scene} scene
1646
+ * @return {cc.TransitionTurnOffTiles}
1647
+ */
1648
+ cc.TransitionTurnOffTiles.create = function (t, scene) {
1649
+ return new cc.TransitionTurnOffTiles(t, scene);
1650
+ };
1651
+
1652
+ /**
1653
+ * The odd columns goes upwards while the even columns goes downwards.
1654
+ * @class
1655
+ * @extends cc.TransitionScene
1656
+ * @param {Number} t time in seconds
1657
+ * @param {cc.Scene} scene
1658
+ * @example
1659
+ * var trans = new cc.TransitionSplitCols(time,scene);
1660
+ */
1661
+ cc.TransitionSplitCols = cc.TransitionScene.extend(/** @lends cc.TransitionSplitCols# */{
1662
+ _gridProxy: null,
1663
+
1664
+ _switchTargetToInscene: function(){
1665
+ this._gridProxy.setTarget(this._inScene);
1666
+ },
1667
+
1668
+ /**
1669
+ * Constructor of TransitionSplitCols
1670
+ * @param {Number} t time in seconds
1671
+ * @param {cc.Scene} scene
1672
+ */
1673
+ ctor:function (t, scene) {
1674
+ cc.TransitionScene.prototype.ctor.call(this);
1675
+ this._gridProxy = new cc.NodeGrid();
1676
+ scene && this.initWithDuration(t, scene);
1677
+ },
1678
+ /**
1679
+ * custom on enter
1680
+ */
1681
+ onEnter:function () {
1682
+ cc.TransitionScene.prototype.onEnter.call(this);
1683
+ //this._inScene.visible = false;
1684
+ this._gridProxy.setTarget(this._outScene);
1685
+ this._gridProxy.onEnter();
1686
+
1687
+ var split = this.action();
1688
+ var seq = cc.sequence(
1689
+ split, cc.callFunc(this._switchTargetToInscene, this), split.reverse());
1690
+
1691
+ this._gridProxy.runAction(
1692
+ cc.sequence(this.easeActionWithAction(seq), cc.callFunc(this.finish, this), cc.stopGrid())
1693
+ );
1694
+ },
1695
+
1696
+ onExit: function(){
1697
+ this._gridProxy.setTarget(null);
1698
+ this._gridProxy.onExit();
1699
+ cc.TransitionScene.prototype.onExit.call(this);
1700
+ },
1701
+
1702
+ visit: function(){
1703
+ this._gridProxy.visit();
1704
+ },
1705
+
1706
+ /**
1707
+ * @param {cc.ActionInterval} action
1708
+ * @return {cc.EaseInOut}
1709
+ */
1710
+ easeActionWithAction:function (action) {
1711
+ return new cc.EaseInOut(action, 3.0);
1712
+ },
1713
+
1714
+ /**
1715
+ * @return {*}
1716
+ */
1717
+ action:function () {
1718
+ return cc.splitCols(this._duration / 2.0, 3);
1719
+ }
1720
+ });
1721
+
1722
+ /**
1723
+ * The odd columns goes upwards while the even columns goes downwards.
1724
+ * @deprecated since v3.0,please use new cc.TransitionSplitCols(t, scene) instead.
1725
+ * @param {Number} t time in seconds
1726
+ * @param {cc.Scene} scene
1727
+ * @return {cc.TransitionSplitCols}
1728
+ */
1729
+ cc.TransitionSplitCols.create = function (t, scene) {
1730
+ return new cc.TransitionSplitCols(t, scene);
1731
+ };
1732
+
1733
+ /**
1734
+ * The odd rows goes to the left while the even rows goes to the right.
1735
+ * @class
1736
+ * @extends cc.TransitionSplitCols
1737
+ * @param {Number} t time in seconds
1738
+ * @param {cc.Scene} scene
1739
+ * @example
1740
+ * var trans = new cc.TransitionSplitRows(time,scene);
1741
+ */
1742
+ cc.TransitionSplitRows = cc.TransitionSplitCols.extend(/** @lends cc.TransitionSplitRows# */{
1743
+
1744
+ /**
1745
+ * Constructor of TransitionSplitRows
1746
+ * @param {Number} t time in seconds
1747
+ * @param {cc.Scene} scene
1748
+ */
1749
+ ctor:function (t, scene) {
1750
+ cc.TransitionSplitCols.prototype.ctor.call(this);
1751
+ scene && this.initWithDuration(t, scene);
1752
+ },
1753
+ /**
1754
+ * @return {*}
1755
+ */
1756
+ action:function () {
1757
+ return cc.splitRows(this._duration / 2.0, 3);
1758
+ }
1759
+ });
1760
+
1761
+ /**
1762
+ * The odd rows goes to the left while the even rows goes to the right.
1763
+ * @deprecated since v3.0,please use new cc.TransitionSplitRows(t, scene) instead.
1764
+ * @param {Number} t time in seconds
1765
+ * @param {cc.Scene} scene
1766
+ * @return {cc.TransitionSplitRows}
1767
+ */
1768
+ cc.TransitionSplitRows.create = function (t, scene) {
1769
+ return new cc.TransitionSplitRows(t, scene);
1770
+ };
1771
+
1772
+ /**
1773
+ * Fade the tiles of the outgoing scene from the left-bottom corner the to top-right corner.
1774
+ * @class
1775
+ * @extends cc.TransitionScene
1776
+ * @param {Number} t time in seconds
1777
+ * @param {cc.Scene} scene
1778
+ * @example
1779
+ * var trans = new cc.TransitionFadeTR(time,scene);
1780
+ */
1781
+ cc.TransitionFadeTR = cc.TransitionScene.extend(/** @lends cc.TransitionFadeTR# */{
1782
+ _gridProxy: null,
1783
+ /**
1784
+ * Constructor of TransitionFadeTR
1785
+ * @param {Number} t time in seconds
1786
+ * @param {cc.Scene} scene
1787
+ */
1788
+ ctor:function (t, scene) {
1789
+ cc.TransitionScene.prototype.ctor.call(this);
1790
+ this._gridProxy = new cc.NodeGrid();
1791
+ scene && this.initWithDuration(t, scene);
1792
+ },
1793
+ _sceneOrder:function () {
1794
+ this._isInSceneOnTop = false;
1795
+ },
1796
+
1797
+ /**
1798
+ * Custom on enter
1799
+ */
1800
+ onEnter:function () {
1801
+ cc.TransitionScene.prototype.onEnter.call(this);
1802
+
1803
+ this._gridProxy.setTarget(this._outScene);
1804
+ this._gridProxy.onEnter();
1805
+
1806
+ var winSize = cc.director.getWinSize();
1807
+ var aspect = winSize.width / winSize.height;
1808
+ var x = 0 | (12 * aspect);
1809
+ var y = 12;
1810
+
1811
+ var action = this.actionWithSize(cc.size(x, y));
1812
+ this._gridProxy.runAction(
1813
+ cc.sequence(this.easeActionWithAction(action), cc.callFunc(this.finish, this), cc.stopGrid())
1814
+ );
1815
+ },
1816
+
1817
+ visit: function(){
1818
+ this._inScene.visit();
1819
+ this._gridProxy.visit();
1820
+ },
1821
+
1822
+ /**
1823
+ * @param {cc.ActionInterval} action
1824
+ * @return {cc.ActionInterval}
1825
+ */
1826
+ easeActionWithAction:function (action) {
1827
+ return action;
1828
+ },
1829
+
1830
+ /**
1831
+ * @param {cc.Size} size
1832
+ * @return {*}
1833
+ */
1834
+ actionWithSize:function (size) {
1835
+ return cc.fadeOutTRTiles(this._duration, size);
1836
+ }
1837
+ });
1838
+
1839
+ /**
1840
+ * Fade the tiles of the outgoing scene from the left-bottom corner the to top-right corner.
1841
+ * @deprecated since v3.0 please use new cc.TransitionFadeTR(t, scene) instead.
1842
+ * @param {Number} t time in seconds
1843
+ * @param {cc.Scene} scene
1844
+ * @return {cc.TransitionFadeTR}
1845
+ */
1846
+ cc.TransitionFadeTR.create = function (t, scene) {
1847
+ return new cc.TransitionFadeTR(t, scene);
1848
+ };
1849
+
1850
+ /**
1851
+ * Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.
1852
+ * @class
1853
+ * @extends cc.TransitionFadeTR
1854
+ * @param {Number} t time in seconds
1855
+ * @param {cc.Scene} scene
1856
+ * @example
1857
+ * var trans = new cc.TransitionFadeBL(time,scene)
1858
+ */
1859
+ cc.TransitionFadeBL = cc.TransitionFadeTR.extend(/** @lends cc.TransitionFadeBL# */{
1860
+ /**
1861
+ * Constructor of TransitionFadeBL
1862
+ * @param {Number} t time in seconds
1863
+ * @param {cc.Scene} scene
1864
+ */
1865
+ ctor:function (t, scene) {
1866
+ cc.TransitionFadeTR.prototype.ctor.call(this);
1867
+ scene && this.initWithDuration(t, scene);
1868
+ },
1869
+
1870
+ /**
1871
+ * @param {cc.Size} size
1872
+ * @return {*}
1873
+ */
1874
+ actionWithSize:function (size) {
1875
+ return cc.fadeOutBLTiles(this._duration, size);
1876
+ }
1877
+ });
1878
+
1879
+ /**
1880
+ * Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.
1881
+ * @deprecated since v3.0,please use new cc.TransitionFadeBL(t, scene);
1882
+ * @param {Number} t time in seconds
1883
+ * @param {cc.Scene} scene
1884
+ * @return {cc.TransitionFadeBL}
1885
+ */
1886
+ cc.TransitionFadeBL.create = function (t, scene) {
1887
+ return new cc.TransitionFadeBL(t, scene);
1888
+ };
1889
+
1890
+ /**
1891
+ * Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.
1892
+ * @class
1893
+ * @extends cc.TransitionFadeTR
1894
+ * @param {Number} t time in seconds
1895
+ * @param {cc.Scene} scene
1896
+ * @example
1897
+ * var trans = new cc.TransitionFadeUp(time,scene);
1898
+ */
1899
+ cc.TransitionFadeUp = cc.TransitionFadeTR.extend(/** @lends cc.TransitionFadeUp# */{
1900
+
1901
+ /**
1902
+ * Constructor of TransitionFadeUp
1903
+ * @function
1904
+ * @param {Number} t time in seconds
1905
+ * @param {cc.Scene} scene
1906
+ */
1907
+ ctor:function (t, scene) {
1908
+ cc.TransitionFadeTR.prototype.ctor.call(this);
1909
+ scene && this.initWithDuration(t, scene);
1910
+ },
1911
+
1912
+ /**
1913
+ * @param {cc.Size} size
1914
+ * @return {cc.FadeOutUpTiles}
1915
+ */
1916
+ actionWithSize:function (size) {
1917
+ return new cc.FadeOutUpTiles(this._duration, size);
1918
+ }
1919
+ });
1920
+
1921
+ /**
1922
+ * Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.
1923
+ * @deprecated since v3.0,please use new cc.TransitionFadeUp(t, scene) instead.
1924
+ * @param {Number} t time in seconds
1925
+ * @param {cc.Scene} scene
1926
+ * @return {cc.TransitionFadeUp}
1927
+ */
1928
+ cc.TransitionFadeUp.create = function (t, scene) {
1929
+ return new cc.TransitionFadeUp(t, scene);
1930
+ };
1931
+
1932
+ /**
1933
+ * Fade the tiles of the outgoing scene from the top to the bottom.
1934
+ * @class
1935
+ * @extends cc.TransitionFadeTR
1936
+ * @param {Number} t time in seconds
1937
+ * @param {cc.Scene} scene
1938
+ * @example
1939
+ * var trans = new cc.TransitionFadeDown(time,scene);
1940
+ */
1941
+ cc.TransitionFadeDown = cc.TransitionFadeTR.extend(/** @lends cc.TransitionFadeDown# */{
1942
+
1943
+ /**
1944
+ * Constructor of TransitionFadeDown
1945
+ * @param {Number} t time in seconds
1946
+ * @param {cc.Scene} scene
1947
+ */
1948
+ ctor:function (t, scene) {
1949
+ cc.TransitionFadeTR.prototype.ctor.call(this);
1950
+ scene && this.initWithDuration(t, scene);
1951
+ },
1952
+
1953
+ /**
1954
+ * @param {cc.Size} size
1955
+ * @return {*}
1956
+ */
1957
+ actionWithSize:function (size) {
1958
+ return cc.fadeOutDownTiles( this._duration, size);
1959
+ }
1960
+ });
1961
+
1962
+ /**
1963
+ * Fade the tiles of the outgoing scene from the top to the bottom.
1964
+ * @deprecated since v3.0,please use new cc.TransitionFadeDown(t, scene) instead.
1965
+ * @param {Number} t time in seconds
1966
+ * @param {cc.Scene} scene
1967
+ * @return {cc.TransitionFadeDown}
1968
+ */
1969
+ cc.TransitionFadeDown.create = function (t, scene) {
1970
+ return new cc.TransitionFadeDown(t, scene);
1971
+ };