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,1105 @@
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
+ Copyright (c) 2012 Neofect. All rights reserved.
6
+
7
+ http://www.cocos2d-x.org
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in
17
+ all copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ THE SOFTWARE.
26
+
27
+ Created by Jung Sang-Taik on 2012-03-16
28
+ ****************************************************************************/
29
+
30
+ /**
31
+ * <p>
32
+ * A 9-slice sprite for cocos2d UI. <br/>
33
+ * <br/>
34
+ * 9-slice scaling allows you to specify how scaling is applied <br/>
35
+ * to specific areas of a sprite. With 9-slice scaling (3x3 grid), <br/>
36
+ * you can ensure that the sprite does not become distorted when <br/>
37
+ * scaled. <br/>
38
+ * @note: it will refactor in v3.1 <br/>
39
+ * @see http://yannickloriot.com/library/ios/cccontrolextension/Classes/CCScale9Sprite.html <br/>
40
+ * </p>
41
+ * @class
42
+ * @extends cc.Node
43
+ *
44
+ * @property {cc.Size} preferredSize - The preferred size of the 9-slice sprite
45
+ * @property {cc.Rect} capInsets - The cap insets of the 9-slice sprite
46
+ * @property {Number} insetLeft - The left inset of the 9-slice sprite
47
+ * @property {Number} insetTop - The top inset of the 9-slice sprite
48
+ * @property {Number} insetRight - The right inset of the 9-slice sprite
49
+ * @property {Number} insetBottom - The bottom inset of the 9-slice sprite
50
+ */
51
+
52
+ //todo checking here. Maybe need synchronous.
53
+
54
+ ccui.Scale9Sprite = cc.Node.extend(/** @lends ccui.Scale9Sprite# */{
55
+ _spriteRect: null,
56
+ _capInsetsInternal: null,
57
+ _positionsAreDirty: false,
58
+
59
+ _scale9Image: null,
60
+ _topLeft: null,
61
+ _top: null,
62
+ _topRight: null,
63
+ _left: null,
64
+ _centre: null,
65
+ _right: null,
66
+ _bottomLeft: null,
67
+ _bottom: null,
68
+ _bottomRight: null,
69
+
70
+ _scale9Dirty: true,
71
+
72
+ _opacityModifyRGB: false,
73
+
74
+ _originalSize: null,
75
+ _preferredSize: null,
76
+ _opacity: 0,
77
+ _color: null,
78
+ _capInsets: null,
79
+ _insetLeft: 0,
80
+ _insetTop: 0,
81
+ _insetRight: 0,
82
+ _insetBottom: 0,
83
+
84
+ _spritesGenerated: false,
85
+ _spriteFrameRotated: false,
86
+ _textureLoaded:false,
87
+ _className:"Scale9Sprite",
88
+
89
+ //v3.3
90
+ _flippedX: false,
91
+ _flippedY: false,
92
+
93
+ /**
94
+ * return texture is loaded
95
+ * @returns {boolean}
96
+ */
97
+ textureLoaded:function(){
98
+ return this._textureLoaded;
99
+ },
100
+
101
+ /**
102
+ * add texture loaded event listener
103
+ * @param {Function} callback
104
+ * @param {Object} target
105
+ * @deprecated since 3.1, please use addEventListener instead
106
+ */
107
+ addLoadedEventListener:function(callback, target){
108
+ this.addEventListener("load", callback, target);
109
+ },
110
+
111
+ _updateCapInset: function () {
112
+ var insets, locInsetLeft = this._insetLeft, locInsetTop = this._insetTop, locInsetRight = this._insetRight;
113
+ var locSpriteRect = this._spriteRect, locInsetBottom = this._insetBottom;
114
+ if (locInsetLeft === 0 && locInsetTop === 0 && locInsetRight === 0 && locInsetBottom === 0) {
115
+ insets = cc.rect(0, 0, 0, 0);
116
+ } else {
117
+ insets = this._spriteFrameRotated ? cc.rect(locInsetBottom, locInsetLeft,
118
+ locSpriteRect.width - locInsetRight - locInsetLeft,
119
+ locSpriteRect.height - locInsetTop - locInsetBottom) :
120
+ cc.rect(locInsetLeft, locInsetTop,
121
+ locSpriteRect.width - locInsetLeft - locInsetRight,
122
+ locSpriteRect.height - locInsetTop - locInsetBottom);
123
+ }
124
+ this.setCapInsets(insets);
125
+ },
126
+
127
+ _updatePositions: function () {
128
+ // Check that instances are non-NULL
129
+ if (!((this._topLeft) && (this._topRight) && (this._bottomRight) &&
130
+ (this._bottomLeft) && (this._centre))) {
131
+ // if any of the above sprites are NULL, return
132
+ return;
133
+ }
134
+
135
+ var size = this._contentSize;
136
+ var locTopLeft = this._topLeft, locTopRight = this._topRight, locBottomRight = this._bottomRight, locBottomLeft = this._bottomLeft;
137
+ var locCenter = this._centre, locCenterContentSize = this._centre.getContentSize();
138
+ var locTopLeftContentSize = locTopLeft.getContentSize();
139
+ var locBottomLeftContentSize = locBottomLeft.getContentSize();
140
+
141
+ var sizableWidth = size.width - locTopLeftContentSize.width - locTopRight.getContentSize().width;
142
+ var sizableHeight = size.height - locTopLeftContentSize.height - locBottomRight.getContentSize().height;
143
+
144
+ var horizontalScale = sizableWidth / locCenterContentSize.width;
145
+ var verticalScale = sizableHeight / locCenterContentSize.height;
146
+
147
+ var rescaledWidth = locCenterContentSize.width * horizontalScale;
148
+ var rescaledHeight = locCenterContentSize.height * verticalScale;
149
+
150
+ var leftWidth = locBottomLeftContentSize.width;
151
+ var bottomHeight = locBottomLeftContentSize.height;
152
+
153
+ if (cc._renderType == cc._RENDER_TYPE_WEBGL) {
154
+ //browser is in canvas mode, need to manually control rounding to prevent overlapping pixels
155
+ var roundedRescaledWidth = Math.round(rescaledWidth);
156
+ if (rescaledWidth != roundedRescaledWidth) {
157
+ rescaledWidth = roundedRescaledWidth;
158
+ horizontalScale = rescaledWidth / locCenterContentSize.width;
159
+ }
160
+ var roundedRescaledHeight = Math.round(rescaledHeight);
161
+ if (rescaledHeight != roundedRescaledHeight) {
162
+ rescaledHeight = roundedRescaledHeight;
163
+ verticalScale = rescaledHeight / locCenterContentSize.height;
164
+ }
165
+ }
166
+
167
+ locCenter.setScaleX(horizontalScale);
168
+ locCenter.setScaleY(verticalScale);
169
+
170
+ var locLeft = this._left, locRight = this._right, locTop = this._top, locBottom = this._bottom;
171
+ var tempAP = cc.p(0, 0);
172
+ locBottomLeft.setAnchorPoint(tempAP);
173
+ locBottomRight.setAnchorPoint(tempAP);
174
+ locTopLeft.setAnchorPoint(tempAP);
175
+ locTopRight.setAnchorPoint(tempAP);
176
+ locLeft.setAnchorPoint(tempAP);
177
+ locRight.setAnchorPoint(tempAP);
178
+ locTop.setAnchorPoint(tempAP);
179
+ locBottom.setAnchorPoint(tempAP);
180
+ locCenter.setAnchorPoint(tempAP);
181
+
182
+ // Position corners
183
+ locBottomLeft.setPosition(0, 0);
184
+ locBottomRight.setPosition(leftWidth + rescaledWidth, 0);
185
+ locTopLeft.setPosition(0, bottomHeight + rescaledHeight);
186
+ locTopRight.setPosition(leftWidth + rescaledWidth, bottomHeight + rescaledHeight);
187
+
188
+ // Scale and position borders
189
+ locLeft.setPosition(0, bottomHeight);
190
+ locLeft.setScaleY(verticalScale);
191
+ locRight.setPosition(leftWidth + rescaledWidth, bottomHeight);
192
+ locRight.setScaleY(verticalScale);
193
+ locBottom.setPosition(leftWidth, 0);
194
+ locBottom.setScaleX(horizontalScale);
195
+ locTop.setPosition(leftWidth, bottomHeight + rescaledHeight);
196
+ locTop.setScaleX(horizontalScale);
197
+
198
+ // Position centre
199
+ locCenter.setPosition(leftWidth, bottomHeight);
200
+ },
201
+
202
+ /**
203
+ * Constructor function. override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
204
+ * @function
205
+ * @param {string|cc.SpriteFrame} file file name of texture or a SpriteFrame
206
+ * @param {cc.Rect} rect
207
+ * @param {cc.Rect} capInsets
208
+ * @returns {Scale9Sprite}
209
+ */
210
+ ctor: function (file, rect, capInsets) {
211
+ cc.Node.prototype.ctor.call(this);
212
+ this._spriteRect = cc.rect(0, 0, 0, 0);
213
+ this._capInsetsInternal = cc.rect(0, 0, 0, 0);
214
+
215
+ this._originalSize = cc.size(0, 0);
216
+ this._preferredSize = cc.size(0, 0);
217
+ this._capInsets = cc.rect(0, 0, 0, 0);
218
+
219
+ if(file != undefined){
220
+ if(file instanceof cc.SpriteFrame)
221
+ this.initWithSpriteFrame(file, rect);
222
+ else{
223
+ var frame = cc.spriteFrameCache.getSpriteFrame(file);
224
+ if(frame != null)
225
+ this.initWithSpriteFrame(frame, rect);
226
+ else
227
+ this.initWithFile(file, rect, capInsets);
228
+ }
229
+ }else{
230
+ this.init();
231
+ }
232
+ },
233
+
234
+ getSprite: function () {
235
+ return this._scale9Image;
236
+ },
237
+
238
+ /** Original sprite's size. */
239
+ getOriginalSize: function () {
240
+ return cc.size(this._originalSize);
241
+ },
242
+
243
+ //if the preferredSize component is given as -1, it is ignored
244
+ getPreferredSize: function () {
245
+ return cc.size(this._preferredSize);
246
+ },
247
+ _getPreferredWidth: function () {
248
+ return this._preferredSize.width;
249
+ },
250
+ _getPreferredHeight: function () {
251
+ return this._preferredSize.height;
252
+ },
253
+ setPreferredSize: function (preferredSize) {
254
+ this.setContentSize(preferredSize);
255
+ this._preferredSize = preferredSize;
256
+
257
+ if (this._positionsAreDirty) {
258
+ this._updatePositions();
259
+ this._positionsAreDirty = false;
260
+ this._scale9Dirty = true;
261
+ }
262
+ },
263
+ _setPreferredWidth: function (value) {
264
+ this._setWidth(value);
265
+ this._preferredSize.width = value;
266
+ },
267
+ _setPreferredHeight: function (value) {
268
+ this._setHeight(value);
269
+ this._preferredSize.height = value;
270
+ },
271
+
272
+ /** Opacity: conforms to CCRGBAProtocol protocol */
273
+ setOpacity: function (opacity) {
274
+ if(!this._scale9Image)
275
+ return;
276
+ cc.Node.prototype.setOpacity.call(this, opacity);
277
+ var scaleChildren = this._scale9Image.getChildren();
278
+ for (var i = 0; i < scaleChildren.length; i++) {
279
+ var selChild = scaleChildren[i];
280
+ if (selChild)
281
+ selChild.setOpacity(opacity);
282
+ }
283
+ this._scale9Dirty = true;
284
+ },
285
+
286
+ /** Color: conforms to CCRGBAProtocol protocol */
287
+ setColor: function (color) {
288
+ if(!this._scale9Image)
289
+ return;
290
+
291
+ cc.Node.prototype.setColor.call(this, color);
292
+ var scaleChildren = this._scale9Image.getChildren();
293
+ for (var i = 0; i < scaleChildren.length; i++) {
294
+ var selChild = scaleChildren[i];
295
+ if (selChild)
296
+ selChild.setColor(color);
297
+ }
298
+ this._scale9Dirty = true;
299
+ },
300
+
301
+ getCapInsets: function () {
302
+ return cc.rect(this._capInsets);
303
+ },
304
+
305
+ setCapInsets: function (capInsets) {
306
+ if(!this._scale9Image)
307
+ return;
308
+ //backup the contentSize
309
+ var contentSize = this._contentSize;
310
+ var tempWidth = contentSize.width, tempHeight = contentSize.height;
311
+
312
+ this.updateWithBatchNode(this._scale9Image, this._spriteRect, this._spriteFrameRotated, capInsets);
313
+ //restore the contentSize
314
+ this.setContentSize(tempWidth, tempHeight);
315
+ },
316
+
317
+ /**
318
+ * Gets the left side inset
319
+ * @returns {number}
320
+ */
321
+ getInsetLeft: function () {
322
+ return this._insetLeft;
323
+ },
324
+
325
+ /**
326
+ * Sets the left side inset
327
+ * @param {Number} insetLeft
328
+ */
329
+ setInsetLeft: function (insetLeft) {
330
+ this._insetLeft = insetLeft;
331
+ this._updateCapInset();
332
+ },
333
+
334
+ /**
335
+ * Gets the top side inset
336
+ * @returns {number}
337
+ */
338
+ getInsetTop: function () {
339
+ return this._insetTop;
340
+ },
341
+
342
+ /**
343
+ * Sets the top side inset
344
+ * @param {Number} insetTop
345
+ */
346
+ setInsetTop: function (insetTop) {
347
+ this._insetTop = insetTop;
348
+ this._updateCapInset();
349
+ },
350
+
351
+ /**
352
+ * Gets the right side inset
353
+ * @returns {number}
354
+ */
355
+ getInsetRight: function () {
356
+ return this._insetRight;
357
+ },
358
+ /**
359
+ * Sets the right side inset
360
+ * @param {Number} insetRight
361
+ */
362
+ setInsetRight: function (insetRight) {
363
+ this._insetRight = insetRight;
364
+ this._updateCapInset();
365
+ },
366
+
367
+ /**
368
+ * Gets the bottom side inset
369
+ * @returns {number}
370
+ */
371
+ getInsetBottom: function () {
372
+ return this._insetBottom;
373
+ },
374
+ /**
375
+ * Sets the bottom side inset
376
+ * @param {number} insetBottom
377
+ */
378
+ setInsetBottom: function (insetBottom) {
379
+ this._insetBottom = insetBottom;
380
+ this._updateCapInset();
381
+ },
382
+
383
+ /**
384
+ * Sets the untransformed size of the Scale9Sprite.
385
+ * @override
386
+ * @param {cc.Size|Number} size The untransformed size of the Scale9Sprite or The untransformed size's width of the Scale9Sprite.
387
+ * @param {Number} [height] The untransformed size's height of the Scale9Sprite.
388
+ */
389
+ setContentSize: function (size, height) {
390
+ cc.Node.prototype.setContentSize.call(this, size, height);
391
+ this._positionsAreDirty = true;
392
+ },
393
+
394
+ _setWidth: function (value) {
395
+ cc.Node.prototype._setWidth.call(this, value);
396
+ this._positionsAreDirty = true;
397
+ },
398
+
399
+ _setHeight: function (value) {
400
+ cc.Node.prototype._setHeight.call(this, value);
401
+ this._positionsAreDirty = true;
402
+ },
403
+
404
+ /**
405
+ * Initializes a ccui.Scale9Sprite. please do not call this function by yourself, you should pass the parameters to constructor to initialize it.
406
+ * @returns {boolean}
407
+ */
408
+ init: function () {
409
+ return this.initWithBatchNode(null, cc.rect(0, 0, 0, 0), false, cc.rect(0, 0, 0, 0));
410
+ },
411
+
412
+ /**
413
+ * Initializes a 9-slice sprite with a SpriteBatchNode.
414
+ * @param {cc.SpriteBatchNode} batchNode
415
+ * @param {cc.Rect} rect
416
+ * @param {boolean|cc.Rect} rotated
417
+ * @param {cc.Rect} [capInsets]
418
+ * @returns {boolean}
419
+ */
420
+ initWithBatchNode: function (batchNode, rect, rotated, capInsets) {
421
+ if (capInsets === undefined) {
422
+ capInsets = rotated;
423
+ rotated = false;
424
+ }
425
+
426
+ if (batchNode)
427
+ this.updateWithBatchNode(batchNode, rect, rotated, capInsets);
428
+ this.setCascadeColorEnabled(true);
429
+ this.setCascadeOpacityEnabled(true);
430
+ this.setAnchorPoint(0.5, 0.5);
431
+ this._positionsAreDirty = true;
432
+ return true;
433
+ },
434
+
435
+ /**
436
+ * Initializes a 9-slice sprite with a texture file, a delimitation zone and
437
+ * with the specified cap insets.
438
+ * Once the sprite is created, you can then call its "setContentSize:" method
439
+ * to resize the sprite will all it's 9-slice goodness intact.
440
+ * It respects the anchorPoint too.
441
+ *
442
+ * @param {String} file The name of the texture file.
443
+ * @param {cc.Rect} rect The rectangle that describes the sub-part of the texture that
444
+ * is the whole image. If the shape is the whole texture, set this to the texture's full rect.
445
+ * @param {cc.Rect} capInsets The values to use for the cap insets.
446
+ */
447
+ initWithFile: function (file, rect, capInsets) {
448
+ if (file instanceof cc.Rect) {
449
+ file = arguments[1];
450
+ capInsets = arguments[0];
451
+ rect = cc.rect(0, 0, 0, 0);
452
+ } else {
453
+ rect = rect || cc.rect(0, 0, 0, 0);
454
+ capInsets = capInsets || cc.rect(0, 0, 0, 0);
455
+ }
456
+
457
+ if(!file)
458
+ throw "ccui.Scale9Sprite.initWithFile(): file should be non-null";
459
+
460
+ var texture = cc.textureCache.getTextureForKey(file);
461
+ if (!texture) {
462
+ texture = cc.textureCache.addImage(file);
463
+ }
464
+
465
+ var locLoaded = texture.isLoaded();
466
+ this._textureLoaded = locLoaded;
467
+ if(!locLoaded){
468
+ texture.addEventListener("load", function(sender){
469
+ // the texture is rotated on Canvas render mode, so isRotated always is false.
470
+ var preferredSize = this._preferredSize;
471
+ preferredSize = cc.size(preferredSize.width, preferredSize.height);
472
+ var size = sender.getContentSize();
473
+ this.updateWithBatchNode(this._scale9Image, cc.rect(0,0,size.width,size.height), false, this._capInsets);
474
+ this.setPreferredSize(preferredSize);
475
+ this._positionsAreDirty = true;
476
+ this.dispatchEvent("load");
477
+ }, this);
478
+ }
479
+
480
+ return this.initWithBatchNode(new cc.SpriteBatchNode(file, 9), rect, false, capInsets);
481
+ },
482
+
483
+ /**
484
+ * Initializes a 9-slice sprite with an sprite frame and with the specified
485
+ * cap insets.
486
+ * Once the sprite is created, you can then call its "setContentSize:" method
487
+ * to resize the sprite will all it's 9-slice goodness interact.
488
+ * It respects the anchorPoint too.
489
+ *
490
+ * @param spriteFrame The sprite frame object.
491
+ * @param capInsets The values to use for the cap insets.
492
+ */
493
+ initWithSpriteFrame: function (spriteFrame, capInsets) {
494
+ if(!spriteFrame || !spriteFrame.getTexture())
495
+ throw "ccui.Scale9Sprite.initWithSpriteFrame(): spriteFrame should be non-null and its texture should be non-null";
496
+
497
+ capInsets = capInsets || cc.rect(0, 0, 0, 0);
498
+ var locLoaded = spriteFrame.textureLoaded();
499
+ this._textureLoaded = locLoaded;
500
+ if(!locLoaded){
501
+ spriteFrame.addEventListener("load", function(sender){
502
+ // the texture is rotated on Canvas render mode, so isRotated always is false.
503
+ var preferredSize = this._preferredSize;
504
+ preferredSize = cc.size(preferredSize.width, preferredSize.height);
505
+ this.updateWithBatchNode(this._scale9Image, sender.getRect(), cc._renderType == cc._RENDER_TYPE_WEBGL && sender.isRotated(), this._capInsets);
506
+ this.setPreferredSize(preferredSize);
507
+ this._positionsAreDirty = true;
508
+ this.dispatchEvent("load");
509
+ },this);
510
+ }
511
+ var batchNode = new cc.SpriteBatchNode(spriteFrame.getTexture(), 9);
512
+ // the texture is rotated on Canvas render mode, so isRotated always is false.
513
+ return this.initWithBatchNode(batchNode, spriteFrame.getRect(), cc._renderType == cc._RENDER_TYPE_WEBGL && spriteFrame.isRotated(), capInsets);
514
+ },
515
+
516
+ /**
517
+ * Initializes a 9-slice sprite with an sprite frame name and with the specified
518
+ * cap insets.
519
+ * Once the sprite is created, you can then call its "setContentSize:" method
520
+ * to resize the sprite will all it's 9-slice goodness interact.
521
+ * It respects the anchorPoint too.
522
+ *
523
+ * @param spriteFrameName The sprite frame name.
524
+ * @param capInsets The values to use for the cap insets.
525
+ */
526
+ initWithSpriteFrameName: function (spriteFrameName, capInsets) {
527
+ if(!spriteFrameName)
528
+ throw "ccui.Scale9Sprite.initWithSpriteFrameName(): spriteFrameName should be non-null";
529
+ capInsets = capInsets || cc.rect(0, 0, 0, 0);
530
+
531
+ var frame = cc.spriteFrameCache.getSpriteFrame(spriteFrameName);
532
+ if (frame == null) {
533
+ cc.log("ccui.Scale9Sprite.initWithSpriteFrameName(): can't find the sprite frame by spriteFrameName");
534
+ return false;
535
+ }
536
+
537
+ return this.initWithSpriteFrame(frame, capInsets);
538
+ },
539
+
540
+ /**
541
+ * Creates and returns a new sprite object with the specified cap insets.
542
+ * You use this method to add cap insets to a sprite or to change the existing
543
+ * cap insets of a sprite. In both cases, you get back a new image and the
544
+ * original sprite remains untouched.
545
+ *
546
+ * @param {cc.Rect} capInsets The values to use for the cap insets.
547
+ */
548
+ resizableSpriteWithCapInsets: function (capInsets) {
549
+ var pReturn = new ccui.Scale9Sprite();
550
+ if (pReturn && pReturn.initWithBatchNode(this._scale9Image, this._spriteRect, false, capInsets))
551
+ return pReturn;
552
+ return null;
553
+ },
554
+
555
+ /** sets the premultipliedAlphaOpacity property.
556
+ If set to NO then opacity will be applied as: glColor(R,G,B,opacity);
557
+ If set to YES then opacity will be applied as: glColor(opacity, opacity, opacity, opacity );
558
+ Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO
559
+ @since v0.8
560
+ */
561
+ setOpacityModifyRGB: function (value) {
562
+ if(!this._scale9Image)
563
+ return;
564
+ this._opacityModifyRGB = value;
565
+ var scaleChildren = this._scale9Image.getChildren();
566
+ if (scaleChildren) {
567
+ for (var i = 0, len = scaleChildren.length; i < len; i++)
568
+ scaleChildren[i].setOpacityModifyRGB(value);
569
+ }
570
+ },
571
+
572
+ /** returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity);
573
+ @since v0.8
574
+ */
575
+ isOpacityModifyRGB: function () {
576
+ return this._opacityModifyRGB;
577
+ },
578
+
579
+ /**
580
+ * Update the scale9Sprite with a SpriteBatchNode.
581
+ * @param {cc.SpriteBatchNode} batchNode
582
+ * @param {cc.Rect} originalRect
583
+ * @param {boolean} rotated
584
+ * @param {cc.Rect} capInsets
585
+ * @returns {boolean}
586
+ */
587
+ updateWithBatchNode: function (batchNode, originalRect, rotated, capInsets) {
588
+ var opacity = this.getOpacity();
589
+ var color = this.getColor();
590
+ var rect = cc.rect(originalRect.x, originalRect.y, originalRect.width, originalRect.height);
591
+
592
+ // Release old sprites
593
+ this.removeAllChildren(true);
594
+
595
+ if (this._scale9Image != batchNode)
596
+ this._scale9Image = batchNode;
597
+
598
+ if(!this._scale9Image)
599
+ return false;
600
+
601
+ var tmpTexture = batchNode.getTexture();
602
+ var locLoaded = tmpTexture.isLoaded();
603
+ this._textureLoaded = locLoaded;
604
+ if(!locLoaded){
605
+ tmpTexture.addEventListener("load", function(sender){
606
+ this._positionsAreDirty = true;
607
+ this.dispatchEvent("load");
608
+ },this);
609
+ return true;
610
+ }
611
+ var locScale9Image = this._scale9Image;
612
+ locScale9Image.removeAllChildren(true);
613
+
614
+ //this._capInsets = capInsets;
615
+ var locCapInsets = this._capInsets;
616
+ locCapInsets.x = capInsets.x;
617
+ locCapInsets.y = capInsets.y;
618
+ locCapInsets.width = capInsets.width;
619
+ locCapInsets.height = capInsets.height;
620
+ this._spriteFrameRotated = rotated;
621
+
622
+ var selTexture = locScale9Image.getTexture();
623
+
624
+ // If there is no given rect
625
+ if (cc._rectEqualToZero(rect)) {
626
+ // Get the texture size as original
627
+ var textureSize = selTexture.getContentSize();
628
+ rect = cc.rect(0, 0, textureSize.width, textureSize.height);
629
+ }
630
+
631
+ // Set the given rect's size as original size
632
+ this._spriteRect = rect;
633
+ var locSpriteRect = this._spriteRect;
634
+ locSpriteRect.x = rect.x;
635
+ locSpriteRect.y = rect.y;
636
+ locSpriteRect.width = rect.width;
637
+ locSpriteRect.height = rect.height;
638
+
639
+ this._originalSize.width = rect.width;
640
+ this._originalSize.height = rect.height;
641
+
642
+ var locPreferredSize = this._preferredSize;
643
+ if(locPreferredSize.width === 0 && locPreferredSize.height === 0){
644
+ locPreferredSize.width = rect.width;
645
+ locPreferredSize.height = rect.height;
646
+ }
647
+
648
+ var locCapInsetsInternal = this._capInsetsInternal;
649
+ if(capInsets){
650
+ locCapInsetsInternal.x = capInsets.x;
651
+ locCapInsetsInternal.y = capInsets.y;
652
+ locCapInsetsInternal.width = capInsets.width;
653
+ locCapInsetsInternal.height = capInsets.height;
654
+ }
655
+ var w = rect.width, h = rect.height;
656
+
657
+ // If there is no specified center region
658
+ if (cc._rectEqualToZero(locCapInsetsInternal)) {
659
+ // CCLog("... cap insets not specified : using default cap insets ...");
660
+ locCapInsetsInternal.x = w / 3;
661
+ locCapInsetsInternal.y = h / 3;
662
+ locCapInsetsInternal.width = w / 3;
663
+ locCapInsetsInternal.height = h / 3;
664
+ }
665
+
666
+ var left_w = locCapInsetsInternal.x, center_w = locCapInsetsInternal.width, right_w = w - (left_w + center_w);
667
+
668
+ var top_h = locCapInsetsInternal.y, center_h = locCapInsetsInternal.height, bottom_h = h - (top_h + center_h);
669
+
670
+ // calculate rects
671
+ // ... top row
672
+ var x = 0.0, y = 0.0;
673
+
674
+ // top left
675
+ var lefttopbounds = cc.rect(x + 0.5 | 0, y + 0.5 | 0, left_w + 0.5 | 0, top_h + 0.5 | 0);
676
+
677
+ // top center
678
+ x += left_w;
679
+ var centertopbounds = cc.rect(x + 0.5 | 0, y + 0.5 | 0, center_w + 0.5 | 0, top_h + 0.5 | 0);
680
+
681
+ // top right
682
+ x += center_w;
683
+ var righttopbounds = cc.rect(x + 0.5 | 0, y + 0.5 | 0, right_w + 0.5 | 0, top_h + 0.5 | 0);
684
+
685
+ // ... center row
686
+ x = 0.0;
687
+ y = 0.0;
688
+
689
+ y += top_h;
690
+ // center left
691
+ var leftcenterbounds = cc.rect(x + 0.5 | 0, y + 0.5 | 0, left_w + 0.5 | 0, center_h + 0.5 | 0);
692
+
693
+ // center center
694
+ x += left_w;
695
+ var centerbounds = cc.rect(x + 0.5 | 0, y + 0.5 | 0, center_w + 0.5 | 0, center_h + 0.5 | 0);
696
+
697
+ // center right
698
+ x += center_w;
699
+ var rightcenterbounds = cc.rect(x + 0.5 | 0, y + 0.5 | 0, right_w + 0.5 | 0, center_h + 0.5 | 0);
700
+
701
+ // ... bottom row
702
+ x = 0.0;
703
+ y = 0.0;
704
+ y += top_h;
705
+ y += center_h;
706
+
707
+ // bottom left
708
+ var leftbottombounds = cc.rect(x + 0.5 | 0, y + 0.5 | 0, left_w + 0.5 | 0, bottom_h + 0.5 | 0);
709
+
710
+ // bottom center
711
+ x += left_w;
712
+ var centerbottombounds = cc.rect(x + 0.5 | 0, y + 0.5 | 0, center_w + 0.5 | 0, bottom_h + 0.5 | 0);
713
+
714
+ // bottom right
715
+ x += center_w;
716
+ var rightbottombounds = cc.rect(x + 0.5 | 0, y + 0.5 | 0, right_w + 0.5 | 0, bottom_h + 0.5 | 0);
717
+
718
+ var t = cc.affineTransformMakeIdentity();
719
+ if (!rotated) {
720
+ // CCLog("!rotated");
721
+ t = cc.affineTransformTranslate(t, rect.x, rect.y);
722
+
723
+ cc._rectApplyAffineTransformIn(centerbounds, t);
724
+ cc._rectApplyAffineTransformIn(rightbottombounds, t);
725
+ cc._rectApplyAffineTransformIn(leftbottombounds, t);
726
+ cc._rectApplyAffineTransformIn(righttopbounds, t);
727
+ cc._rectApplyAffineTransformIn(lefttopbounds, t);
728
+ cc._rectApplyAffineTransformIn(rightcenterbounds, t);
729
+ cc._rectApplyAffineTransformIn(leftcenterbounds, t);
730
+ cc._rectApplyAffineTransformIn(centerbottombounds, t);
731
+ cc._rectApplyAffineTransformIn(centertopbounds, t);
732
+
733
+ // Centre
734
+ this._centre = new cc.Sprite();
735
+ this._centre.initWithTexture(selTexture, centerbounds);
736
+ locScale9Image.addChild(this._centre, 0, ccui.Scale9Sprite.POSITIONS_CENTRE);
737
+
738
+ // Top
739
+ this._top = new cc.Sprite();
740
+ this._top.initWithTexture(selTexture, centertopbounds);
741
+ locScale9Image.addChild(this._top, 1, ccui.Scale9Sprite.POSITIONS_TOP);
742
+
743
+ // Bottom
744
+ this._bottom = new cc.Sprite();
745
+ this._bottom.initWithTexture(selTexture, centerbottombounds);
746
+ locScale9Image.addChild(this._bottom, 1, ccui.Scale9Sprite.POSITIONS_BOTTOM);
747
+
748
+ // Left
749
+ this._left = new cc.Sprite();
750
+ this._left.initWithTexture(selTexture, leftcenterbounds);
751
+ locScale9Image.addChild(this._left, 1, ccui.Scale9Sprite.POSITIONS_LEFT);
752
+
753
+ // Right
754
+ this._right = new cc.Sprite();
755
+ this._right.initWithTexture(selTexture, rightcenterbounds);
756
+ locScale9Image.addChild(this._right, 1, ccui.Scale9Sprite.POSITIONS_RIGHT);
757
+
758
+ // Top left
759
+ this._topLeft = new cc.Sprite();
760
+ this._topLeft.initWithTexture(selTexture, lefttopbounds);
761
+ locScale9Image.addChild(this._topLeft, 2, ccui.Scale9Sprite.POSITIONS_TOPLEFT);
762
+
763
+ // Top right
764
+ this._topRight = new cc.Sprite();
765
+ this._topRight.initWithTexture(selTexture, righttopbounds);
766
+ locScale9Image.addChild(this._topRight, 2, ccui.Scale9Sprite.POSITIONS_TOPRIGHT);
767
+
768
+ // Bottom left
769
+ this._bottomLeft = new cc.Sprite();
770
+ this._bottomLeft.initWithTexture(selTexture, leftbottombounds);
771
+ locScale9Image.addChild(this._bottomLeft, 2, ccui.Scale9Sprite.POSITIONS_BOTTOMLEFT);
772
+
773
+ // Bottom right
774
+ this._bottomRight = new cc.Sprite();
775
+ this._bottomRight.initWithTexture(selTexture, rightbottombounds);
776
+ locScale9Image.addChild(this._bottomRight, 2, ccui.Scale9Sprite.POSITIONS_BOTTOMRIGHT);
777
+ } else {
778
+ // set up transformation of coordinates
779
+ // to handle the case where the sprite is stored rotated
780
+ // in the spritesheet
781
+ // CCLog("rotated");
782
+ var rotatedcenterbounds = centerbounds;
783
+ var rotatedrightbottombounds = rightbottombounds;
784
+ var rotatedleftbottombounds = leftbottombounds;
785
+ var rotatedrighttopbounds = righttopbounds;
786
+ var rotatedlefttopbounds = lefttopbounds;
787
+ var rotatedrightcenterbounds = rightcenterbounds;
788
+ var rotatedleftcenterbounds = leftcenterbounds;
789
+ var rotatedcenterbottombounds = centerbottombounds;
790
+ var rotatedcentertopbounds = centertopbounds;
791
+
792
+ t = cc.affineTransformTranslate(t, rect.height + rect.x, rect.y);
793
+ t = cc.affineTransformRotate(t, 1.57079633);
794
+
795
+ centerbounds = cc.rectApplyAffineTransform(centerbounds, t);
796
+ rightbottombounds = cc.rectApplyAffineTransform(rightbottombounds, t);
797
+ leftbottombounds = cc.rectApplyAffineTransform(leftbottombounds, t);
798
+ righttopbounds = cc.rectApplyAffineTransform(righttopbounds, t);
799
+ lefttopbounds = cc.rectApplyAffineTransform(lefttopbounds, t);
800
+ rightcenterbounds = cc.rectApplyAffineTransform(rightcenterbounds, t);
801
+ leftcenterbounds = cc.rectApplyAffineTransform(leftcenterbounds, t);
802
+ centerbottombounds = cc.rectApplyAffineTransform(centerbottombounds, t);
803
+ centertopbounds = cc.rectApplyAffineTransform(centertopbounds, t);
804
+
805
+ rotatedcenterbounds.x = centerbounds.x;
806
+ rotatedcenterbounds.y = centerbounds.y;
807
+
808
+ rotatedrightbottombounds.x = rightbottombounds.x;
809
+ rotatedrightbottombounds.y = rightbottombounds.y;
810
+
811
+ rotatedleftbottombounds.x = leftbottombounds.x;
812
+ rotatedleftbottombounds.y = leftbottombounds.y;
813
+
814
+ rotatedrighttopbounds.x = righttopbounds.x;
815
+ rotatedrighttopbounds.y = righttopbounds.y;
816
+
817
+ rotatedlefttopbounds.x = lefttopbounds.x;
818
+ rotatedlefttopbounds.y = lefttopbounds.y;
819
+
820
+ rotatedrightcenterbounds.x = rightcenterbounds.x;
821
+ rotatedrightcenterbounds.y = rightcenterbounds.y;
822
+
823
+ rotatedleftcenterbounds.x = leftcenterbounds.x;
824
+ rotatedleftcenterbounds.y = leftcenterbounds.y;
825
+
826
+ rotatedcenterbottombounds.x = centerbottombounds.x;
827
+ rotatedcenterbottombounds.y = centerbottombounds.y;
828
+
829
+ rotatedcentertopbounds.x = centertopbounds.x;
830
+ rotatedcentertopbounds.y = centertopbounds.y;
831
+
832
+ // Centre
833
+ this._centre = new cc.Sprite();
834
+ this._centre.initWithTexture(selTexture, rotatedcenterbounds, true);
835
+ locScale9Image.addChild(this._centre, 0, ccui.Scale9Sprite.POSITIONS_CENTRE);
836
+
837
+ // Top
838
+ this._top = new cc.Sprite();
839
+ this._top.initWithTexture(selTexture, rotatedcentertopbounds, true);
840
+ locScale9Image.addChild(this._top, 1, ccui.Scale9Sprite.POSITIONS_TOP);
841
+
842
+ // Bottom
843
+ this._bottom = new cc.Sprite();
844
+ this._bottom.initWithTexture(selTexture, rotatedcenterbottombounds, true);
845
+ locScale9Image.addChild(this._bottom, 1, ccui.Scale9Sprite.POSITIONS_BOTTOM);
846
+
847
+ // Left
848
+ this._left = new cc.Sprite();
849
+ this._left.initWithTexture(selTexture, rotatedleftcenterbounds, true);
850
+ locScale9Image.addChild(this._left, 1, ccui.Scale9Sprite.POSITIONS_LEFT);
851
+
852
+ // Right
853
+ this._right = new cc.Sprite();
854
+ this._right.initWithTexture(selTexture, rotatedrightcenterbounds, true);
855
+ locScale9Image.addChild(this._right, 1, ccui.Scale9Sprite.POSITIONS_RIGHT);
856
+
857
+ // Top left
858
+ this._topLeft = new cc.Sprite();
859
+ this._topLeft.initWithTexture(selTexture, rotatedlefttopbounds, true);
860
+ locScale9Image.addChild(this._topLeft, 2, ccui.Scale9Sprite.POSITIONS_TOPLEFT);
861
+
862
+ // Top right
863
+ this._topRight = new cc.Sprite();
864
+ this._topRight.initWithTexture(selTexture, rotatedrighttopbounds, true);
865
+ locScale9Image.addChild(this._topRight, 2, ccui.Scale9Sprite.POSITIONS_TOPRIGHT);
866
+
867
+ // Bottom left
868
+ this._bottomLeft = new cc.Sprite();
869
+ this._bottomLeft.initWithTexture(selTexture, rotatedleftbottombounds, true);
870
+ locScale9Image.addChild(this._bottomLeft, 2, ccui.Scale9Sprite.POSITIONS_BOTTOMLEFT);
871
+
872
+ // Bottom right
873
+ this._bottomRight = new cc.Sprite();
874
+ this._bottomRight.initWithTexture(selTexture, rotatedrightbottombounds, true);
875
+ locScale9Image.addChild(this._bottomRight, 2, ccui.Scale9Sprite.POSITIONS_BOTTOMRIGHT);
876
+ }
877
+
878
+ this.setContentSize(rect.width, rect.height);
879
+ if(cc._renderType === cc._RENDER_TYPE_WEBGL)
880
+ this.addChild(locScale9Image);
881
+
882
+ if (this._spritesGenerated) {
883
+ // Restore color and opacity
884
+ this.setOpacity(opacity);
885
+ this.setColor(color);
886
+ }
887
+ this._spritesGenerated = true;
888
+ return true;
889
+ },
890
+
891
+ /**
892
+ * set the sprite frame of ccui.Scale9Sprite
893
+ * @param {cc.SpriteFrame} spriteFrame
894
+ */
895
+ setSpriteFrame: function (spriteFrame) {
896
+ var batchNode = new cc.SpriteBatchNode(spriteFrame.getTexture(), 9);
897
+ // the texture is rotated on Canvas render mode, so isRotated always is false.
898
+ var locLoaded = spriteFrame.textureLoaded();
899
+ this._textureLoaded = locLoaded;
900
+ if(!locLoaded){
901
+ spriteFrame.addEventListener("load", function(sender){
902
+ // the texture is rotated on Canvas render mode, so isRotated always is false.
903
+ var preferredSize = this._preferredSize;
904
+ preferredSize = cc.size(preferredSize.width, preferredSize.height);
905
+ this.updateWithBatchNode(this._scale9Image, sender.getRect(), cc._renderType == cc._RENDER_TYPE_WEBGL && sender.isRotated(), this._capInsets);
906
+ this.setPreferredSize(preferredSize);
907
+ this._positionsAreDirty = true;
908
+ this.dispatchEvent("load");
909
+ },this);
910
+ }
911
+ this.updateWithBatchNode(batchNode, spriteFrame.getRect(), cc._renderType == cc._RENDER_TYPE_WEBGL && spriteFrame.isRotated(), cc.rect(0, 0, 0, 0));
912
+
913
+ // Reset insets
914
+ this._insetLeft = 0;
915
+ this._insetTop = 0;
916
+ this._insetRight = 0;
917
+ this._insetBottom = 0;
918
+ },
919
+
920
+ //v3.3
921
+ /**
922
+ * Sets ccui.Scale9Sprite's state
923
+ * @since v3.3
924
+ * @param {Number} state
925
+ */
926
+ setState: function(state){
927
+ this._renderCmd.setState(state);
928
+ },
929
+
930
+ //setScale9Enabled implement late
931
+
932
+ /**
933
+ * Sets whether the widget should be flipped horizontally or not.
934
+ * @since v3.3
935
+ * @param flippedX true if the widget should be flipped horizontally, false otherwise.
936
+ */
937
+ setFlippedX: function(flippedX){
938
+ var realScale = this.getScaleX();
939
+ this._flippedX = flippedX;
940
+ this.setScaleX(realScale);
941
+ },
942
+
943
+ /**
944
+ * <p>
945
+ * Returns the flag which indicates whether the widget is flipped horizontally or not. <br/>
946
+ * <br/>
947
+ * It only flips the texture of the widget, and not the texture of the widget's children. <br/>
948
+ * Also, flipping the texture doesn't alter the anchorPoint. <br/>
949
+ * If you want to flip the anchorPoint too, and/or to flip the children too use: <br/>
950
+ * widget->setScaleX(sprite->getScaleX() * -1); <br/>
951
+ * </p>
952
+ * @since v3.3
953
+ * @return {Boolean} true if the widget is flipped horizontally, false otherwise.
954
+ */
955
+ isFlippedX: function(){
956
+ return this._flippedX;
957
+ },
958
+
959
+ /**
960
+ * Sets whether the widget should be flipped vertically or not.
961
+ * @since v3.3
962
+ * @param flippedY true if the widget should be flipped vertically, false otherwise.
963
+ */
964
+ setFlippedY:function(flippedY){
965
+ var realScale = this.getScaleY();
966
+ this._flippedY = flippedY;
967
+ this.setScaleY(realScale);
968
+ },
969
+
970
+ /**
971
+ * <p>
972
+ * Return the flag which indicates whether the widget is flipped vertically or not. <br/>
973
+ * <br/>
974
+ * It only flips the texture of the widget, and not the texture of the widget's children. <br/>
975
+ * Also, flipping the texture doesn't alter the anchorPoint. <br/>
976
+ * If you want to flip the anchorPoint too, and/or to flip the children too use: <br/>
977
+ * widget->setScaleY(widget->getScaleY() * -1); <br/>
978
+ * </p>
979
+ * @since v3.3
980
+ * @return {Boolean} true if the widget is flipped vertically, false otherwise.
981
+ */
982
+ isFlippedY:function(){
983
+ return this._flippedY;
984
+ },
985
+
986
+ setScaleX: function (scaleX) {
987
+ if (this._flippedX)
988
+ scaleX = scaleX * -1;
989
+ cc.Node.prototype.setScaleX.call(this, scaleX);
990
+ },
991
+
992
+ setScaleY: function (scaleY) {
993
+ if (this._flippedY)
994
+ scaleY = scaleY * -1;
995
+ cc.Node.prototype.setScaleY.call(this, scaleY);
996
+ },
997
+
998
+ setScale: function (scaleX, scaleY) {
999
+ if(scaleY === undefined)
1000
+ scaleY = scaleX;
1001
+ this.setScaleX(scaleX);
1002
+ this.setScaleY(scaleY);
1003
+ },
1004
+
1005
+ getScaleX: function () {
1006
+ var originalScale = cc.Node.prototype.getScaleX.call(this);
1007
+ if (this._flippedX)
1008
+ originalScale = originalScale * -1.0;
1009
+ return originalScale;
1010
+ },
1011
+
1012
+ getScaleY: function () {
1013
+ var originalScale = cc.Node.prototype.getScaleY.call(this);
1014
+ if (this._flippedY)
1015
+ originalScale = originalScale * -1.0;
1016
+ return originalScale;
1017
+ },
1018
+
1019
+ getScale: function () {
1020
+ if(this.getScaleX() !== this.getScaleY())
1021
+ cc.log("Scale9Sprite#scale. ScaleX != ScaleY. Don't know which one to return");
1022
+ return this.getScaleX();
1023
+ },
1024
+
1025
+ _createRenderCmd: function(){
1026
+ if(cc._renderType === cc._RENDER_TYPE_CANVAS)
1027
+ return new ccui.Scale9Sprite.CanvasRenderCmd(this);
1028
+ else
1029
+ return new ccui.Scale9Sprite.WebGLRenderCmd(this);
1030
+ }
1031
+ });
1032
+
1033
+ var _p = ccui.Scale9Sprite.prototype;
1034
+ cc.EventHelper.prototype.apply(_p);
1035
+
1036
+ // Extended properties
1037
+ /** @expose */
1038
+ _p.preferredSize;
1039
+ cc.defineGetterSetter(_p, "preferredSize", _p.getPreferredSize, _p.setPreferredSize);
1040
+ /** @expose */
1041
+ _p.capInsets;
1042
+ cc.defineGetterSetter(_p, "capInsets", _p.getCapInsets, _p.setCapInsets);
1043
+ /** @expose */
1044
+ _p.insetLeft;
1045
+ cc.defineGetterSetter(_p, "insetLeft", _p.getInsetLeft, _p.setInsetLeft);
1046
+ /** @expose */
1047
+ _p.insetTop;
1048
+ cc.defineGetterSetter(_p, "insetTop", _p.getInsetTop, _p.setInsetTop);
1049
+ /** @expose */
1050
+ _p.insetRight;
1051
+ cc.defineGetterSetter(_p, "insetRight", _p.getInsetRight, _p.setInsetRight);
1052
+ /** @expose */
1053
+ _p.insetBottom;
1054
+ cc.defineGetterSetter(_p, "insetBottom", _p.getInsetBottom, _p.setInsetBottom);
1055
+
1056
+ _p = null;
1057
+
1058
+ /**
1059
+ * Creates a 9-slice sprite with a texture file, a delimitation zone and
1060
+ * with the specified cap insets.
1061
+ * @deprecated since v3.0, please use new ccui.Scale9Sprite(file, rect, capInsets) instead.
1062
+ * @param {String|cc.SpriteFrame} file file name of texture or a cc.Sprite object
1063
+ * @param {cc.Rect} rect the rect of the texture
1064
+ * @param {cc.Rect} capInsets the cap insets of ccui.Scale9Sprite
1065
+ * @returns {ccui.Scale9Sprite}
1066
+ */
1067
+ ccui.Scale9Sprite.create = function (file, rect, capInsets) {
1068
+ return new ccui.Scale9Sprite(file, rect, capInsets);
1069
+ };
1070
+
1071
+ /**
1072
+ * create a ccui.Scale9Sprite with Sprite frame.
1073
+ * @deprecated since v3.0, please use "new ccui.Scale9Sprite(spriteFrame, capInsets)" instead.
1074
+ * @param {cc.SpriteFrame} spriteFrame
1075
+ * @param {cc.Rect} capInsets
1076
+ * @returns {ccui.Scale9Sprite}
1077
+ */
1078
+ ccui.Scale9Sprite.createWithSpriteFrame = function (spriteFrame, capInsets) {
1079
+ return new ccui.Scale9Sprite(spriteFrame, capInsets);
1080
+ };
1081
+
1082
+ /**
1083
+ * create a ccui.Scale9Sprite with a Sprite frame name
1084
+ * @deprecated since v3.0, please use "new ccui.Scale9Sprite(spriteFrameName, capInsets)" instead.
1085
+ * @param {string} spriteFrameName
1086
+ * @param {cc.Rect} capInsets
1087
+ * @returns {Scale9Sprite}
1088
+ */
1089
+ ccui.Scale9Sprite.createWithSpriteFrameName = function (spriteFrameName, capInsets) {
1090
+ return new ccui.Scale9Sprite(spriteFrameName, capInsets);
1091
+ };
1092
+
1093
+ /**
1094
+ * @ignore
1095
+ */
1096
+ ccui.Scale9Sprite.POSITIONS_CENTRE = 0;
1097
+ ccui.Scale9Sprite.POSITIONS_TOP = 1;
1098
+ ccui.Scale9Sprite.POSITIONS_LEFT = 2;
1099
+ ccui.Scale9Sprite.POSITIONS_RIGHT = 3;
1100
+ ccui.Scale9Sprite.POSITIONS_BOTTOM = 4;
1101
+ ccui.Scale9Sprite.POSITIONS_TOPRIGHT = 5;
1102
+ ccui.Scale9Sprite.POSITIONS_TOPLEFT = 6;
1103
+ ccui.Scale9Sprite.POSITIONS_BOTTOMRIGHT = 7;
1104
+
1105
+ ccui.Scale9Sprite.state = {NORMAL: 0, GRAY: 1};