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,1019 @@
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
+ cc.g_NumberOfDraws = 0;
28
+
29
+ cc.GLToClipTransform = function (transformOut) {
30
+ var projection = new cc.kmMat4();
31
+ cc.kmGLGetMatrix(cc.KM_GL_PROJECTION, projection);
32
+
33
+ var modelview = new cc.kmMat4();
34
+ cc.kmGLGetMatrix(cc.KM_GL_MODELVIEW, modelview);
35
+
36
+ cc.kmMat4Multiply(transformOut, projection, modelview);
37
+ };
38
+ //----------------------------------------------------------------------------------------------------------------------
39
+
40
+ /**
41
+ * <p>
42
+ * ATTENTION: USE cc.director INSTEAD OF cc.Director.<br/>
43
+ * cc.director is a singleton object which manage your game's logic flow.<br/>
44
+ * Since the cc.director is a singleton, you don't need to call any constructor or create functions,<br/>
45
+ * the standard way to use it is by calling:<br/>
46
+ * - cc.director.methodName(); <br/>
47
+ *
48
+ * It creates and handle the main Window and manages how and when to execute the Scenes.<br/>
49
+ * <br/>
50
+ * The cc.director is also responsible for:<br/>
51
+ * - initializing the OpenGL context<br/>
52
+ * - setting the OpenGL pixel format (default on is RGB565)<br/>
53
+ * - setting the OpenGL pixel format (default on is RGB565)<br/>
54
+ * - setting the OpenGL buffer depth (default one is 0-bit)<br/>
55
+ * - setting the projection (default one is 3D)<br/>
56
+ * - setting the orientation (default one is Portrait)<br/>
57
+ * <br/>
58
+ * <br/>
59
+ * The cc.director also sets the default OpenGL context:<br/>
60
+ * - GL_TEXTURE_2D is enabled<br/>
61
+ * - GL_VERTEX_ARRAY is enabled<br/>
62
+ * - GL_COLOR_ARRAY is enabled<br/>
63
+ * - GL_TEXTURE_COORD_ARRAY is enabled<br/>
64
+ * </p>
65
+ * <p>
66
+ * cc.director also synchronizes timers with the refresh rate of the display.<br/>
67
+ * Features and Limitations:<br/>
68
+ * - Scheduled timers & drawing are synchronizes with the refresh rate of the display<br/>
69
+ * - Only supports animation intervals of 1/60 1/30 & 1/15<br/>
70
+ * </p>
71
+ * @class
72
+ * @name cc.Director
73
+ */
74
+ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
75
+ //Variables
76
+ _landscape: false,
77
+ _nextDeltaTimeZero: false,
78
+ _paused: false,
79
+ _purgeDirectorInNextLoop: false,
80
+ _sendCleanupToScene: false,
81
+ _animationInterval: 0.0,
82
+ _oldAnimationInterval: 0.0,
83
+ _projection: 0,
84
+ _accumDt: 0.0,
85
+ _contentScaleFactor: 1.0,
86
+
87
+ _displayStats: false,
88
+ _deltaTime: 0.0,
89
+ _frameRate: 0.0,
90
+
91
+ _FPSLabel: null,
92
+ _SPFLabel: null,
93
+ _drawsLabel: null,
94
+
95
+ _winSizeInPoints: null,
96
+
97
+ _lastUpdate: null,
98
+ _nextScene: null,
99
+ _notificationNode: null,
100
+ _openGLView: null,
101
+ _scenesStack: null,
102
+ _projectionDelegate: null,
103
+ _runningScene: null,
104
+
105
+ _frames: 0,
106
+ _totalFrames: 0,
107
+ _secondsPerFrame: 0,
108
+
109
+ _dirtyRegion: null,
110
+
111
+ _scheduler: null,
112
+ _actionManager: null,
113
+ _eventProjectionChanged: null,
114
+ _eventAfterDraw: null,
115
+ _eventAfterVisit: null,
116
+ _eventAfterUpdate: null,
117
+
118
+ ctor: function () {
119
+ var self = this;
120
+ self._lastUpdate = Date.now();
121
+ cc.eventManager.addCustomListener(cc.game.EVENT_SHOW, function () {
122
+ self._lastUpdate = Date.now();
123
+ });
124
+ },
125
+
126
+ init: function () {
127
+ // scenes
128
+ this._oldAnimationInterval = this._animationInterval = 1.0 / cc.defaultFPS;
129
+ this._scenesStack = [];
130
+ // Set default projection (3D)
131
+ this._projection = cc.Director.PROJECTION_DEFAULT;
132
+ // projection delegate if "Custom" projection is used
133
+ this._projectionDelegate = null;
134
+
135
+ //FPS
136
+ this._accumDt = 0;
137
+ this._frameRate = 0;
138
+ this._displayStats = false;//can remove
139
+ this._totalFrames = this._frames = 0;
140
+ this._lastUpdate = Date.now();
141
+
142
+ //Paused?
143
+ this._paused = false;
144
+
145
+ //purge?
146
+ this._purgeDirectorInNextLoop = false;
147
+
148
+ this._winSizeInPoints = cc.size(0, 0);
149
+
150
+ this._openGLView = null;
151
+ this._contentScaleFactor = 1.0;
152
+
153
+ //scheduler
154
+ this._scheduler = new cc.Scheduler();
155
+ //action manager
156
+ this._actionManager = cc.ActionManager ? new cc.ActionManager() : null;
157
+ this._scheduler.scheduleUpdateForTarget(this._actionManager, cc.Scheduler.PRIORITY_SYSTEM, false);
158
+
159
+ this._eventAfterDraw = new cc.EventCustom(cc.Director.EVENT_AFTER_DRAW);
160
+ this._eventAfterDraw.setUserData(this);
161
+ this._eventAfterVisit = new cc.EventCustom(cc.Director.EVENT_AFTER_VISIT);
162
+ this._eventAfterVisit.setUserData(this);
163
+ this._eventAfterUpdate = new cc.EventCustom(cc.Director.EVENT_AFTER_UPDATE);
164
+ this._eventAfterUpdate.setUserData(this);
165
+ this._eventProjectionChanged = new cc.EventCustom(cc.Director.EVENT_PROJECTION_CHANGED);
166
+ this._eventProjectionChanged.setUserData(this);
167
+
168
+ return true;
169
+ },
170
+
171
+ /**
172
+ * calculates delta time since last time it was called
173
+ */
174
+ calculateDeltaTime: function () {
175
+ var now = Date.now();
176
+
177
+ // new delta time.
178
+ if (this._nextDeltaTimeZero) {
179
+ this._deltaTime = 0;
180
+ this._nextDeltaTimeZero = false;
181
+ } else {
182
+ this._deltaTime = (now - this._lastUpdate) / 1000;
183
+ }
184
+
185
+ if ((cc.game.config[cc.game.CONFIG_KEY.debugMode] > 0) && (this._deltaTime > 0.2))
186
+ this._deltaTime = 1 / 60.0;
187
+
188
+ this._lastUpdate = now;
189
+ },
190
+
191
+ /**
192
+ * Converts a view coordinate to an WebGL coordinate<br/>
193
+ * Useful to convert (multi) touches coordinates to the current layout (portrait or landscape)<br/>
194
+ * Implementation can be found in CCDirectorWebGL
195
+ * @function
196
+ * @param {cc.Point} uiPoint
197
+ * @return {cc.Point}
198
+ */
199
+ convertToGL: null,
200
+
201
+ /**
202
+ * Converts an WebGL coordinate to a view coordinate<br/>
203
+ * Useful to convert node points to window points for calls such as glScissor<br/>
204
+ * Implementation can be found in CCDirectorWebGL
205
+ * @function
206
+ * @param {cc.Point} glPoint
207
+ * @return {cc.Point}
208
+ */
209
+ convertToUI: null,
210
+
211
+ /**
212
+ * Draw the scene. This method is called every frame. Don't call it manually.
213
+ */
214
+ drawScene: function () {
215
+ var renderer = cc.renderer;
216
+ // calculate "global" dt
217
+ this.calculateDeltaTime();
218
+
219
+ //tick before glClear: issue #533
220
+ if (!this._paused) {
221
+ this._scheduler.update(this._deltaTime);
222
+ cc.eventManager.dispatchEvent(this._eventAfterUpdate);
223
+ }
224
+
225
+ this._clear();
226
+
227
+ /* to avoid flickr, nextScene MUST be here: after tick and before draw.
228
+ XXX: Which bug is this one. It seems that it can't be reproduced with v0.9 */
229
+ if (this._nextScene) {
230
+ this.setNextScene();
231
+ }
232
+
233
+ if (this._beforeVisitScene)
234
+ this._beforeVisitScene();
235
+
236
+ // draw the scene
237
+ if (this._runningScene) {
238
+ if (renderer.childrenOrderDirty === true) {
239
+ cc.renderer.clearRenderCommands();
240
+ this._runningScene._renderCmd._curLevel = 0; //level start from 0;
241
+ this._runningScene.visit();
242
+ renderer.resetFlag();
243
+ } else if (renderer.transformDirty() === true)
244
+ renderer.transform();
245
+
246
+ cc.eventManager.dispatchEvent(this._eventAfterVisit);
247
+ }
248
+
249
+ // draw the notifications node
250
+ if (this._notificationNode)
251
+ this._notificationNode.visit();
252
+
253
+ if (this._displayStats)
254
+ this._showStats();
255
+
256
+ if (this._afterVisitScene)
257
+ this._afterVisitScene();
258
+
259
+ renderer.rendering(cc._renderContext);
260
+ cc.eventManager.dispatchEvent(this._eventAfterDraw);
261
+ this._totalFrames++;
262
+
263
+ if (this._displayStats)
264
+ this._calculateMPF();
265
+ },
266
+
267
+ _beforeVisitScene: null,
268
+ _afterVisitScene: null,
269
+
270
+ /**
271
+ * End the life of director in the next frame
272
+ */
273
+ end: function () {
274
+ this._purgeDirectorInNextLoop = true;
275
+ },
276
+
277
+ /**
278
+ * Returns the size in pixels of the surface. It could be different than the screen size.<br/>
279
+ * High-res devices might have a higher surface size than the screen size.
280
+ * @return {Number}
281
+ */
282
+ getContentScaleFactor: function () {
283
+ return this._contentScaleFactor;
284
+ },
285
+
286
+ /**
287
+ * This object will be visited after the main scene is visited.<br/>
288
+ * This object MUST implement the "visit" selector.<br/>
289
+ * Useful to hook a notification object
290
+ * @return {cc.Node}
291
+ */
292
+ getNotificationNode: function () {
293
+ return this._notificationNode;
294
+ },
295
+
296
+ /**
297
+ * Returns the size of the WebGL view in points.<br/>
298
+ * It takes into account any possible rotation (device orientation) of the window
299
+ * @return {cc.Size}
300
+ */
301
+ getWinSize: function () {
302
+ return cc.size(this._winSizeInPoints);
303
+ },
304
+
305
+ /**
306
+ * Returns the size of the OpenGL view in pixels.<br/>
307
+ * It takes into account any possible rotation (device orientation) of the window.<br/>
308
+ * On Mac winSize and winSizeInPixels return the same value.
309
+ * @return {cc.Size}
310
+ */
311
+ getWinSizeInPixels: function () {
312
+ return cc.size(this._winSizeInPoints.width * this._contentScaleFactor, this._winSizeInPoints.height * this._contentScaleFactor);
313
+ },
314
+
315
+ /**
316
+ * getVisibleSize/getVisibleOrigin move to CCDirectorWebGL/CCDirectorCanvas
317
+ * getZEye move to CCDirectorWebGL
318
+ */
319
+
320
+ /**
321
+ * Returns the visible size of the running scene
322
+ * @function
323
+ * @return {cc.Size}
324
+ */
325
+ getVisibleSize: null,
326
+
327
+ /**
328
+ * Returns the visible origin of the running scene
329
+ * @function
330
+ * @return {cc.Point}
331
+ */
332
+ getVisibleOrigin: null,
333
+
334
+ /**
335
+ * Returns the z eye, only available in WebGL mode
336
+ * @function
337
+ * @return {Number}
338
+ */
339
+ getZEye: null,
340
+
341
+ /**
342
+ * Pause the director's ticker
343
+ */
344
+ pause: function () {
345
+ if (this._paused)
346
+ return;
347
+
348
+ this._oldAnimationInterval = this._animationInterval;
349
+ // when paused, don't consume CPU
350
+ this.setAnimationInterval(1 / 4.0);
351
+ this._paused = true;
352
+ },
353
+
354
+ /**
355
+ * Pops out a scene from the queue.<br/>
356
+ * This scene will replace the running one.<br/>
357
+ * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated.<br/>
358
+ * ONLY call it if there is a running scene.
359
+ */
360
+ popScene: function () {
361
+
362
+ cc.assert(this._runningScene, cc._LogInfos.Director_popScene);
363
+
364
+ this._scenesStack.pop();
365
+ var c = this._scenesStack.length;
366
+
367
+ if (c == 0)
368
+ this.end();
369
+ else {
370
+ this._sendCleanupToScene = true;
371
+ this._nextScene = this._scenesStack[c - 1];
372
+ }
373
+ },
374
+
375
+ /**
376
+ * Removes cached all cocos2d cached data. It will purge the cc.textureCache, cc.spriteFrameCache, cc.animationCache
377
+ */
378
+ purgeCachedData: function () {
379
+ cc.animationCache._clear();
380
+ cc.spriteFrameCache._clear();
381
+ cc.textureCache._clear();
382
+ },
383
+
384
+ /**
385
+ * Purge the cc.director itself, including unschedule all schedule, remove all event listeners, clean up and exit the running scene, stops all animations, clear cached data.
386
+ */
387
+ purgeDirector: function () {
388
+ //cleanup scheduler
389
+ this.getScheduler().unscheduleAllCallbacks();
390
+
391
+ // Disable event dispatching
392
+ if (cc.eventManager)
393
+ cc.eventManager.setEnabled(false);
394
+
395
+ // don't release the event handlers
396
+ // They are needed in case the director is run again
397
+
398
+ if (this._runningScene) {
399
+ this._runningScene.onExitTransitionDidStart();
400
+ this._runningScene.onExit();
401
+ this._runningScene.cleanup();
402
+ }
403
+
404
+ this._runningScene = null;
405
+ this._nextScene = null;
406
+
407
+ // remove all objects, but don't release it.
408
+ // runScene might be executed after 'end'.
409
+ this._scenesStack.length = 0;
410
+
411
+ this.stopAnimation();
412
+
413
+ // Clear all caches
414
+ this.purgeCachedData();
415
+
416
+ cc.checkGLErrorDebug();
417
+ },
418
+
419
+ /**
420
+ * Suspends the execution of the running scene, pushing it on the stack of suspended scenes.<br/>
421
+ * The new scene will be executed.<br/>
422
+ * Try to avoid big stacks of pushed scenes to reduce memory allocation.<br/>
423
+ * ONLY call it if there is a running scene.
424
+ * @param {cc.Scene} scene
425
+ */
426
+ pushScene: function (scene) {
427
+
428
+ cc.assert(scene, cc._LogInfos.Director_pushScene);
429
+
430
+ this._sendCleanupToScene = false;
431
+
432
+ this._scenesStack.push(scene);
433
+ this._nextScene = scene;
434
+ },
435
+
436
+ /**
437
+ * Run a scene. Replaces the running scene with a new one or enter the first scene.
438
+ * @param {cc.Scene} scene
439
+ */
440
+ runScene: function (scene) {
441
+
442
+ cc.assert(scene, cc._LogInfos.Director_pushScene);
443
+
444
+ if (!this._runningScene) {
445
+ //start scene
446
+ this.pushScene(scene);
447
+ this.startAnimation();
448
+ } else {
449
+ //replace scene
450
+ var i = this._scenesStack.length;
451
+ if (i === 0) {
452
+ this._sendCleanupToScene = true;
453
+ this._scenesStack[i] = scene;
454
+ this._nextScene = scene;
455
+ } else {
456
+ this._sendCleanupToScene = true;
457
+ this._scenesStack[i - 1] = scene;
458
+ this._nextScene = scene;
459
+ }
460
+ }
461
+ },
462
+
463
+ /**
464
+ * Resume director after pause, if the current scene is not paused, nothing will happen.
465
+ */
466
+ resume: function () {
467
+ if (!this._paused) {
468
+ return;
469
+ }
470
+
471
+ this.setAnimationInterval(this._oldAnimationInterval);
472
+ this._lastUpdate = Date.now();
473
+ if (!this._lastUpdate) {
474
+ cc.log(cc._LogInfos.Director_resume);
475
+ }
476
+
477
+ this._paused = false;
478
+ this._deltaTime = 0;
479
+ },
480
+
481
+ /**
482
+ * The size in pixels of the surface. It could be different than the screen size.<br/>
483
+ * High-res devices might have a higher surface size than the screen size.
484
+ * @param {Number} scaleFactor
485
+ */
486
+ setContentScaleFactor: function (scaleFactor) {
487
+ if (scaleFactor != this._contentScaleFactor) {
488
+ this._contentScaleFactor = scaleFactor;
489
+ this._createStatsLabel();
490
+ }
491
+ },
492
+
493
+ /**
494
+ * Enables or disables WebGL depth test.<br/>
495
+ * Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js
496
+ * @function
497
+ * @param {Boolean} on
498
+ */
499
+ setDepthTest: null,
500
+
501
+ /**
502
+ * Sets the default values based on the CCConfiguration info
503
+ */
504
+ setDefaultValues: function () {
505
+
506
+ },
507
+
508
+ /**
509
+ * Sets whether next delta time equals to zero
510
+ * @param {Boolean} nextDeltaTimeZero
511
+ */
512
+ setNextDeltaTimeZero: function (nextDeltaTimeZero) {
513
+ this._nextDeltaTimeZero = nextDeltaTimeZero;
514
+ },
515
+
516
+ /**
517
+ * Starts the registered next scene
518
+ */
519
+ setNextScene: function () {
520
+ var runningIsTransition = false, newIsTransition = false;
521
+ if (cc.TransitionScene) {
522
+ runningIsTransition = this._runningScene ? this._runningScene instanceof cc.TransitionScene : false;
523
+ newIsTransition = this._nextScene ? this._nextScene instanceof cc.TransitionScene : false;
524
+ }
525
+
526
+ // If it is not a transition, call onExit/cleanup
527
+ if (!newIsTransition) {
528
+ var locRunningScene = this._runningScene;
529
+ if (locRunningScene) {
530
+ locRunningScene.onExitTransitionDidStart();
531
+ locRunningScene.onExit();
532
+ }
533
+
534
+ // issue #709. the root node (scene) should receive the cleanup message too
535
+ // otherwise it might be leaked.
536
+ if (this._sendCleanupToScene && locRunningScene)
537
+ locRunningScene.cleanup();
538
+ }
539
+
540
+ this._runningScene = this._nextScene;
541
+ cc.renderer.childrenOrderDirty = true;
542
+
543
+ this._nextScene = null;
544
+ if ((!runningIsTransition) && (this._runningScene != null)) {
545
+ this._runningScene.onEnter();
546
+ this._runningScene.onEnterTransitionDidFinish();
547
+ }
548
+ },
549
+
550
+ /**
551
+ * Sets Notification Node
552
+ * @param {cc.Node} node
553
+ */
554
+ setNotificationNode: function (node) {
555
+ this._notificationNode = node;
556
+ },
557
+
558
+ /**
559
+ * Returns the cc.director delegate.
560
+ * @return {cc.DirectorDelegate}
561
+ */
562
+ getDelegate: function () {
563
+ return this._projectionDelegate;
564
+ },
565
+
566
+ /**
567
+ * Sets the cc.director delegate. It shall implement the CCDirectorDelegate protocol
568
+ * @return {cc.DirectorDelegate}
569
+ */
570
+ setDelegate: function (delegate) {
571
+ this._projectionDelegate = delegate;
572
+ },
573
+
574
+ /**
575
+ * Sets the view, where everything is rendered, do not call this function.<br/>
576
+ * Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js.
577
+ * @function
578
+ * @param {cc.view} openGLView
579
+ */
580
+ setOpenGLView: null,
581
+
582
+ /**
583
+ * Sets an OpenGL projection.<br/>
584
+ * Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js.
585
+ * @function
586
+ * @param {Number} projection
587
+ */
588
+ setProjection: null,
589
+
590
+ /**
591
+ * Update the view port.<br/>
592
+ * Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js.
593
+ * @function
594
+ */
595
+ setViewport: null,
596
+
597
+ /**
598
+ * Get the CCEGLView, where everything is rendered.<br/>
599
+ * Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js.
600
+ * @function
601
+ * @return {cc.view}
602
+ */
603
+ getOpenGLView: null,
604
+
605
+ /**
606
+ * Sets an OpenGL projection.<br/>
607
+ * Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js.
608
+ * @function
609
+ * @return {Number}
610
+ */
611
+ getProjection: null,
612
+
613
+ /**
614
+ * Enables/disables OpenGL alpha blending.<br/>
615
+ * Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js.
616
+ * @function
617
+ * @param {Boolean} on
618
+ */
619
+ setAlphaBlending: null,
620
+
621
+ _showStats: function () {
622
+ this._frames++;
623
+ this._accumDt += this._deltaTime;
624
+ if (this._FPSLabel && this._SPFLabel && this._drawsLabel) {
625
+ if (this._accumDt > cc.DIRECTOR_FPS_INTERVAL) {
626
+ this._SPFLabel.string = this._secondsPerFrame.toFixed(3);
627
+
628
+ this._frameRate = this._frames / this._accumDt;
629
+ this._frames = 0;
630
+ this._accumDt = 0;
631
+
632
+ this._FPSLabel.string = this._frameRate.toFixed(1);
633
+ this._drawsLabel.string = (0 | cc.g_NumberOfDraws).toString();
634
+ }
635
+ this._FPSLabel.visit();
636
+ this._SPFLabel.visit();
637
+ this._drawsLabel.visit();
638
+ } else
639
+ this._createStatsLabel();
640
+ cc.g_NumberOfDraws = 0;
641
+ },
642
+
643
+ /**
644
+ * Returns whether or not the replaced scene will receive the cleanup message.<br>
645
+ * If the new scene is pushed, then the old scene won't receive the "cleanup" message.<br/>
646
+ * If the new scene replaces the old one, the it will receive the "cleanup" message.
647
+ * @return {Boolean}
648
+ */
649
+ isSendCleanupToScene: function () {
650
+ return this._sendCleanupToScene;
651
+ },
652
+
653
+ /**
654
+ * Returns current running Scene. Director can only run one Scene at the time
655
+ * @return {cc.Scene}
656
+ */
657
+ getRunningScene: function () {
658
+ return this._runningScene;
659
+ },
660
+
661
+ /**
662
+ * Returns the FPS value
663
+ * @return {Number}
664
+ */
665
+ getAnimationInterval: function () {
666
+ return this._animationInterval;
667
+ },
668
+
669
+ /**
670
+ * Returns whether or not to display the FPS informations
671
+ * @return {Boolean}
672
+ */
673
+ isDisplayStats: function () {
674
+ return this._displayStats;
675
+ },
676
+
677
+ /**
678
+ * Sets whether display the FPS on the bottom-left corner
679
+ * @param {Boolean} displayStats
680
+ */
681
+ setDisplayStats: function (displayStats) {
682
+ this._displayStats = displayStats;
683
+ },
684
+
685
+ /**
686
+ * Returns seconds per frame
687
+ * @return {Number}
688
+ */
689
+ getSecondsPerFrame: function () {
690
+ return this._secondsPerFrame;
691
+ },
692
+
693
+ /**
694
+ * Returns whether next delta time equals to zero
695
+ * @return {Boolean}
696
+ */
697
+ isNextDeltaTimeZero: function () {
698
+ return this._nextDeltaTimeZero;
699
+ },
700
+
701
+ /**
702
+ * Returns whether or not the Director is paused
703
+ * @return {Boolean}
704
+ */
705
+ isPaused: function () {
706
+ return this._paused;
707
+ },
708
+
709
+ /**
710
+ * Returns how many frames were called since the director started
711
+ * @return {Number}
712
+ */
713
+ getTotalFrames: function () {
714
+ return this._totalFrames;
715
+ },
716
+
717
+ /**
718
+ * Pops out all scenes from the queue until the root scene in the queue. <br/>
719
+ * This scene will replace the running one. <br/>
720
+ * Internally it will call "popToSceneStackLevel(1)"
721
+ */
722
+ popToRootScene: function () {
723
+ this.popToSceneStackLevel(1);
724
+ },
725
+
726
+ /**
727
+ * Pops out all scenes from the queue until it reaches "level". <br/>
728
+ * If level is 0, it will end the director. <br/>
729
+ * If level is 1, it will pop all scenes until it reaches to root scene. <br/>
730
+ * If level is <= than the current stack level, it won't do anything.
731
+ * @param {Number} level
732
+ */
733
+ popToSceneStackLevel: function (level) {
734
+ cc.assert(this._runningScene, cc._LogInfos.Director_popToSceneStackLevel_2);
735
+
736
+ var locScenesStack = this._scenesStack;
737
+ var c = locScenesStack.length;
738
+
739
+ if (c == 0) {
740
+ this.end();
741
+ return;
742
+ }
743
+ // current level or lower -> nothing
744
+ if (level > c)
745
+ return;
746
+
747
+ // pop stack until reaching desired level
748
+ while (c > level) {
749
+ var current = locScenesStack.pop();
750
+ if (current.running) {
751
+ current.onExitTransitionDidStart();
752
+ current.onExit();
753
+ }
754
+ current.cleanup();
755
+ c--;
756
+ }
757
+ this._nextScene = locScenesStack[locScenesStack.length - 1];
758
+ this._sendCleanupToScene = false;
759
+ },
760
+
761
+ /**
762
+ * Returns the cc.Scheduler associated with this director
763
+ * @return {cc.Scheduler}
764
+ */
765
+ getScheduler: function () {
766
+ return this._scheduler;
767
+ },
768
+
769
+ /**
770
+ * Sets the cc.Scheduler associated with this director
771
+ * @param {cc.Scheduler} scheduler
772
+ */
773
+ setScheduler: function (scheduler) {
774
+ if (this._scheduler != scheduler) {
775
+ this._scheduler = scheduler;
776
+ }
777
+ },
778
+
779
+ /**
780
+ * Returns the cc.ActionManager associated with this director
781
+ * @return {cc.ActionManager}
782
+ */
783
+ getActionManager: function () {
784
+ return this._actionManager;
785
+ },
786
+ /**
787
+ * Sets the cc.ActionManager associated with this director
788
+ * @param {cc.ActionManager} actionManager
789
+ */
790
+ setActionManager: function (actionManager) {
791
+ if (this._actionManager != actionManager) {
792
+ this._actionManager = actionManager;
793
+ }
794
+ },
795
+
796
+ /**
797
+ * Returns the delta time since last frame
798
+ * @return {Number}
799
+ */
800
+ getDeltaTime: function () {
801
+ return this._deltaTime;
802
+ },
803
+
804
+ _createStatsLabel: null,
805
+
806
+ _calculateMPF: function () {
807
+ var now = Date.now();
808
+ this._secondsPerFrame = (now - this._lastUpdate) / 1000;
809
+ }
810
+ });
811
+
812
+ /**
813
+ * The event projection changed of cc.Director
814
+ * @constant
815
+ * @type {string}
816
+ * @example
817
+ * cc.eventManager.addCustomListener(cc.Director.EVENT_PROJECTION_CHANGED, function(event) {
818
+ * cc.log("Projection changed.");
819
+ * });
820
+ */
821
+ cc.Director.EVENT_PROJECTION_CHANGED = "director_projection_changed";
822
+
823
+ /**
824
+ * The event after draw of cc.Director
825
+ * @constant
826
+ * @type {string}
827
+ * @example
828
+ * cc.eventManager.addCustomListener(cc.Director.EVENT_AFTER_DRAW, function(event) {
829
+ * cc.log("after draw event.");
830
+ * });
831
+ */
832
+ cc.Director.EVENT_AFTER_DRAW = "director_after_draw";
833
+
834
+ /**
835
+ * The event after visit of cc.Director
836
+ * @constant
837
+ * @type {string}
838
+ * @example
839
+ * cc.eventManager.addCustomListener(cc.Director.EVENT_AFTER_VISIT, function(event) {
840
+ * cc.log("after visit event.");
841
+ * });
842
+ */
843
+ cc.Director.EVENT_AFTER_VISIT = "director_after_visit";
844
+
845
+ /**
846
+ * The event after update of cc.Director
847
+ * @constant
848
+ * @type {string}
849
+ * @example
850
+ * cc.eventManager.addCustomListener(cc.Director.EVENT_AFTER_UPDATE, function(event) {
851
+ * cc.log("after update event.");
852
+ * });
853
+ */
854
+ cc.Director.EVENT_AFTER_UPDATE = "director_after_update";
855
+
856
+ /***************************************************
857
+ * implementation of DisplayLinkDirector
858
+ **************************************************/
859
+ cc.DisplayLinkDirector = cc.Director.extend(/** @lends cc.Director# */{
860
+ invalid: false,
861
+
862
+ /**
863
+ * Starts Animation
864
+ */
865
+ startAnimation: function () {
866
+ this._nextDeltaTimeZero = true;
867
+ this.invalid = false;
868
+ },
869
+
870
+ /**
871
+ * Run main loop of director
872
+ */
873
+ mainLoop: function () {
874
+ if (this._purgeDirectorInNextLoop) {
875
+ this._purgeDirectorInNextLoop = false;
876
+ this.purgeDirector();
877
+ }
878
+ else if (!this.invalid) {
879
+ this.drawScene();
880
+ }
881
+ },
882
+
883
+ /**
884
+ * Stops animation
885
+ */
886
+ stopAnimation: function () {
887
+ this.invalid = true;
888
+ },
889
+
890
+ /**
891
+ * Sets animation interval
892
+ * @param {Number} value the animation interval desired
893
+ */
894
+ setAnimationInterval: function (value) {
895
+ this._animationInterval = value;
896
+ if (!this.invalid) {
897
+ this.stopAnimation();
898
+ this.startAnimation();
899
+ }
900
+ }
901
+ });
902
+
903
+ cc.Director.sharedDirector = null;
904
+ cc.Director.firstUseDirector = true;
905
+
906
+ cc.Director._getInstance = function () {
907
+ if (cc.Director.firstUseDirector) {
908
+ cc.Director.firstUseDirector = false;
909
+ cc.Director.sharedDirector = new cc.DisplayLinkDirector();
910
+ cc.Director.sharedDirector.init();
911
+ }
912
+ return cc.Director.sharedDirector;
913
+ };
914
+
915
+ /**
916
+ * Default fps is 60
917
+ * @type {Number}
918
+ */
919
+ cc.defaultFPS = 60;
920
+
921
+ //Possible OpenGL projections used by director
922
+ /**
923
+ * Constant for 2D projection (orthogonal projection)
924
+ * @constant
925
+ * @type {Number}
926
+ */
927
+ cc.Director.PROJECTION_2D = 0;
928
+
929
+ /**
930
+ * Constant for 3D projection with a fovy=60, znear=0.5f and zfar=1500.
931
+ * @constant
932
+ * @type {Number}
933
+ */
934
+ cc.Director.PROJECTION_3D = 1;
935
+
936
+ /**
937
+ * Constant for custom projection, if cc.Director's projection set to it, it calls "updateProjection" on the projection delegate.
938
+ * @constant
939
+ * @type {Number}
940
+ */
941
+ cc.Director.PROJECTION_CUSTOM = 3;
942
+
943
+ /**
944
+ * Constant for default projection of cc.Director, default projection is 3D projection
945
+ * @constant
946
+ * @type {Number}
947
+ */
948
+ cc.Director.PROJECTION_DEFAULT = cc.Director.PROJECTION_3D;
949
+
950
+ if (cc._renderType === cc._RENDER_TYPE_CANVAS) {
951
+
952
+ var _p = cc.Director.prototype;
953
+
954
+ _p.setProjection = function (projection) {
955
+ this._projection = projection;
956
+ cc.eventManager.dispatchEvent(this._eventProjectionChanged);
957
+ };
958
+
959
+ _p.setDepthTest = function () {
960
+ };
961
+
962
+ _p.setOpenGLView = function (openGLView) {
963
+ // set size
964
+ this._winSizeInPoints.width = cc._canvas.width; //this._openGLView.getDesignResolutionSize();
965
+ this._winSizeInPoints.height = cc._canvas.height;
966
+ this._openGLView = openGLView || cc.view;
967
+ if (cc.eventManager)
968
+ cc.eventManager.setEnabled(true);
969
+ };
970
+
971
+ _p._clear = function () {
972
+ var viewport = this._openGLView.getViewPortRect();
973
+ var context = cc._renderContext.getContext();
974
+ context.setTransform(1,0,0,1, 0, 0);
975
+ context.clearRect(-viewport.x, viewport.y, viewport.width, viewport.height);
976
+ };
977
+
978
+ _p._createStatsLabel = function () {
979
+ var _t = this;
980
+ var fontSize = 0;
981
+ if (_t._winSizeInPoints.width > _t._winSizeInPoints.height)
982
+ fontSize = 0 | (_t._winSizeInPoints.height / 320 * 24);
983
+ else
984
+ fontSize = 0 | (_t._winSizeInPoints.width / 320 * 24);
985
+
986
+ _t._FPSLabel = new cc.LabelTTF("000.0", "Arial", fontSize);
987
+ _t._SPFLabel = new cc.LabelTTF("0.000", "Arial", fontSize);
988
+ _t._drawsLabel = new cc.LabelTTF("0000", "Arial", fontSize);
989
+
990
+ var locStatsPosition = cc.DIRECTOR_STATS_POSITION;
991
+ _t._drawsLabel.setPosition(_t._drawsLabel.width / 2 + locStatsPosition.x, _t._drawsLabel.height * 5 / 2 + locStatsPosition.y);
992
+ _t._SPFLabel.setPosition(_t._SPFLabel.width / 2 + locStatsPosition.x, _t._SPFLabel.height * 3 / 2 + locStatsPosition.y);
993
+ _t._FPSLabel.setPosition(_t._FPSLabel.width / 2 + locStatsPosition.x, _t._FPSLabel.height / 2 + locStatsPosition.y);
994
+ };
995
+
996
+ _p.getVisibleSize = function () {
997
+ //if (this._openGLView) {
998
+ //return this._openGLView.getVisibleSize();
999
+ //} else {
1000
+ return this.getWinSize();
1001
+ //}
1002
+ };
1003
+
1004
+ _p.getVisibleOrigin = function () {
1005
+ //if (this._openGLView) {
1006
+ //return this._openGLView.getVisibleOrigin();
1007
+ //} else {
1008
+ return cc.p(0, 0);
1009
+ //}
1010
+ };
1011
+ } else {
1012
+ cc.Director._fpsImage = new Image();
1013
+ cc._addEventListener(cc.Director._fpsImage, "load", function () {
1014
+ cc.Director._fpsImageLoaded = true;
1015
+ });
1016
+ if (cc._fpsImage) {
1017
+ cc.Director._fpsImage.src = cc._fpsImage;
1018
+ }
1019
+ }