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,829 @@
1
+ /****************************************************************************
2
+ Copyright (c) 2008-2010 Ricardo Quesada
3
+ Copyright (c) 2011-2012 cocos2d-x.org
4
+ Copyright (c) 2013-2014 Chukong Technologies Inc.
5
+
6
+ http://www.cocos2d-x.org
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+ ****************************************************************************/
26
+
27
+ /**
28
+ * <p>cc.LabelTTF is a subclass of cc.TextureNode that knows how to render text labels with system font or a ttf font file<br/>
29
+ * All features from cc.Sprite are valid in cc.LabelTTF<br/>
30
+ * cc.LabelTTF objects are slow for js-binding on mobile devices.<br/>
31
+ * Consider using cc.LabelAtlas or cc.LabelBMFont instead.<br/>
32
+ * You can create a cc.LabelTTF from a font name, alignment, dimension and font size or a cc.FontDefinition object.</p>
33
+ * @class
34
+ * @extends cc.Sprite
35
+ *
36
+ * @param {String} text
37
+ * @param {String|cc.FontDefinition} [fontName="Arial"]
38
+ * @param {Number} [fontSize=16]
39
+ * @param {cc.Size} [dimensions=cc.size(0,0)]
40
+ * @param {Number} [hAlignment=cc.TEXT_ALIGNMENT_LEFT]
41
+ * @param {Number} [vAlignment=cc.VERTICAL_TEXT_ALIGNMENT_TOP]
42
+ * @example
43
+ * var myLabel = new cc.LabelTTF('label text', 'Times New Roman', 32, cc.size(320,32), cc.TEXT_ALIGNMENT_LEFT);
44
+ *
45
+ * var fontDef = new cc.FontDefinition();
46
+ * fontDef.fontName = "Arial";
47
+ * fontDef.fontSize = "32";
48
+ * var myLabel = new cc.LabelTTF('label text', fontDef);
49
+ *
50
+ * @property {String} string - Content string of label
51
+ * @property {Number} textAlign - Horizontal Alignment of label: cc.TEXT_ALIGNMENT_LEFT|cc.TEXT_ALIGNMENT_CENTER|cc.TEXT_ALIGNMENT_RIGHT
52
+ * @property {Number} verticalAlign - Vertical Alignment of label: cc.VERTICAL_TEXT_ALIGNMENT_TOP|cc.VERTICAL_TEXT_ALIGNMENT_CENTER|cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM
53
+ * @property {Number} fontSize - Font size of label
54
+ * @property {String} fontName - Font name of label
55
+ * @property {String} font - The label font with a style string: e.g. "18px Verdana"
56
+ * @property {Number} boundingWidth - Width of the bounding box of label, the real content width is limited by boundingWidth
57
+ * @property {Number} boundingHeight - Height of the bounding box of label, the real content height is limited by boundingHeight
58
+ * @property {cc.Color} fillStyle - The fill color
59
+ * @property {cc.Color} strokeStyle - The stroke color
60
+ * @property {Number} lineWidth - The line width for stroke
61
+ * @property {Number} shadowOffsetX - The x axis offset of shadow
62
+ * @property {Number} shadowOffsetY - The y axis offset of shadow
63
+ * @property {Number} shadowOpacity - The opacity of shadow
64
+ * @property {Number} shadowBlur - The blur size of shadow
65
+ */
66
+ cc.LabelTTF = cc.Sprite.extend(/** @lends cc.LabelTTF# */{
67
+ _dimensions: null,
68
+ _hAlignment: cc.TEXT_ALIGNMENT_CENTER,
69
+ _vAlignment: cc.VERTICAL_TEXT_ALIGNMENT_TOP,
70
+ _fontName: null,
71
+ _fontSize: 0.0,
72
+ _string: "",
73
+ _originalText: null,
74
+
75
+ // font shadow
76
+ _shadowEnabled: false,
77
+ _shadowOffset: null,
78
+ _shadowOpacity: 0,
79
+ _shadowBlur: 0,
80
+ _shadowColor: null,
81
+
82
+ // font stroke
83
+ _strokeEnabled: false,
84
+ _strokeColor: null,
85
+ _strokeSize: 0,
86
+
87
+ // font tint
88
+ _textFillColor: null,
89
+
90
+ _strokeShadowOffsetX: 0,
91
+ _strokeShadowOffsetY: 0,
92
+ _needUpdateTexture: false,
93
+
94
+ _lineWidths: null,
95
+ _className: "LabelTTF",
96
+
97
+ _lineHeight: 0,
98
+
99
+ //for web
100
+ _fontStyle: "normal",
101
+ _fontWeight: "normal",
102
+
103
+ /**
104
+ * Initializes the cc.LabelTTF with a font name, alignment, dimension and font size, do not call it by yourself,
105
+ * you should pass the correct arguments in constructor to initialize the label.
106
+ * @param {String} label string
107
+ * @param {String} fontName
108
+ * @param {Number} fontSize
109
+ * @param {cc.Size} [dimensions=]
110
+ * @param {Number} [hAlignment=]
111
+ * @param {Number} [vAlignment=]
112
+ * @return {Boolean} return false on error
113
+ */
114
+ initWithString: function (label, fontName, fontSize, dimensions, hAlignment, vAlignment) {
115
+ var strInfo;
116
+ if (label)
117
+ strInfo = label + "";
118
+ else
119
+ strInfo = "";
120
+
121
+ fontSize = fontSize || 16;
122
+ dimensions = dimensions || cc.size(0, 0/*fontSize*/);
123
+ hAlignment = hAlignment || cc.TEXT_ALIGNMENT_LEFT;
124
+ vAlignment = vAlignment || cc.VERTICAL_TEXT_ALIGNMENT_TOP;
125
+
126
+ this._opacityModifyRGB = false;
127
+ this._dimensions = cc.size(dimensions.width, dimensions.height);
128
+ this._fontName = fontName || "Arial";
129
+ this._hAlignment = hAlignment;
130
+ this._vAlignment = vAlignment;
131
+
132
+ this._fontSize = fontSize;
133
+ this._renderCmd._setFontStyle(this._fontName, fontSize, this._fontStyle, this._fontWeight);
134
+ this.string = strInfo;
135
+ this._renderCmd._setColorsString();
136
+ this._renderCmd._updateTexture();
137
+ this._setUpdateTextureDirty();
138
+ return true;
139
+ },
140
+
141
+ _setUpdateTextureDirty: function () {
142
+ this._needUpdateTexture = true;
143
+ this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.textDirty);
144
+ },
145
+
146
+ ctor: function (text, fontName, fontSize, dimensions, hAlignment, vAlignment) {
147
+ cc.Sprite.prototype.ctor.call(this);
148
+
149
+ this._dimensions = cc.size(0, 0);
150
+ this._hAlignment = cc.TEXT_ALIGNMENT_LEFT;
151
+ this._vAlignment = cc.VERTICAL_TEXT_ALIGNMENT_TOP;
152
+ this._opacityModifyRGB = false;
153
+ this._fontName = "Arial";
154
+
155
+ this._shadowEnabled = false;
156
+ this._shadowOffset = cc.p(0, 0);
157
+ this._shadowOpacity = 0;
158
+ this._shadowBlur = 0;
159
+
160
+ this._strokeEnabled = false;
161
+ this._strokeColor = cc.color(255, 255, 255, 255);
162
+ this._strokeSize = 0;
163
+
164
+ this._textFillColor = cc.color(255, 255, 255, 255);
165
+ this._strokeShadowOffsetX = 0;
166
+ this._strokeShadowOffsetY = 0;
167
+ this._needUpdateTexture = false;
168
+
169
+ this._lineWidths = [];
170
+ this._renderCmd._setColorsString();
171
+ this._textureLoaded = true;
172
+
173
+ if (fontName && fontName instanceof cc.FontDefinition) {
174
+ this.initWithStringAndTextDefinition(text, fontName);
175
+ } else {
176
+ cc.LabelTTF.prototype.initWithString.call(this, text, fontName, fontSize, dimensions, hAlignment, vAlignment);
177
+ }
178
+ },
179
+
180
+ init: function () {
181
+ return this.initWithString(" ", this._fontName, this._fontSize);
182
+ },
183
+
184
+ description: function () {
185
+ return "<cc.LabelTTF | FontName =" + this._fontName + " FontSize = " + this._fontSize.toFixed(1) + ">";
186
+ },
187
+
188
+ getLineHeight: function () {
189
+ return this._lineHeight || this._renderCmd._getFontClientHeight();
190
+ },
191
+
192
+ setLineHeight: function (lineHeight) {
193
+ this._lineHeight = lineHeight;
194
+ },
195
+
196
+ /**
197
+ * Returns the text of the label
198
+ * @return {String}
199
+ */
200
+ getString: function () {
201
+ return this._string;
202
+ },
203
+
204
+ /**
205
+ * Returns Horizontal Alignment of cc.LabelTTF
206
+ * @return {cc.TEXT_ALIGNMENT_LEFT|cc.TEXT_ALIGNMENT_CENTER|cc.TEXT_ALIGNMENT_RIGHT}
207
+ */
208
+ getHorizontalAlignment: function () {
209
+ return this._hAlignment;
210
+ },
211
+
212
+ /**
213
+ * Returns Vertical Alignment of cc.LabelTTF
214
+ * @return {cc.VERTICAL_TEXT_ALIGNMENT_TOP|cc.VERTICAL_TEXT_ALIGNMENT_CENTER|cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM}
215
+ */
216
+ getVerticalAlignment: function () {
217
+ return this._vAlignment;
218
+ },
219
+
220
+ /**
221
+ * Returns the dimensions of cc.LabelTTF, the dimension is the maximum size of the label, set it so that label will automatically change lines when necessary.
222
+ * @see cc.LabelTTF#setDimensions, cc.LabelTTF#boundingWidth and cc.LabelTTF#boundingHeight
223
+ * @return {cc.Size}
224
+ */
225
+ getDimensions: function () {
226
+ return cc.size(this._dimensions);
227
+ },
228
+
229
+ /**
230
+ * Returns font size of cc.LabelTTF
231
+ * @return {Number}
232
+ */
233
+ getFontSize: function () {
234
+ return this._fontSize;
235
+ },
236
+
237
+ /**
238
+ * Returns font name of cc.LabelTTF
239
+ * @return {String}
240
+ */
241
+ getFontName: function () {
242
+ return this._fontName;
243
+ },
244
+
245
+ /**
246
+ * Initializes the CCLabelTTF with a font name, alignment, dimension and font size, do not call it by yourself, you should pass the correct arguments in constructor to initialize the label.
247
+ * @param {String} text
248
+ * @param {cc.FontDefinition} textDefinition
249
+ * @return {Boolean}
250
+ */
251
+ initWithStringAndTextDefinition: function (text, textDefinition) {
252
+ // prepare everything needed to render the label
253
+ this._updateWithTextDefinition(textDefinition, false);
254
+ // set the string
255
+ this.string = text;
256
+ return true;
257
+ },
258
+
259
+ /**
260
+ * Sets the text definition used by this label
261
+ * @param {cc.FontDefinition} theDefinition
262
+ */
263
+ setTextDefinition: function (theDefinition) {
264
+ if (theDefinition)
265
+ this._updateWithTextDefinition(theDefinition, true);
266
+ },
267
+
268
+ /**
269
+ * Extract the text definition used by this label
270
+ * @return {cc.FontDefinition}
271
+ */
272
+ getTextDefinition: function () {
273
+ return this._prepareTextDefinition(false);
274
+ },
275
+
276
+ /**
277
+ * Enable or disable shadow for the label
278
+ * @param {cc.Color | Number} a Color or The x axis offset of the shadow
279
+ * @param {cc.Size | Number} b Size or The y axis offset of the shadow
280
+ * @param {Number} c The blur size of the shadow or The opacity of the shadow (0 to 1)
281
+ * @param {null | Number} d Null or The blur size of the shadow
282
+ * @example
283
+ * old:
284
+ * labelttf.enableShadow(shadowOffsetX, shadowOffsetY, shadowOpacity, shadowBlur);
285
+ * new:
286
+ * labelttf.enableShadow(shadowColor, offset, blurRadius);
287
+ */
288
+ enableShadow: function (a, b, c, d) {
289
+ if (a.r != null && a.g != null && a.b != null && a.a != null) {
290
+ this._enableShadow(a, b, c);
291
+ } else {
292
+ this._enableShadowNoneColor(a, b, c, d)
293
+ }
294
+ },
295
+
296
+ _enableShadowNoneColor: function (shadowOffsetX, shadowOffsetY, shadowOpacity, shadowBlur) {
297
+ shadowOpacity = shadowOpacity || 0.5;
298
+ if (false === this._shadowEnabled)
299
+ this._shadowEnabled = true;
300
+
301
+ var locShadowOffset = this._shadowOffset;
302
+ if (locShadowOffset && (locShadowOffset.x != shadowOffsetX) || (locShadowOffset._y != shadowOffsetY)) {
303
+ locShadowOffset.x = shadowOffsetX;
304
+ locShadowOffset.y = shadowOffsetY;
305
+ }
306
+
307
+ if (this._shadowOpacity != shadowOpacity) {
308
+ this._shadowOpacity = shadowOpacity;
309
+ }
310
+ this._renderCmd._setColorsString();
311
+
312
+ if (this._shadowBlur != shadowBlur)
313
+ this._shadowBlur = shadowBlur;
314
+ this._setUpdateTextureDirty();
315
+ },
316
+
317
+ _enableShadow: function (shadowColor, offset, blurRadius) {
318
+ if (!this._shadowColor) {
319
+ this._shadowColor = cc.color(255, 255, 255, 128);
320
+ }
321
+ this._shadowColor.r = shadowColor.r;
322
+ this._shadowColor.g = shadowColor.g;
323
+ this._shadowColor.b = shadowColor.b;
324
+
325
+ var x, y, a, b;
326
+ x = offset.width || offset.x || 0;
327
+ y = offset.height || offset.y || 0;
328
+ a = (shadowColor.a != null) ? (shadowColor.a / 255) : 0.5;
329
+ b = blurRadius;
330
+
331
+ this._enableShadowNoneColor(x, y, a, b);
332
+ },
333
+
334
+ _getShadowOffsetX: function () {
335
+ return this._shadowOffset.x;
336
+ },
337
+ _setShadowOffsetX: function (x) {
338
+ if (false === this._shadowEnabled)
339
+ this._shadowEnabled = true;
340
+
341
+ if (this._shadowOffset.x != x) {
342
+ this._shadowOffset.x = x;
343
+ this._setUpdateTextureDirty();
344
+ }
345
+ },
346
+
347
+ _getShadowOffsetY: function () {
348
+ return this._shadowOffset._y;
349
+ },
350
+ _setShadowOffsetY: function (y) {
351
+ if (false === this._shadowEnabled)
352
+ this._shadowEnabled = true;
353
+
354
+ if (this._shadowOffset._y != y) {
355
+ this._shadowOffset._y = y;
356
+ this._setUpdateTextureDirty();
357
+ }
358
+ },
359
+
360
+ _getShadowOffset: function () {
361
+ return cc.p(this._shadowOffset.x, this._shadowOffset.y);
362
+ },
363
+ _setShadowOffset: function (offset) {
364
+ if (false === this._shadowEnabled)
365
+ this._shadowEnabled = true;
366
+
367
+ if (this._shadowOffset.x != offset.x || this._shadowOffset.y != offset.y) {
368
+ this._shadowOffset.x = offset.x;
369
+ this._shadowOffset.y = offset.y;
370
+ this._setUpdateTextureDirty();
371
+ }
372
+ },
373
+
374
+ _getShadowOpacity: function () {
375
+ return this._shadowOpacity;
376
+ },
377
+ _setShadowOpacity: function (shadowOpacity) {
378
+ if (false === this._shadowEnabled)
379
+ this._shadowEnabled = true;
380
+
381
+ if (this._shadowOpacity != shadowOpacity) {
382
+ this._shadowOpacity = shadowOpacity;
383
+ this._renderCmd._setColorsString();
384
+ this._setUpdateTextureDirty();
385
+ }
386
+ },
387
+
388
+ _getShadowBlur: function () {
389
+ return this._shadowBlur;
390
+ },
391
+ _setShadowBlur: function (shadowBlur) {
392
+ if (false === this._shadowEnabled)
393
+ this._shadowEnabled = true;
394
+
395
+ if (this._shadowBlur != shadowBlur) {
396
+ this._shadowBlur = shadowBlur;
397
+ this._setUpdateTextureDirty();
398
+ }
399
+ },
400
+
401
+ /**
402
+ * Disable shadow rendering
403
+ */
404
+ disableShadow: function () {
405
+ if (this._shadowEnabled) {
406
+ this._shadowEnabled = false;
407
+ this._setUpdateTextureDirty();
408
+ }
409
+ },
410
+
411
+ /**
412
+ * Enable label stroke with stroke parameters
413
+ * @param {cc.Color} strokeColor The color of stroke
414
+ * @param {Number} strokeSize The size of stroke
415
+ */
416
+ enableStroke: function (strokeColor, strokeSize) {
417
+ if (this._strokeEnabled === false)
418
+ this._strokeEnabled = true;
419
+
420
+ var locStrokeColor = this._strokeColor;
421
+ if ((locStrokeColor.r !== strokeColor.r) || (locStrokeColor.g !== strokeColor.g) || (locStrokeColor.b !== strokeColor.b)) {
422
+ locStrokeColor.r = strokeColor.r;
423
+ locStrokeColor.g = strokeColor.g;
424
+ locStrokeColor.b = strokeColor.b;
425
+ this._renderCmd._setColorsString();
426
+ }
427
+
428
+ if (this._strokeSize !== strokeSize)
429
+ this._strokeSize = strokeSize || 0;
430
+ this._setUpdateTextureDirty();
431
+ },
432
+
433
+ _getStrokeStyle: function () {
434
+ return this._strokeColor;
435
+ },
436
+ _setStrokeStyle: function (strokeStyle) {
437
+ if (this._strokeEnabled === false)
438
+ this._strokeEnabled = true;
439
+
440
+ var locStrokeColor = this._strokeColor;
441
+ if ((locStrokeColor.r !== strokeStyle.r) || (locStrokeColor.g !== strokeStyle.g) || (locStrokeColor.b !== strokeStyle.b)) {
442
+ locStrokeColor.r = strokeStyle.r;
443
+ locStrokeColor.g = strokeStyle.g;
444
+ locStrokeColor.b = strokeStyle.b;
445
+ this._renderCmd._setColorsString();
446
+ this._setUpdateTextureDirty();
447
+ }
448
+ },
449
+
450
+ _getLineWidth: function () {
451
+ return this._strokeSize;
452
+ },
453
+ _setLineWidth: function (lineWidth) {
454
+ if (this._strokeEnabled === false)
455
+ this._strokeEnabled = true;
456
+ if (this._strokeSize !== lineWidth) {
457
+ this._strokeSize = lineWidth || 0;
458
+ this._setUpdateTextureDirty();
459
+ }
460
+ },
461
+
462
+ /**
463
+ * Disable label stroke
464
+ */
465
+ disableStroke: function () {
466
+ if (this._strokeEnabled) {
467
+ this._strokeEnabled = false;
468
+ this._setUpdateTextureDirty();
469
+ }
470
+ },
471
+
472
+ /**
473
+ * Sets the text fill color
474
+ * @function
475
+ * @param {cc.Color} fillColor The fill color of the label
476
+ */
477
+ setFontFillColor: function (fillColor) {
478
+ var locTextFillColor = this._textFillColor;
479
+ if (locTextFillColor.r != fillColor.r || locTextFillColor.g != fillColor.g || locTextFillColor.b != fillColor.b) {
480
+ locTextFillColor.r = fillColor.r;
481
+ locTextFillColor.g = fillColor.g;
482
+ locTextFillColor.b = fillColor.b;
483
+ this._renderCmd._setColorsString();
484
+ this._needUpdateTexture = true;
485
+ }
486
+ },
487
+
488
+ _getFillStyle: function () {
489
+ return this._textFillColor;
490
+ },
491
+
492
+ //set the text definition for this label
493
+ _updateWithTextDefinition: function (textDefinition, mustUpdateTexture) {
494
+ if (textDefinition.fontDimensions) {
495
+ this._dimensions.width = textDefinition.boundingWidth;
496
+ this._dimensions.height = textDefinition.boundingHeight;
497
+ } else {
498
+ this._dimensions.width = 0;
499
+ this._dimensions.height = 0;
500
+ }
501
+
502
+ this._hAlignment = textDefinition.textAlign;
503
+ this._vAlignment = textDefinition.verticalAlign;
504
+
505
+ this._fontName = textDefinition.fontName;
506
+ this._fontSize = textDefinition.fontSize || 12;
507
+ this._renderCmd._setFontStyle(this._fontName, this._fontSize, this._fontStyle, this._fontWeight);
508
+
509
+ // shadow
510
+ if (textDefinition.shadowEnabled)
511
+ this.enableShadow(textDefinition.shadowOffsetX,
512
+ textDefinition.shadowOffsetY,
513
+ textDefinition.shadowOpacity,
514
+ textDefinition.shadowBlur);
515
+
516
+ // stroke
517
+ if (textDefinition.strokeEnabled)
518
+ this.enableStroke(textDefinition.strokeStyle, textDefinition.lineWidth);
519
+
520
+ // fill color
521
+ this.setFontFillColor(textDefinition.fillStyle);
522
+
523
+ if (mustUpdateTexture)
524
+ this._renderCmd._updateTexture();
525
+ var flags = cc.Node._dirtyFlags;
526
+ this._renderCmd.setDirtyFlag(flags.colorDirty|flags.opacityDirty|flags.textDirty);
527
+ },
528
+
529
+ _prepareTextDefinition: function (adjustForResolution) {
530
+ var texDef = new cc.FontDefinition();
531
+
532
+ if (adjustForResolution) {
533
+ texDef.fontSize = this._fontSize;
534
+ texDef.boundingWidth = cc.contentScaleFactor() * this._dimensions.width;
535
+ texDef.boundingHeight = cc.contentScaleFactor() * this._dimensions.height;
536
+ } else {
537
+ texDef.fontSize = this._fontSize;
538
+ texDef.boundingWidth = this._dimensions.width;
539
+ texDef.boundingHeight = this._dimensions.height;
540
+ }
541
+
542
+ texDef.fontName = this._fontName;
543
+ texDef.textAlign = this._hAlignment;
544
+ texDef.verticalAlign = this._vAlignment;
545
+
546
+ // stroke
547
+ if (this._strokeEnabled) {
548
+ texDef.strokeEnabled = true;
549
+ var locStrokeColor = this._strokeColor;
550
+ texDef.strokeStyle = cc.color(locStrokeColor.r, locStrokeColor.g, locStrokeColor.b);
551
+ texDef.lineWidth = this._strokeSize;
552
+ } else
553
+ texDef.strokeEnabled = false;
554
+
555
+ // shadow
556
+ if (this._shadowEnabled) {
557
+ texDef.shadowEnabled = true;
558
+ texDef.shadowBlur = this._shadowBlur;
559
+ texDef.shadowOpacity = this._shadowOpacity;
560
+
561
+ texDef.shadowOffsetX = (adjustForResolution ? cc.contentScaleFactor() : 1) * this._shadowOffset.x;
562
+ texDef.shadowOffsetY = (adjustForResolution ? cc.contentScaleFactor() : 1) * this._shadowOffset.y;
563
+ } else
564
+ texDef._shadowEnabled = false;
565
+
566
+ // text tint
567
+ var locTextFillColor = this._textFillColor;
568
+ texDef.fillStyle = cc.color(locTextFillColor.r, locTextFillColor.g, locTextFillColor.b);
569
+ return texDef;
570
+ },
571
+
572
+ /**
573
+ * Changes the text content of the label
574
+ * @warning Changing the string is as expensive as creating a new cc.LabelTTF. To obtain better performance use cc.LabelAtlas
575
+ * @param {String} text Text content for the label
576
+ */
577
+ setString: function (text) {
578
+ text = String(text);
579
+ if (this._originalText != text) {
580
+ this._originalText = text + "";
581
+
582
+ this._updateString();
583
+
584
+ // Force update
585
+ this._setUpdateTextureDirty();
586
+ this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.transformDirty);
587
+ }
588
+ },
589
+ _updateString: function () {
590
+ if ((!this._string || this._string === "") && this._string !== this._originalText)
591
+ cc.renderer.childrenOrderDirty = true;
592
+ this._string = this._originalText;
593
+ },
594
+
595
+ /**
596
+ * Sets Horizontal Alignment of cc.LabelTTF
597
+ * @param {cc.TEXT_ALIGNMENT_LEFT|cc.TEXT_ALIGNMENT_CENTER|cc.TEXT_ALIGNMENT_RIGHT} alignment Horizontal Alignment
598
+ */
599
+ setHorizontalAlignment: function (alignment) {
600
+ if (alignment !== this._hAlignment) {
601
+ this._hAlignment = alignment;
602
+ // Force update
603
+ this._setUpdateTextureDirty();
604
+ }
605
+ },
606
+
607
+ /**
608
+ * Sets Vertical Alignment of cc.LabelTTF
609
+ * @param {cc.VERTICAL_TEXT_ALIGNMENT_TOP|cc.VERTICAL_TEXT_ALIGNMENT_CENTER|cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM} verticalAlignment
610
+ */
611
+ setVerticalAlignment: function (verticalAlignment) {
612
+ if (verticalAlignment != this._vAlignment) {
613
+ this._vAlignment = verticalAlignment;
614
+
615
+ // Force update
616
+ this._setUpdateTextureDirty();
617
+ }
618
+ },
619
+
620
+ /**
621
+ * Set Dimensions of cc.LabelTTF, the dimension is the maximum size of the label, set it so that label will automatically change lines when necessary.
622
+ * @param {cc.Size|Number} dim dimensions or width of dimensions
623
+ * @param {Number} [height] height of dimensions
624
+ */
625
+ setDimensions: function (dim, height) {
626
+ var width;
627
+ if (height === undefined) {
628
+ width = dim.width;
629
+ height = dim.height;
630
+ } else
631
+ width = dim;
632
+
633
+ if (width != this._dimensions.width || height != this._dimensions.height) {
634
+ this._dimensions.width = width;
635
+ this._dimensions.height = height;
636
+ this._updateString();
637
+ // Force udpate
638
+ this._setUpdateTextureDirty();
639
+ }
640
+ },
641
+
642
+ _getBoundingWidth: function () {
643
+ return this._dimensions.width;
644
+ },
645
+ _setBoundingWidth: function (width) {
646
+ if (width != this._dimensions.width) {
647
+ this._dimensions.width = width;
648
+ this._updateString();
649
+ // Force udpate
650
+ this._setUpdateTextureDirty();
651
+ }
652
+ },
653
+
654
+ _getBoundingHeight: function () {
655
+ return this._dimensions.height;
656
+ },
657
+ _setBoundingHeight: function (height) {
658
+ if (height != this._dimensions.height) {
659
+ this._dimensions.height = height;
660
+ this._updateString();
661
+ // Force udpate
662
+ this._setUpdateTextureDirty();
663
+ }
664
+ },
665
+
666
+ /**
667
+ * Sets font size of cc.LabelTTF
668
+ * @param {Number} fontSize
669
+ */
670
+ setFontSize: function (fontSize) {
671
+ if (this._fontSize !== fontSize) {
672
+ this._fontSize = fontSize;
673
+ this._renderCmd._setFontStyle(this._fontName, this._fontSize, this._fontStyle, this._fontWeight);
674
+ // Force update
675
+ this._setUpdateTextureDirty();
676
+ }
677
+ },
678
+
679
+ /**
680
+ * Sets font name of cc.LabelTTF
681
+ * @param {String} fontName
682
+ */
683
+ setFontName: function (fontName) {
684
+ if (this._fontName && this._fontName != fontName) {
685
+ this._fontName = fontName;
686
+ this._renderCmd._setFontStyle(this._fontName, this._fontSize, this._fontStyle, this._fontWeight);
687
+ // Force update
688
+ this._setUpdateTextureDirty();
689
+ }
690
+ },
691
+
692
+ _getFont: function () {
693
+ return this._renderCmd._getFontStyle();
694
+ },
695
+ _setFont: function (fontStyle) {
696
+ var res = cc.LabelTTF._fontStyleRE.exec(fontStyle);
697
+ if (res) {
698
+ this._fontSize = parseInt(res[1]);
699
+ this._fontName = res[2];
700
+ this._renderCmd._setFontStyle(this._fontName, this._fontSize, this._fontStyle, this._fontWeight);
701
+
702
+ // Force update
703
+ this._setUpdateTextureDirty();
704
+ }
705
+ },
706
+
707
+ /**
708
+ * Returns the actual content size of the label, the content size is the real size that the label occupied while dimension is the outer bounding box of the label.
709
+ * @returns {cc.Size} The content size
710
+ */
711
+ getContentSize: function () {
712
+ if (this._needUpdateTexture)
713
+ this._renderCmd._updateTTF();
714
+ return cc.Sprite.prototype.getContentSize.call(this);
715
+ },
716
+
717
+ _getWidth: function () {
718
+ if (this._needUpdateTexture)
719
+ this._renderCmd._updateTTF();
720
+ return cc.Sprite.prototype._getWidth.call(this);
721
+ },
722
+ _getHeight: function () {
723
+ if (this._needUpdateTexture)
724
+ this._renderCmd._updateTTF();
725
+ return cc.Sprite.prototype._getHeight.call(this);
726
+ },
727
+
728
+ setTextureRect: function (rect, rotated, untrimmedSize) {
729
+ //set needConvert to false
730
+ cc.Sprite.prototype.setTextureRect.call(this, rect, rotated, untrimmedSize, false);
731
+ },
732
+
733
+ _createRenderCmd: function () {
734
+ if (cc._renderType === cc._RENDER_TYPE_CANVAS)
735
+ return new cc.LabelTTF.CanvasRenderCmd(this);
736
+ else
737
+ return new cc.LabelTTF.WebGLRenderCmd(this);
738
+ },
739
+
740
+ //For web only
741
+ _setFontStyle: function(fontStyle){
742
+ if (this._fontStyle != fontStyle) {
743
+ this._fontStyle = fontStyle;
744
+ this._renderCmd._setFontStyle(this._fontName, this._fontSize, this._fontStyle, this._fontWeight);
745
+ this._setUpdateTextureDirty();
746
+ }
747
+ },
748
+
749
+ _getFontStyle: function(){
750
+ return this._fontStyle;
751
+ },
752
+
753
+ _setFontWeight: function(fontWeight){
754
+ if (this._fontWeight != fontWeight) {
755
+ this._fontWeight = fontWeight;
756
+ this._renderCmd._setFontStyle(this._fontName, this._fontSize, this._fontStyle, this._fontWeight);
757
+ this._setUpdateTextureDirty();
758
+ }
759
+ },
760
+
761
+ _getFontWeight: function(){
762
+ return this._fontWeight;
763
+ }
764
+ });
765
+
766
+ cc.assert(cc.isFunction(cc._tmp.PrototypeLabelTTF), cc._LogInfos.MissingFile, "LabelTTFPropertyDefine.js");
767
+ cc._tmp.PrototypeLabelTTF();
768
+ delete cc._tmp.PrototypeLabelTTF;
769
+
770
+ // Only support style in this format: "18px Verdana" or "18px 'Helvetica Neue'"
771
+ cc.LabelTTF._fontStyleRE = /^(\d+)px\s+['"]?([\w\s\d]+)['"]?$/;
772
+
773
+ /**
774
+ * creates a cc.LabelTTF from a font name, alignment, dimension and font size
775
+ * @deprecated since v3.0, please use the new construction instead
776
+ * @see cc.LabelTTF
777
+ * @static
778
+ * @param {String} text
779
+ * @param {String|cc.FontDefinition} [fontName="Arial"]
780
+ * @param {Number} [fontSize=16]
781
+ * @param {cc.Size} [dimensions=cc.size(0,0)]
782
+ * @param {Number} [hAlignment=cc.TEXT_ALIGNMENT_LEFT]
783
+ * @param {Number} [vAlignment=cc.VERTICAL_TEXT_ALIGNMENT_TOP]
784
+ * @return {cc.LabelTTF|Null}
785
+ */
786
+ cc.LabelTTF.create = function (text, fontName, fontSize, dimensions, hAlignment, vAlignment) {
787
+ return new cc.LabelTTF(text, fontName, fontSize, dimensions, hAlignment, vAlignment);
788
+ };
789
+
790
+ /**
791
+ * @deprecated since v3.0, please use the new construction instead
792
+ * @function
793
+ * @static
794
+ */
795
+ cc.LabelTTF.createWithFontDefinition = cc.LabelTTF.create;
796
+
797
+ if (cc.USE_LA88_LABELS)
798
+ cc.LabelTTF._SHADER_PROGRAM = cc.SHADER_POSITION_TEXTURECOLOR;
799
+ else
800
+ cc.LabelTTF._SHADER_PROGRAM = cc.SHADER_POSITION_TEXTUREA8COLOR;
801
+
802
+ cc.LabelTTF.__labelHeightDiv = cc.newElement("div");
803
+ cc.LabelTTF.__labelHeightDiv.style.fontFamily = "Arial";
804
+ cc.LabelTTF.__labelHeightDiv.style.position = "absolute";
805
+ cc.LabelTTF.__labelHeightDiv.style.left = "-100px";
806
+ cc.LabelTTF.__labelHeightDiv.style.top = "-100px";
807
+ cc.LabelTTF.__labelHeightDiv.style.lineHeight = "normal";
808
+
809
+ document.body ?
810
+ document.body.appendChild(cc.LabelTTF.__labelHeightDiv) :
811
+ cc._addEventListener(window, 'load', function () {
812
+ this.removeEventListener('load', arguments.callee, false);
813
+ document.body.appendChild(cc.LabelTTF.__labelHeightDiv);
814
+ }, false);
815
+
816
+ cc.LabelTTF.__getFontHeightByDiv = function (fontName, fontSize) {
817
+ var clientHeight = cc.LabelTTF.__fontHeightCache[fontName + "." + fontSize];
818
+ if (clientHeight > 0) return clientHeight;
819
+ var labelDiv = cc.LabelTTF.__labelHeightDiv;
820
+ labelDiv.innerHTML = "ajghl~!";
821
+ labelDiv.style.fontFamily = fontName;
822
+ labelDiv.style.fontSize = fontSize + "px";
823
+ clientHeight = labelDiv.clientHeight;
824
+ cc.LabelTTF.__fontHeightCache[fontName + "." + fontSize] = clientHeight;
825
+ labelDiv.innerHTML = "";
826
+ return clientHeight;
827
+ };
828
+
829
+ cc.LabelTTF.__fontHeightCache = {};