ccb 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
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,1289 @@
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
+ /**
28
+ * cc.ShakyTiles3D action. <br />
29
+ * Reference the test cases (Effects Test)
30
+ * @class
31
+ * @extends cc.TiledGrid3DAction
32
+ * @param {Number} duration
33
+ * @param {cc.Size} gridSize
34
+ * @param {Number} range
35
+ * @param {Boolean} shakeZ
36
+ */
37
+ cc.ShakyTiles3D = cc.TiledGrid3DAction.extend(/** @lends cc.ShakyTiles3D# */{
38
+ _randRange:0,
39
+ _shakeZ:false,
40
+
41
+ /**
42
+ * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function. <br />
43
+ * Creates the action with a range, whether or not to shake Z vertices, a grid size, and duration.
44
+ * @param {Number} duration
45
+ * @param {cc.Size} gridSize
46
+ * @param {Number} range
47
+ * @param {Boolean} shakeZ
48
+ */
49
+ ctor:function (duration, gridSize, range, shakeZ) {
50
+ cc.GridAction.prototype.ctor.call(this);
51
+ shakeZ !== undefined && this.initWithDuration(duration, gridSize, range, shakeZ);
52
+ },
53
+
54
+ /**
55
+ * Initializes the action with a range, whether or not to shake Z vertices, a grid size, and duration.
56
+ * @param {Number} duration
57
+ * @param {cc.Size} gridSize
58
+ * @param {Number} range
59
+ * @param {Boolean} shakeZ
60
+ * @return {Boolean}
61
+ */
62
+ initWithDuration:function (duration, gridSize, range, shakeZ) {
63
+ if (cc.TiledGrid3DAction.prototype.initWithDuration.call(this, duration, gridSize)) {
64
+ this._randRange = range;
65
+ this._shakeZ = shakeZ;
66
+ return true;
67
+ }
68
+ return false;
69
+ },
70
+
71
+ /**
72
+ * Called once per frame. Time is the number of seconds of a frame interval. <br />
73
+ * @param {Number} dt
74
+ */
75
+ update:function (dt) {
76
+ var locGridSize = this._gridSize, locRandRange = this._randRange;
77
+ var locPos = cc.p(0, 0);
78
+ for (var i = 0; i < locGridSize.width; ++i) {
79
+ for (var j = 0; j < locGridSize.height; ++j) {
80
+ locPos.x = i;
81
+ locPos.y = j;
82
+ var coords = this.originalTile(locPos);
83
+
84
+ // X
85
+ coords.bl.x += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
86
+ coords.br.x += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
87
+ coords.tl.x += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
88
+ coords.tr.x += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
89
+
90
+ // Y
91
+ coords.bl.y += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
92
+ coords.br.y += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
93
+ coords.tl.y += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
94
+ coords.tr.y += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
95
+
96
+ if (this._shakeZ) {
97
+ coords.bl.z += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
98
+ coords.br.z += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
99
+ coords.tl.z += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
100
+ coords.tr.z += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
101
+ }
102
+
103
+ this.setTile(locPos, coords);
104
+ }
105
+ }
106
+ }
107
+ });
108
+
109
+ /**
110
+ * Creates the action with a range, whether or not to shake Z vertices, a grid size, and duration. <br />
111
+ * Reference the test cases (Effects Test)
112
+ * @function
113
+ * @param {Number} duration
114
+ * @param {cc.Size} gridSize
115
+ * @param {Number} range
116
+ * @param {Boolean} shakeZ
117
+ * @return {cc.ShakyTiles3D}
118
+ */
119
+ cc.shakyTiles3D = function (duration, gridSize, range, shakeZ) {
120
+ return new cc.ShakyTiles3D(duration, gridSize, range, shakeZ);
121
+ };
122
+
123
+ /**
124
+ * Please use cc.shakyTiles3D instead. <br />
125
+ * creates the action with a range, whether or not to shake Z vertices, a grid size, and duration. <br />
126
+ * Reference the test cases (Effects Test)
127
+ * @param {Number} duration
128
+ * @param {cc.Size} gridSize
129
+ * @param {Number} range
130
+ * @param {Boolean} shakeZ
131
+ * @return {cc.ShakyTiles3D}
132
+ * @static
133
+ * @deprecated since v3.0 <br /> Please use cc.shakyTiles3D instead.
134
+ */
135
+ cc.ShakyTiles3D.create = cc.shakyTiles3D;
136
+
137
+ /**
138
+ * cc.ShatteredTiles3D action. <br />
139
+ * Reference the test cases (Effects Test)
140
+ * @class
141
+ * @extends cc.TiledGrid3DAction
142
+ * @param {Number} duration
143
+ * @param {cc.Size} gridSize
144
+ * @param {Number} range
145
+ * @param {Boolean} shatterZ
146
+ */
147
+ cc.ShatteredTiles3D = cc.TiledGrid3DAction.extend(/** @lends cc.ShatteredTiles3D# */{
148
+ _randRange:0,
149
+ _once:false,
150
+ _shatterZ:false,
151
+
152
+ /**
153
+ * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function. <br />
154
+ * Creates the action with a range, whether of not to shatter Z vertices, a grid size and duration.
155
+ * @param {Number} duration
156
+ * @param {cc.Size} gridSize
157
+ * @param {Number} range
158
+ * @param {Boolean} shatterZ
159
+ */
160
+ ctor:function (duration, gridSize, range, shatterZ) {
161
+ cc.GridAction.prototype.ctor.call(this);
162
+ shatterZ !== undefined && this.initWithDuration(duration, gridSize, range, shatterZ);
163
+ },
164
+
165
+ /**
166
+ * Initializes the action with a range, whether or not to shatter Z vertices, a grid size and duration. <br />
167
+ * @param {Number} duration
168
+ * @param {cc.Size} gridSize
169
+ * @param {Number} range
170
+ * @param {Boolean} shatterZ
171
+ * @return {Boolean}
172
+ */
173
+ initWithDuration:function (duration, gridSize, range, shatterZ) {
174
+ if (cc.TiledGrid3DAction.prototype.initWithDuration.call(this, duration, gridSize)) {
175
+ this._once = false;
176
+ this._randRange = range;
177
+ this._shatterZ = shatterZ;
178
+ return true;
179
+ }
180
+ return false;
181
+ },
182
+
183
+ /**
184
+ * Called once per frame. Time is the number of seconds of a frame interval. <br />
185
+ * @param {Number} dt
186
+ */
187
+ update:function (dt) {
188
+ if (this._once === false) {
189
+ var locGridSize = this._gridSize, locRandRange = this._randRange;
190
+ var coords, locPos = cc.p(0, 0);
191
+ for (var i = 0; i < locGridSize.width; ++i) {
192
+ for (var j = 0; j < locGridSize.height; ++j) {
193
+ locPos.x = i;
194
+ locPos.y = j;
195
+ coords = this.originalTile(locPos);
196
+
197
+ // X
198
+ coords.bl.x += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
199
+ coords.br.x += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
200
+ coords.tl.x += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
201
+ coords.tr.x += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
202
+
203
+ // Y
204
+ coords.bl.y += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
205
+ coords.br.y += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
206
+ coords.tl.y += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
207
+ coords.tr.y += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
208
+
209
+ if (this._shatterZ) {
210
+ coords.bl.z += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
211
+ coords.br.z += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
212
+ coords.tl.z += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
213
+ coords.tr.z += ( cc.rand() % (locRandRange * 2) ) - locRandRange;
214
+ }
215
+ this.setTile(locPos, coords);
216
+ }
217
+ }
218
+ this._once = true;
219
+ }
220
+ }
221
+ });
222
+
223
+ /**
224
+ * Creates the action with a range, whether of not to shatter Z vertices, a grid size and duration. <br />
225
+ * Reference the test cases (Effects Test)
226
+ * @function
227
+ * @param {Number} duration
228
+ * @param {cc.Size} gridSize
229
+ * @param {Number} range
230
+ * @param {Boolean} shatterZ
231
+ * @return {cc.ShatteredTiles3D}
232
+ */
233
+ cc.shatteredTiles3D = function (duration, gridSize, range, shatterZ) {
234
+ return new cc.ShatteredTiles3D(duration, gridSize, range, shatterZ);
235
+ };
236
+
237
+ /**
238
+ * Please use cc.shatteredTiles3D instead. <br />
239
+ * Creates the action with a range, whether of not to shatter Z vertices, a grid size and duration. <br />
240
+ * Reference the test cases (Effects Test)
241
+ * @param {Number} duration
242
+ * @param {cc.Size} gridSize
243
+ * @param {Number} range
244
+ * @param {Boolean} shatterZ
245
+ * @return {cc.ShatteredTiles3D}
246
+ * @static
247
+ * @deprecated since v3.0 <br /> Please use cc.shatteredTiles3D instead.
248
+ */
249
+ cc.ShatteredTiles3D.create = cc.shatteredTiles3D;
250
+
251
+ /**
252
+ * A Tile composed of position, startPosition and delta.
253
+ * @Class
254
+ * @constructor
255
+ * @param {cc.Point} [position=cc.p(0,0)]
256
+ * @param {cc.Point} [startPosition=cc.p(0,0)]
257
+ * @param {cc.Size} [delta=cc.p(0,0)]
258
+ */
259
+ cc.Tile = function (position, startPosition, delta) {
260
+ this.position = position || cc.p(0,0);
261
+ this.startPosition = startPosition || cc.p(0,0);
262
+ this.delta = delta || cc.p(0,0);
263
+ };
264
+
265
+ /**
266
+ * cc.ShuffleTiles action, Shuffle the tiles in random order. <br />
267
+ * Reference the test cases (Effects Test)
268
+ * @class
269
+ * @extends cc.TiledGrid3DAction
270
+ * @param {Number} duration
271
+ * @param {cc.Size} gridSize
272
+ * @param {Number} seed
273
+ */
274
+ cc.ShuffleTiles = cc.TiledGrid3DAction.extend(/** @lends cc.ShuffleTiles# */{
275
+ _seed:0,
276
+ _tilesCount:0,
277
+ _tilesOrder:null,
278
+ _tiles:null,
279
+
280
+ /**
281
+ * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function. <br />
282
+ * Creates the action with a random seed, the grid size and the duration.
283
+ * @param {Number} duration
284
+ * @param {cc.Size} gridSize
285
+ * @param {Number} seed
286
+ */
287
+ ctor:function (duration, gridSize, seed) {
288
+ cc.GridAction.prototype.ctor.call(this);
289
+ this._tilesOrder = [];
290
+ this._tiles = [];
291
+
292
+ seed !== undefined && this.initWithDuration(duration, gridSize, seed);
293
+ },
294
+
295
+ /**
296
+ * Initializes the action with a random seed, the grid size and the duration.
297
+ * @param {Number} duration
298
+ * @param {cc.Size} gridSize
299
+ * @param {Number} seed
300
+ * @return {Boolean}
301
+ */
302
+ initWithDuration:function (duration, gridSize, seed) {
303
+ if (cc.TiledGrid3DAction.prototype.initWithDuration.call(this, duration, gridSize)) {
304
+ this._seed = seed;
305
+ this._tilesOrder.length = 0;
306
+ this._tiles.length = 0;
307
+ return true;
308
+ }
309
+ return false;
310
+ },
311
+
312
+ /**
313
+ * Shuffle
314
+ * @param {Array} array
315
+ * @param {Number} len
316
+ */
317
+ shuffle:function (array, len) {
318
+ for (var i = len - 1; i >= 0; i--) {
319
+ var j = 0 | (cc.rand() % (i + 1));
320
+ var v = array[i];
321
+ array[i] = array[j];
322
+ array[j] = v;
323
+ }
324
+ },
325
+
326
+ /**
327
+ * Get Delta
328
+ * @param {cc.Size} pos
329
+ */
330
+ getDelta:function (pos) {
331
+ var locGridSize = this._gridSize;
332
+ var idx = pos.width * locGridSize.height + pos.height;
333
+ return cc.size(((this._tilesOrder[idx] / locGridSize.height) - pos.width),
334
+ ((this._tilesOrder[idx] % locGridSize.height) - pos.height));
335
+ },
336
+
337
+ /**
338
+ * Place Tile
339
+ * @param {cc.Point} pos
340
+ * @param {cc.Tile} tile
341
+ */
342
+ placeTile:function (pos, tile) {
343
+ var coords = this.originalTile(pos);
344
+
345
+ var step = this.target.grid.getStep();
346
+ var locPosition = tile.position;
347
+ coords.bl.x += (locPosition.x * step.x);
348
+ coords.bl.y += (locPosition.y * step.y);
349
+
350
+ coords.br.x += (locPosition.x * step.x);
351
+ coords.br.y += (locPosition.y * step.y);
352
+
353
+ coords.tl.x += (locPosition.x * step.x);
354
+ coords.tl.y += (locPosition.y * step.y);
355
+
356
+ coords.tr.x += (locPosition.x * step.x);
357
+ coords.tr.y += (locPosition.y * step.y);
358
+
359
+ this.setTile(pos, coords);
360
+ },
361
+
362
+ /**
363
+ * Start with target
364
+ * @param {cc.Node} target
365
+ */
366
+ startWithTarget:function (target) {
367
+ cc.TiledGrid3DAction.prototype.startWithTarget.call(this, target);
368
+ var locGridSize = this._gridSize;
369
+
370
+ this._tilesCount = locGridSize.width * locGridSize.height;
371
+ var locTilesOrder = this._tilesOrder;
372
+ locTilesOrder.length = 0;
373
+
374
+ /**
375
+ * Use k to loop. Because m_nTilesCount is unsigned int,
376
+ * and i is used later for int.
377
+ */
378
+ for (var k = 0; k < this._tilesCount; ++k)
379
+ locTilesOrder[k] = k;
380
+ this.shuffle(locTilesOrder, this._tilesCount);
381
+
382
+ var locTiles = this._tiles ;
383
+ locTiles.length = 0;
384
+ var tileIndex = 0, tempSize = cc.size(0,0);
385
+ for (var i = 0; i < locGridSize.width; ++i) {
386
+ for (var j = 0; j < locGridSize.height; ++j) {
387
+ locTiles[tileIndex] = new cc.Tile();
388
+ locTiles[tileIndex].position = cc.p(i, j);
389
+ locTiles[tileIndex].startPosition = cc.p(i, j);
390
+ tempSize.width = i;
391
+ tempSize.height = j;
392
+ locTiles[tileIndex].delta = this.getDelta(tempSize);
393
+ ++tileIndex;
394
+ }
395
+ }
396
+ },
397
+
398
+ /**
399
+ * Called once per frame. Time is the number of seconds of a frame interval.
400
+ * @param {Number} dt
401
+ */
402
+ update:function (dt) {
403
+ var tileIndex = 0, locGridSize = this._gridSize, locTiles = this._tiles;
404
+ var selTile, locPos = cc.p(0, 0);
405
+ for (var i = 0; i < locGridSize.width; ++i) {
406
+ for (var j = 0; j < locGridSize.height; ++j) {
407
+ locPos.x = i;
408
+ locPos.y = j;
409
+ selTile = locTiles[tileIndex];
410
+ selTile.position.x = selTile.delta.width * dt;
411
+ selTile.position.y = selTile.delta.height * dt;
412
+ this.placeTile(locPos, selTile);
413
+ ++tileIndex;
414
+ }
415
+ }
416
+ }
417
+ });
418
+
419
+ /**
420
+ * Creates the action with a random seed, the grid size and the duration. <br />
421
+ * Reference the test cases (Effects Test)
422
+ * @function
423
+ * @param {Number} duration
424
+ * @param {cc.Size} gridSize
425
+ * @param {Number} seed
426
+ * @return {cc.ShuffleTiles}
427
+ */
428
+ cc.shuffleTiles = function (duration, gridSize, seed) {
429
+ return new cc.ShuffleTiles(duration, gridSize, seed);
430
+ };
431
+
432
+ /**
433
+ * Please use cc.shuffleTiles instead. <br />
434
+ * Creates the action with a random seed, the grid size and the duration. <br />
435
+ * Reference the test cases (Effects Test)
436
+ * @param {Number} duration
437
+ * @param {cc.Size} gridSize
438
+ * @param {Number} seed
439
+ * @return {cc.ShuffleTiles}
440
+ * @static
441
+ * @deprecated since v3.0 <br /> Please use cc.shuffleTiles instead.
442
+ */
443
+ cc.ShuffleTiles.create = cc.shuffleTiles;
444
+
445
+ /**
446
+ * cc.FadeOutTRTiles action. Fades out the tiles in a Top-Right direction. <br />
447
+ * Reference the test cases (Effects Test)
448
+ * @class
449
+ * @extends cc.TiledGrid3DAction
450
+ */
451
+ cc.FadeOutTRTiles = cc.TiledGrid3DAction.extend(/** @lends cc.FadeOutTRTiles# */{
452
+ /**
453
+ * Test function
454
+ * @param {cc.Size} pos
455
+ * @param {Number} time
456
+ */
457
+ testFunc:function (pos, time) {
458
+ var locX = this._gridSize.width * time;
459
+ var locY = this._gridSize.height * time;
460
+ if ((locX + locY) == 0.0)
461
+ return 1.0;
462
+ return Math.pow((pos.width + pos.height) / (locX + locY), 6);
463
+ },
464
+
465
+ /**
466
+ * Turn on Tile
467
+ * @param {cc.Point} pos
468
+ */
469
+ turnOnTile:function (pos) {
470
+ this.setTile(pos, this.originalTile(pos));
471
+ },
472
+
473
+ /**
474
+ * Turn Off Tile
475
+ * @param {cc.Point} pos
476
+ */
477
+ turnOffTile:function (pos) {
478
+ this.setTile(pos, new cc.Quad3());
479
+ },
480
+
481
+ /**
482
+ * Transform tile
483
+ * @param {cc.Point} pos
484
+ * @param {Number} distance
485
+ */
486
+ transformTile:function (pos, distance) {
487
+ var coords = this.originalTile(pos);
488
+ var step = this.target.grid.getStep();
489
+
490
+ coords.bl.x += (step.x / 2) * (1.0 - distance);
491
+ coords.bl.y += (step.y / 2) * (1.0 - distance);
492
+
493
+ coords.br.x -= (step.x / 2) * (1.0 - distance);
494
+ coords.br.y += (step.y / 2) * (1.0 - distance);
495
+
496
+ coords.tl.x += (step.x / 2) * (1.0 - distance);
497
+ coords.tl.y -= (step.y / 2) * (1.0 - distance);
498
+
499
+ coords.tr.x -= (step.x / 2) * (1.0 - distance);
500
+ coords.tr.y -= (step.y / 2) * (1.0 - distance);
501
+
502
+ this.setTile(pos, coords);
503
+ },
504
+
505
+ /**
506
+ * Called once per frame. Time is the number of seconds of a frame interval.
507
+ * @param {Number} dt
508
+ */
509
+ update:function (dt) {
510
+ var locGridSize = this._gridSize;
511
+ var locPos = cc.p(0, 0), locSize = cc.size(0, 0), distance;
512
+ for (var i = 0; i < locGridSize.width; ++i) {
513
+ for (var j = 0; j < locGridSize.height; ++j) {
514
+ locPos.x = i;
515
+ locPos.y = j;
516
+ locSize.width = i;
517
+ locSize.height = j;
518
+ distance = this.testFunc(locSize, dt);
519
+ if (distance == 0)
520
+ this.turnOffTile(locPos);
521
+ else if (distance < 1)
522
+ this.transformTile(locPos, distance);
523
+ else
524
+ this.turnOnTile(locPos);
525
+ }
526
+ }
527
+ }
528
+ });
529
+
530
+ /**
531
+ * Creates the action with the grid size and the duration. <br />
532
+ * Reference the test cases (Effects Test)
533
+ * @function
534
+ * @param duration
535
+ * @param gridSize
536
+ * @return {cc.FadeOutTRTiles}
537
+ */
538
+ cc.fadeOutTRTiles = function (duration, gridSize) {
539
+ return new cc.FadeOutTRTiles(duration, gridSize);
540
+ };
541
+
542
+ /**
543
+ * Please use cc.fadeOutTRTiles instead. <br />
544
+ * Creates the action with the grid size and the duration. <br />
545
+ * Reference the test cases (Effects Test)
546
+ * @param duration
547
+ * @param gridSize
548
+ * @return {cc.FadeOutTRTiles}
549
+ * @static
550
+ * @deprecated since v3.0 <br /> Please use cc.fadeOutTRTiles instead.
551
+ */
552
+ cc.FadeOutTRTiles.create = cc.fadeOutTRTiles;
553
+
554
+ /**
555
+ * cc.FadeOutBLTiles action. Fades out the tiles in a Bottom-Left direction. <br />
556
+ * Reference the test cases (Effects Test)
557
+ * @class
558
+ * @extends cc.FadeOutTRTiles
559
+ */
560
+ cc.FadeOutBLTiles = cc.FadeOutTRTiles.extend(/** @lends cc.FadeOutBLTiles# */{
561
+ /**
562
+ * Test function
563
+ * @param {cc.Size} pos
564
+ * @param {Number} time
565
+ */
566
+ testFunc:function (pos, time) {
567
+ var locX = this._gridSize.width * (1.0 - time);
568
+ var locY = this._gridSize.height * (1.0 - time);
569
+ if ((pos.width + pos.height) == 0)
570
+ return 1.0;
571
+
572
+ return Math.pow((locX + locY) / (pos.width + pos.height), 6);
573
+ }
574
+ });
575
+
576
+ /**
577
+ * Creates the action with the grid size and the duration. <br />
578
+ * Reference the test cases (Effects Test)
579
+ * @function
580
+ * @param duration
581
+ * @param gridSize
582
+ * @return {cc.FadeOutBLTiles}
583
+ */
584
+ cc.fadeOutBLTiles = function (duration, gridSize) {
585
+ return new cc.FadeOutBLTiles(duration, gridSize);
586
+ };
587
+
588
+ /**
589
+ * Please use cc.fadeOutBLTiles instead. <br />
590
+ * Creates the action with the grid size and the duration. <br />
591
+ * Reference the test cases (Effects Test)
592
+ * @param duration
593
+ * @param gridSize
594
+ * @return {cc.FadeOutBLTiles}
595
+ * @static
596
+ * @deprecated since v3.0 <br /> Please use cc.fadeOutBLTiles instead.
597
+ */
598
+ cc.FadeOutBLTiles.create = cc.fadeOutBLTiles;
599
+
600
+ /**
601
+ * cc.FadeOutUpTiles action. Fades out the tiles in upwards direction. <br />
602
+ * Reference the test cases (Effects Test)
603
+ * @class
604
+ * @extends cc.FadeOutTRTiles
605
+ */
606
+ cc.FadeOutUpTiles = cc.FadeOutTRTiles.extend(/** @lends cc.FadeOutUpTiles# */{
607
+ testFunc:function (pos, time) {
608
+ var locY = this._gridSize.height * time;
609
+ if (locY == 0.0)
610
+ return 1.0;
611
+ return Math.pow(pos.height / locY, 6);
612
+ },
613
+
614
+ transformTile:function (pos, distance) {
615
+ var coords = this.originalTile(pos);
616
+ var step = this.target.grid.getStep();
617
+
618
+ coords.bl.y += (step.y / 2) * (1.0 - distance);
619
+ coords.br.y += (step.y / 2) * (1.0 - distance);
620
+ coords.tl.y -= (step.y / 2) * (1.0 - distance);
621
+ coords.tr.y -= (step.y / 2) * (1.0 - distance);
622
+
623
+ this.setTile(pos, coords);
624
+ }
625
+ });
626
+
627
+ /**
628
+ * Creates the action with the grid size and the duration. <br />
629
+ * Reference the test cases (Effects Test)
630
+ * @function
631
+ * @param {Number} duration
632
+ * @param {cc.Size} gridSize
633
+ * @return {cc.FadeOutUpTiles}
634
+ */
635
+ cc.fadeOutUpTiles = function (duration, gridSize) {
636
+ return new cc.FadeOutUpTiles(duration, gridSize);
637
+ };
638
+
639
+ /**
640
+ * Please use cc.fadeOutUpTiles instead. <br />
641
+ * Creates the action with the grid size and the duration. <br />
642
+ * Reference the test cases (Effects Test)
643
+ * @param {Number} duration
644
+ * @param {cc.Size} gridSize
645
+ * @return {cc.FadeOutUpTiles}
646
+ * @static
647
+ * @deprecated since v3.0 <br /> Please use cc.fadeOutUpTiles instead.
648
+ */
649
+ cc.FadeOutUpTiles.create = cc.fadeOutUpTiles;
650
+
651
+ /**
652
+ * cc.FadeOutDownTiles action. Fades out the tiles in downwards direction. <br />
653
+ * Reference the test cases (Effects Test)
654
+ * @class
655
+ * @extends cc.FadeOutUpTiles
656
+ */
657
+ cc.FadeOutDownTiles = cc.FadeOutUpTiles.extend(/** @lends cc.FadeOutDownTiles# */{
658
+ testFunc:function (pos, time) {
659
+ var locY = this._gridSize.height * (1.0 - time);
660
+ if (pos.height == 0)
661
+ return 1.0;
662
+ return Math.pow(locY / pos.height, 6);
663
+ }
664
+ });
665
+
666
+ /**
667
+ * Creates the action with the grid size and the duration. <br />
668
+ * Reference the test cases (Effects Test)
669
+ * @function
670
+ * @param {Number} duration
671
+ * @param {cc.Size} gridSize
672
+ * @return {cc.FadeOutDownTiles}
673
+ */
674
+ cc.fadeOutDownTiles = function (duration, gridSize) {
675
+ return new cc.FadeOutDownTiles(duration, gridSize);
676
+ };
677
+ /**
678
+ * Please use cc.fadeOutDownTiles instead. <br />
679
+ * Creates the action with the grid size and the duration. <br />
680
+ * Reference the test cases (Effects Test)
681
+ * @param {Number} duration
682
+ * @param {cc.Size} gridSize
683
+ * @return {cc.FadeOutDownTiles}
684
+ * @static
685
+ * @deprecated since v3.0 <br /> Please use cc.fadeOutDownTiles instead.
686
+ */
687
+ cc.FadeOutDownTiles.create = cc.fadeOutDownTiles;
688
+
689
+ /**
690
+ * cc.TurnOffTiles action.<br/>
691
+ * Turn off the files in random order. <br />
692
+ * Reference the test cases (Effects Test)
693
+ * @class
694
+ * @extends cc.TiledGrid3DAction
695
+ * @param {Number} duration
696
+ * @param {cc.Size} gridSize
697
+ * @param {Number|Null} [seed=0]
698
+ * @example
699
+ * // turnOffTiles without seed
700
+ * var toff = new cc.TurnOffTiles(this._duration, cc.size(x, y));
701
+ *
702
+ * // turnOffTiles with seed
703
+ * var toff = new cc.TurnOffTiles(this._duration, cc.size(x, y), 0);
704
+ */
705
+ cc.TurnOffTiles = cc.TiledGrid3DAction.extend(/** @lends cc.TurnOffTiles# */{
706
+ _seed:null,
707
+ _tilesCount:0,
708
+ _tilesOrder:null,
709
+
710
+ /**
711
+ * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function. <br />
712
+ * Creates the action with a random seed, the grid size and the duration.
713
+ * @param {Number} duration
714
+ * @param {cc.Size} gridSize
715
+ * @param {Number|Null} [seed=0]
716
+ */
717
+ ctor:function (duration, gridSize, seed) {
718
+ cc.GridAction.prototype.ctor.call(this);
719
+ this._tilesOrder = [];
720
+
721
+ gridSize !== undefined && this.initWithDuration(duration, gridSize, seed);
722
+ },
723
+
724
+ /**
725
+ * Initializes the action with a random seed, the grid size and the duration.
726
+ * @param {Number} duration
727
+ * @param {cc.Size} gridSize
728
+ * @param {Number|Null} [seed=0]
729
+ * @return {Boolean}
730
+ */
731
+ initWithDuration:function (duration, gridSize, seed) {
732
+ if (cc.TiledGrid3DAction.prototype.initWithDuration.call(this, duration, gridSize)) {
733
+ this._seed = seed || 0;
734
+ this._tilesOrder.length = 0;
735
+ return true;
736
+ }
737
+ return false;
738
+ },
739
+
740
+ /**
741
+ * Shuffle
742
+ * @param {Array} array
743
+ * @param {Number} len
744
+ */
745
+ shuffle:function (array, len) {
746
+ for (var i = len - 1; i >= 0; i--) {
747
+ var j = 0 | (cc.rand() % (i + 1));
748
+ var v = array[i];
749
+ array[i] = array[j];
750
+ array[j] = v;
751
+ }
752
+ },
753
+
754
+ /**
755
+ * Turn on tile.
756
+ * @param {cc.Point} pos
757
+ */
758
+ turnOnTile:function (pos) {
759
+ this.setTile(pos, this.originalTile(pos));
760
+ },
761
+
762
+ /**
763
+ * Turn off title.
764
+ * @param {cc.Point} pos
765
+ */
766
+ turnOffTile:function (pos) {
767
+ this.setTile(pos, new cc.Quad3());
768
+ },
769
+
770
+ /**
771
+ * called before the action start. It will also set the target.
772
+ * @param {cc.Node} target
773
+ */
774
+ startWithTarget:function (target) {
775
+ cc.TiledGrid3DAction.prototype.startWithTarget.call(this, target);
776
+
777
+ this._tilesCount = this._gridSize.width * this._gridSize.height;
778
+ var locTilesOrder = this._tilesOrder;
779
+ locTilesOrder.length = 0;
780
+ for (var i = 0; i < this._tilesCount; ++i)
781
+ locTilesOrder[i] = i;
782
+ this.shuffle(locTilesOrder, this._tilesCount);
783
+ },
784
+
785
+ /**
786
+ * Called once per frame. Time is the number of seconds of a frame interval.
787
+ * @param {Number} dt
788
+ */
789
+ update:function (dt) {
790
+ var l = 0 | (dt * this._tilesCount), locGridSize = this._gridSize;
791
+ var t,tilePos = cc.p(0,0), locTilesOrder = this._tilesOrder;
792
+ for (var i = 0; i < this._tilesCount; i++) {
793
+ t = locTilesOrder[i];
794
+ tilePos.x = 0 | (t / locGridSize.height);
795
+ tilePos.y = t % (0 | locGridSize.height);
796
+ if (i < l)
797
+ this.turnOffTile(tilePos);
798
+ else
799
+ this.turnOnTile(tilePos);
800
+ }
801
+ }
802
+ });
803
+
804
+ /**
805
+ * Creates the action with a random seed, the grid size and the duration. <br />
806
+ * Reference the test cases (Effects Test)
807
+ * @function
808
+ * @param {Number} duration
809
+ * @param {cc.Size} gridSize
810
+ * @param {Number|Null} [seed=0]
811
+ * @return {cc.TurnOffTiles}
812
+ * @example
813
+ * // example
814
+ * // turnOffTiles without seed
815
+ * var toff = cc.turnOffTiles(this._duration, cc.size(x, y));
816
+ *
817
+ * // turnOffTiles with seed
818
+ * var toff = cc.turnOffTiles(this._duration, cc.size(x, y), 0);
819
+ */
820
+ cc.turnOffTiles = function (duration, gridSize, seed) {
821
+ return new cc.TurnOffTiles(duration, gridSize, seed);
822
+ };
823
+ /**
824
+ * Please use cc.turnOffTiles instead. <br />
825
+ * Creates the action with a random seed, the grid size and the duration. <br />
826
+ * Reference the test cases (Effects Test)
827
+ * @param {Number} duration
828
+ * @param {cc.Size} gridSize
829
+ * @param {Number|Null} [seed=0]
830
+ * @return {cc.TurnOffTiles}
831
+ * @static
832
+ * @deprecated since v3.0 <br /> Please use cc.turnOffTiles instead.
833
+ */
834
+ cc.TurnOffTiles.create = cc.turnOffTiles;
835
+
836
+ /**
837
+ * cc.WavesTiles3D action. <br />
838
+ * Reference the test cases (Effects Test)
839
+ * @class
840
+ * @extends cc.TiledGrid3DAction
841
+ * @param {Number} duration
842
+ * @param {cc.Size} gridSize
843
+ * @param {Number} waves
844
+ * @param {Number} amplitude
845
+ */
846
+ cc.WavesTiles3D = cc.TiledGrid3DAction.extend(/** @lends cc.WavesTiles3D# */{
847
+ _waves:0,
848
+ _amplitude:0,
849
+ _amplitudeRate:0,
850
+
851
+ /**
852
+ * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function. <br />
853
+ * creates the action with a number of waves, the waves amplitude, the grid size and the duration.
854
+ * @param {Number} duration
855
+ * @param {cc.Size} gridSize
856
+ * @param {Number} waves
857
+ * @param {Number} amplitude
858
+ */
859
+ ctor:function (duration, gridSize, waves, amplitude) {
860
+ cc.GridAction.prototype.ctor.call(this);
861
+ amplitude !== undefined && this.initWithDuration(duration, gridSize, waves, amplitude);
862
+ },
863
+
864
+ /**
865
+ * get amplitude of waves
866
+ * @return {Number}
867
+ */
868
+ getAmplitude:function () {
869
+ return this._amplitude;
870
+ },
871
+
872
+ /**
873
+ * set amplitude of waves
874
+ * @param {Number} amplitude
875
+ */
876
+ setAmplitude:function (amplitude) {
877
+ this._amplitude = amplitude;
878
+ },
879
+
880
+ /**
881
+ * get amplitude rate of waves
882
+ * @return {Number}
883
+ */
884
+ getAmplitudeRate:function () {
885
+ return this._amplitudeRate;
886
+ },
887
+
888
+ /**
889
+ * set amplitude rate of waves
890
+ * @param {Number} amplitudeRate
891
+ */
892
+ setAmplitudeRate:function (amplitudeRate) {
893
+ this._amplitudeRate = amplitudeRate;
894
+ },
895
+
896
+ /**
897
+ * initializes the action with a number of waves, the waves amplitude, the grid size and the duration
898
+ * @param {Number} duration
899
+ * @param {cc.Size} gridSize
900
+ * @param {Number} waves
901
+ * @param {Number} amplitude
902
+ * @return {Boolean}
903
+ */
904
+ initWithDuration:function (duration, gridSize, waves, amplitude) {
905
+ if (cc.TiledGrid3DAction.prototype.initWithDuration.call(this, duration, gridSize)) {
906
+ this._waves = waves;
907
+ this._amplitude = amplitude;
908
+ this._amplitudeRate = 1.0;
909
+ return true;
910
+ }
911
+ return false;
912
+ },
913
+
914
+ /**
915
+ * Called once per frame. Time is the number of seconds of a frame interval.
916
+ * @param {Number} dt
917
+ */
918
+ update:function (dt) {
919
+ var locGridSize = this._gridSize, locWaves = this._waves, locAmplitude = this._amplitude, locAmplitudeRate = this._amplitudeRate;
920
+ var locPos = cc.p(0, 0), coords;
921
+ for (var i = 0; i < locGridSize.width; i++) {
922
+ for (var j = 0; j < locGridSize.height; j++) {
923
+ locPos.x = i;
924
+ locPos.y = j;
925
+ coords = this.originalTile(locPos);
926
+ coords.bl.z = (Math.sin(dt * Math.PI * locWaves * 2 +
927
+ (coords.bl.y + coords.bl.x) * 0.01) * locAmplitude * locAmplitudeRate);
928
+ coords.br.z = coords.bl.z;
929
+ coords.tl.z = coords.bl.z;
930
+ coords.tr.z = coords.bl.z;
931
+ this.setTile(locPos, coords);
932
+ }
933
+ }
934
+ }
935
+ });
936
+
937
+ /**
938
+ * creates the action with a number of waves, the waves amplitude, the grid size and the duration. <br />
939
+ * Reference the test cases (Effects Test)
940
+ * @function
941
+ * @param {Number} duration
942
+ * @param {cc.Size} gridSize
943
+ * @param {Number} waves
944
+ * @param {Number} amplitude
945
+ * @return {cc.WavesTiles3D}
946
+ */
947
+ cc.wavesTiles3D = function (duration, gridSize, waves, amplitude) {
948
+ return new cc.WavesTiles3D(duration, gridSize, waves, amplitude);
949
+ };
950
+ /**
951
+ * Please use cc.wavesTiles3D instead
952
+ * creates the action with a number of waves, the waves amplitude, the grid size and the duration. <br />
953
+ * Reference the test cases (Effects Test)
954
+ * @param {Number} duration
955
+ * @param {cc.Size} gridSize
956
+ * @param {Number} waves
957
+ * @param {Number} amplitude
958
+ * @return {cc.WavesTiles3D}
959
+ * @static
960
+ * @deprecated since v3.0 <br /> Please use cc.wavesTiles3D instead.
961
+ */
962
+ cc.WavesTiles3D.create = cc.wavesTiles3D;
963
+
964
+ /**
965
+ * cc.JumpTiles3D action. A sin function is executed to move the tiles across the Z axis. <br />
966
+ * Reference the test cases (Effects Test)
967
+ * @class
968
+ * @extends cc.TiledGrid3DAction
969
+ * @param {Number} duration
970
+ * @param {cc.Size} gridSize
971
+ * @param {Number} numberOfJumps
972
+ * @param {Number} amplitude
973
+ */
974
+ cc.JumpTiles3D = cc.TiledGrid3DAction.extend(/** @lends cc.JumpTiles3D# */{
975
+ _jumps:0,
976
+ _amplitude:0,
977
+ _amplitudeRate:0,
978
+
979
+ /**
980
+ * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function. <br />
981
+ * creates the action with the number of jumps, the sin amplitude, the grid size and the duration.
982
+ * @param {Number} duration
983
+ * @param {cc.Size} gridSize
984
+ * @param {Number} numberOfJumps
985
+ * @param {Number} amplitude
986
+ */
987
+ ctor:function (duration, gridSize, numberOfJumps, amplitude) {
988
+ cc.GridAction.prototype.ctor.call(this);
989
+ amplitude !== undefined && this.initWithDuration(duration, gridSize, numberOfJumps, amplitude);
990
+ },
991
+
992
+ /**
993
+ * get amplitude of the sin
994
+ * @return {Number}
995
+ */
996
+ getAmplitude:function () {
997
+ return this._amplitude;
998
+ },
999
+
1000
+ /**
1001
+ * set amplitude of the sin
1002
+ * @param {Number} amplitude
1003
+ */
1004
+ setAmplitude:function (amplitude) {
1005
+ this._amplitude = amplitude;
1006
+ },
1007
+
1008
+ /**
1009
+ * get amplitude rate
1010
+ * @return {Number}
1011
+ */
1012
+ getAmplitudeRate:function () {
1013
+ return this._amplitudeRate;
1014
+ },
1015
+
1016
+ /**
1017
+ * set amplitude rate
1018
+ * @param amplitudeRate
1019
+ */
1020
+ setAmplitudeRate:function (amplitudeRate) {
1021
+ this._amplitudeRate = amplitudeRate;
1022
+ },
1023
+
1024
+ /**
1025
+ * initializes the action with the number of jumps, the sin amplitude, the grid size and the duration
1026
+ * @param {Number} duration
1027
+ * @param {cc.Size} gridSize
1028
+ * @param {Number} numberOfJumps
1029
+ * @param {Number} amplitude
1030
+ */
1031
+ initWithDuration:function (duration, gridSize, numberOfJumps, amplitude) {
1032
+ if (cc.TiledGrid3DAction.prototype.initWithDuration.call(this, duration, gridSize)) {
1033
+ this._jumps = numberOfJumps;
1034
+ this._amplitude = amplitude;
1035
+ this._amplitudeRate = 1.0;
1036
+ return true;
1037
+ }
1038
+ return false;
1039
+ },
1040
+
1041
+ /**
1042
+ * Called once per frame. Time is the number of seconds of a frame interval.
1043
+ * @param {Number} dt
1044
+ */
1045
+ update:function (dt) {
1046
+ var sinz = (Math.sin(Math.PI * dt * this._jumps * 2) * this._amplitude * this._amplitudeRate );
1047
+ var sinz2 = (Math.sin(Math.PI * (dt * this._jumps * 2 + 1)) * this._amplitude * this._amplitudeRate );
1048
+
1049
+ var locGridSize = this._gridSize;
1050
+ var locGrid = this.target.grid;
1051
+ var coords, locPos = cc.p(0, 0);
1052
+ for (var i = 0; i < locGridSize.width; i++) {
1053
+ for (var j = 0; j < locGridSize.height; j++) {
1054
+ locPos.x = i;
1055
+ locPos.y = j;
1056
+ //hack for html5
1057
+ //var coords = this.originalTile(cc.p(i, j));
1058
+ coords = locGrid.originalTile(locPos);
1059
+
1060
+ if (((i + j) % 2) == 0) {
1061
+ coords.bl.z += sinz;
1062
+ coords.br.z += sinz;
1063
+ coords.tl.z += sinz;
1064
+ coords.tr.z += sinz;
1065
+ } else {
1066
+ coords.bl.z += sinz2;
1067
+ coords.br.z += sinz2;
1068
+ coords.tl.z += sinz2;
1069
+ coords.tr.z += sinz2;
1070
+ }
1071
+ //hack for html5
1072
+ //this.setTile(cc.p(i, j), coords);
1073
+ locGrid.setTile(locPos, coords);
1074
+ }
1075
+ }
1076
+ }
1077
+ });
1078
+
1079
+ /**
1080
+ * creates the action with the number of jumps, the sin amplitude, the grid size and the duration. <br />
1081
+ * Reference the test cases (Effects Test)
1082
+ * @function
1083
+ * @param {Number} duration
1084
+ * @param {cc.Size} gridSize
1085
+ * @param {Number} numberOfJumps
1086
+ * @param {Number} amplitude
1087
+ * @return {cc.JumpTiles3D}
1088
+ */
1089
+ cc.jumpTiles3D = function (duration, gridSize, numberOfJumps, amplitude) {
1090
+ return new cc.JumpTiles3D(duration, gridSize, numberOfJumps, amplitude);
1091
+ };
1092
+
1093
+ /**
1094
+ * Please use cc.jumpTiles3D instead
1095
+ * creates the action with the number of jumps, the sin amplitude, the grid size and the duration. <br />
1096
+ * Reference the test cases (Effects Test)
1097
+ * @param {Number} duration
1098
+ * @param {cc.Size} gridSize
1099
+ * @param {Number} numberOfJumps
1100
+ * @param {Number} amplitude
1101
+ * @return {cc.JumpTiles3D}
1102
+ * @static
1103
+ * @deprecated since v3.0 <br /> Please use cc.jumpTiles3D instead.
1104
+ */
1105
+ cc.JumpTiles3D.create = cc.jumpTiles3D;
1106
+
1107
+ /**
1108
+ * cc.SplitRows action. <br />
1109
+ * Reference the test cases (Effects Test)
1110
+ * @class
1111
+ * @extends cc.TiledGrid3DAction
1112
+ * @param {Number} duration
1113
+ * @param {Number} rows
1114
+ */
1115
+ cc.SplitRows = cc.TiledGrid3DAction.extend(/** @lends cc.SplitRows# */{
1116
+ _rows:0,
1117
+ _winSize:null,
1118
+
1119
+ /**
1120
+ * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function. <br />
1121
+ * creates the action with the number of rows to split and the duration.
1122
+ * @param {Number} duration
1123
+ * @param {Number} rows
1124
+ */
1125
+ ctor:function (duration, rows) {
1126
+ cc.GridAction.prototype.ctor.call(this);
1127
+ rows !== undefined && this.initWithDuration(duration, rows);
1128
+ },
1129
+
1130
+ /**
1131
+ * initializes the action with the number of rows to split and the duration
1132
+ * @param {Number} duration
1133
+ * @param {Number} rows
1134
+ * @return {Boolean}
1135
+ */
1136
+ initWithDuration:function (duration, rows) {
1137
+ this._rows = rows;
1138
+ return cc.TiledGrid3DAction.prototype.initWithDuration.call(this, duration, cc.size(1, rows));
1139
+ },
1140
+
1141
+ /**
1142
+ * Called once per frame. Time is the number of seconds of a frame interval.
1143
+ * @param {Number} dt
1144
+ */
1145
+ update:function (dt) {
1146
+ var locGridSize = this._gridSize, locWinSizeWidth = this._winSize.width;
1147
+ var coords, direction, locPos = cc.p(0, 0);
1148
+ for (var j = 0; j < locGridSize.height; ++j) {
1149
+ locPos.y = j;
1150
+ coords = this.originalTile(locPos);
1151
+ direction = 1;
1152
+
1153
+ if ((j % 2 ) == 0)
1154
+ direction = -1;
1155
+
1156
+ coords.bl.x += direction * locWinSizeWidth * dt;
1157
+ coords.br.x += direction * locWinSizeWidth * dt;
1158
+ coords.tl.x += direction * locWinSizeWidth * dt;
1159
+ coords.tr.x += direction * locWinSizeWidth * dt;
1160
+
1161
+ this.setTile(locPos, coords);
1162
+ }
1163
+ },
1164
+
1165
+ /**
1166
+ * called before the action start. It will also set the target.
1167
+ * @param {cc.Node} target
1168
+ */
1169
+ startWithTarget:function (target) {
1170
+ cc.TiledGrid3DAction.prototype.startWithTarget.call(this, target);
1171
+ this._winSize = cc.director.getWinSizeInPixels();
1172
+ }
1173
+ });
1174
+
1175
+ /**
1176
+ * creates the action with the number of rows to split and the duration. <br />
1177
+ * Reference the test cases (Effects Test)
1178
+ * @function
1179
+ * @param {Number} duration
1180
+ * @param {Number} rows
1181
+ * @return {cc.SplitRows}
1182
+ */
1183
+ cc.splitRows = function (duration, rows) {
1184
+ return new cc.SplitRows(duration, rows);
1185
+ };
1186
+
1187
+ /**
1188
+ * Please use cc.splitRows instead
1189
+ * creates the action with the number of rows to split and the duration. <br />
1190
+ * Reference the test cases (Effects Test)
1191
+ * @param {Number} duration
1192
+ * @param {Number} rows
1193
+ * @return {cc.SplitRows}
1194
+ * @static
1195
+ * @deprecated since v3.0 <br /> Please use cc.splitRows instead.
1196
+ */
1197
+ cc.SplitRows.create = cc.splitRows;
1198
+
1199
+ /**
1200
+ * cc.SplitCols action. <br />
1201
+ * Reference the test cases (Effects Test)
1202
+ * @class
1203
+ * @extends cc.TiledGrid3DAction
1204
+ * @param {Number} duration
1205
+ * @param {Number} cols
1206
+ */
1207
+ cc.SplitCols = cc.TiledGrid3DAction.extend(/** @lends cc.SplitCols# */{
1208
+ _cols:0,
1209
+ _winSize:null,
1210
+
1211
+ /**
1212
+ * Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function. <br />
1213
+ * Creates the action with the number of columns to split and the duration.
1214
+ * @param {Number} duration
1215
+ * @param {Number} cols
1216
+ */
1217
+ ctor:function (duration, cols) {
1218
+ cc.GridAction.prototype.ctor.call(this);
1219
+ cols !== undefined && this.initWithDuration(duration, cols);
1220
+ },
1221
+ /**
1222
+ * initializes the action with the number of columns to split and the duration
1223
+ * @param {Number} duration
1224
+ * @param {Number} cols
1225
+ * @return {Boolean}
1226
+ */
1227
+ initWithDuration:function (duration, cols) {
1228
+ this._cols = cols;
1229
+ return cc.TiledGrid3DAction.prototype.initWithDuration.call(this, duration, cc.size(cols, 1));
1230
+ },
1231
+
1232
+ /**
1233
+ * Called once per frame. Time is the number of seconds of a frame interval.
1234
+ * @param {Number} dt
1235
+ */
1236
+ update:function (dt) {
1237
+ var locGridSizeWidth = this._gridSize.width, locWinSizeHeight = this._winSize.height;
1238
+ var coords, direction, locPos = cc.p(0, 0);
1239
+ for (var i = 0; i < locGridSizeWidth; ++i) {
1240
+ locPos.x = i;
1241
+ coords = this.originalTile(locPos);
1242
+ direction = 1;
1243
+
1244
+ if ((i % 2 ) == 0)
1245
+ direction = -1;
1246
+
1247
+ coords.bl.y += direction * locWinSizeHeight * dt;
1248
+ coords.br.y += direction * locWinSizeHeight * dt;
1249
+ coords.tl.y += direction * locWinSizeHeight * dt;
1250
+ coords.tr.y += direction * locWinSizeHeight * dt;
1251
+
1252
+ this.setTile(locPos, coords);
1253
+ }
1254
+ cc.renderer.childrenOrderDirty = true;
1255
+ },
1256
+
1257
+ /**
1258
+ * called before the action start. It will also set the target.
1259
+ * @param {cc.Node} target
1260
+ */
1261
+ startWithTarget:function (target) {
1262
+ cc.TiledGrid3DAction.prototype.startWithTarget.call(this, target);
1263
+ this._winSize = cc.director.getWinSizeInPixels();
1264
+ }
1265
+ });
1266
+
1267
+ /**
1268
+ * creates the action with the number of columns to split and the duration. <br />
1269
+ * Reference the test cases (Effects Test)
1270
+ * @function
1271
+ * @param {Number} duration
1272
+ * @param {Number} cols
1273
+ * @return {cc.SplitCols}
1274
+ */
1275
+ cc.splitCols = function (duration, cols) {
1276
+ return new cc.SplitCols(duration, cols);
1277
+ };
1278
+
1279
+ /**
1280
+ * Please use cc.splitCols instead.
1281
+ * creates the action with the number of columns to split and the duration. <br />
1282
+ * Reference the test cases (Effects Test)
1283
+ * @param {Number} duration
1284
+ * @param {Number} cols
1285
+ * @return {cc.SplitCols}
1286
+ * @static
1287
+ * @deprecated since v3.0 <br /> Please use cc.splitCols instead.
1288
+ */
1289
+ cc.SplitCols.create = cc.splitCols;