joybox 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (393) hide show
  1. checksums.yaml +8 -8
  2. data/Gemfile.lock +1 -1
  3. data/LICENSE +1 -1
  4. data/LICENSE_Box2D +20 -0
  5. data/LICENSE_Cocos2D +24 -0
  6. data/README.md +34 -66
  7. data/Rakefile +2 -3
  8. data/bin/joybox +49 -0
  9. data/command/joybox/USAGE +24 -0
  10. data/command/joybox/templates/layer.erb +11 -0
  11. data/command/joybox/templates/layer_spec.erb +3 -0
  12. data/command/joybox/templates/scene.erb +11 -0
  13. data/command/joybox/templates/scene_spec.erb +3 -0
  14. data/command/joybox/templates/sprite.erb +11 -0
  15. data/command/joybox/templates/sprite_spec.erb +3 -0
  16. data/command/joybox_generate_command.rb +114 -0
  17. data/joybox.gemspec +44 -0
  18. data/lib/joybox/joybox-ios.rb +47 -0
  19. data/lib/joybox/joybox-osx.rb +47 -0
  20. data/lib/joybox/version.rb +1 -1
  21. data/lib/joybox.rb +18 -36
  22. data/{lib/joybox/cocos2d → motion/joybox}/actions/actions.rb +0 -0
  23. data/motion/joybox/actions/animate.rb +22 -0
  24. data/motion/joybox/actions/bezier.rb +33 -0
  25. data/motion/joybox/actions/blink.rb +24 -0
  26. data/motion/joybox/actions/ease.rb +149 -0
  27. data/motion/joybox/actions/fade.rb +38 -0
  28. data/motion/joybox/actions/jump.rb +39 -0
  29. data/{lib/joybox/cocos2d → motion/joybox}/actions/move.rb +4 -2
  30. data/motion/joybox/actions/place.rb +22 -0
  31. data/{lib/joybox/cocos2d → motion/joybox}/actions/repeat.rb +10 -1
  32. data/{lib/joybox/cocos2d → motion/joybox}/actions/rotate.rb +4 -2
  33. data/{lib/joybox/cocos2d → motion/joybox}/actions/scale.rb +4 -2
  34. data/{lib/joybox/cocos2d → motion/joybox}/actions/sequence.rb +3 -3
  35. data/{lib/joybox/cocos2d → motion/joybox}/actions/skew.rb +0 -0
  36. data/motion/joybox/actions/spawn.rb +22 -0
  37. data/motion/joybox/actions/tint.rb +37 -0
  38. data/motion/joybox/animations/animation.rb +60 -0
  39. data/{lib/joybox/cocos2d → motion/joybox}/common/color.rb +12 -1
  40. data/{lib/joybox/cocos2d → motion/joybox}/common/gc_size.rb +4 -4
  41. data/{lib/joybox/cocos2d → motion/joybox}/common/ns_set.rb +0 -0
  42. data/{lib/joybox/cocos2d → motion/joybox}/common/numeric.rb +0 -0
  43. data/{lib/joybox/cocos2d → motion/joybox}/common/screen.rb +4 -4
  44. data/motion/joybox/core/layer.rb +51 -0
  45. data/{lib/joybox/cocos2d → motion/joybox}/core/node.rb +0 -0
  46. data/{lib/joybox/cocos2d → motion/joybox}/core/scene.rb +0 -0
  47. data/{lib/joybox/cocos2d → motion/joybox}/core/sprite.rb +22 -3
  48. data/{lib/joybox/cocos2d → motion/joybox}/core/sprite_batch.rb +0 -0
  49. data/motion/joybox/core/sprite_frame_cache.rb +147 -0
  50. data/{lib/joybox/cocos2d/cocos2d.rb → motion/joybox/joybox.rb} +3 -1
  51. data/{lib/joybox/cocos2d → motion/joybox}/macros.rb +0 -0
  52. data/{lib/joybox/box2d → motion/joybox/physics}/body.rb +44 -17
  53. data/{lib/joybox/cocos2d/core → motion/joybox/physics}/physics_sprite.rb +1 -1
  54. data/motion/joybox/physics/world.rb +79 -0
  55. data/{lib/joybox/cocos2d → motion/joybox}/ui/label.rb +3 -2
  56. data/{lib/joybox/cocos2d → motion/joybox}/ui/menu.rb +0 -0
  57. data/{lib/joybox/cocos2d → motion/joybox}/ui/menu_image.rb +0 -0
  58. data/{lib/joybox/cocos2d → motion/joybox}/ui/menu_label.rb +0 -0
  59. data/{lib/joybox/cocos2d → motion/joybox}/ui/ui.rb +0 -0
  60. data/{lib/joybox/cocos2d → motion/joybox-ios}/common/cg_point.rb +9 -2
  61. data/{lib/joybox/cocos2d → motion/joybox-ios}/common/ui_touch.rb +1 -1
  62. data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/configuration.rb +0 -0
  63. data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/file_utils.rb +0 -3
  64. data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/gl_view.rb +0 -0
  65. data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/texture_2d.rb +0 -0
  66. data/{lib/joybox/cocos2d → motion/joybox-ios}/core/layer.rb +1 -45
  67. data/{lib/joybox/cocos2d → motion/joybox-ios}/director.rb +6 -6
  68. data/motion/joybox-osx/common/ats_point.rb +48 -0
  69. data/motion/joybox-osx/common/ns_event.rb +8 -0
  70. data/motion/joybox-osx/configuration/configuration.rb +46 -0
  71. data/motion/joybox-osx/configuration/gl_view.rb +57 -0
  72. data/motion/joybox-osx/core/layer.rb +135 -0
  73. data/motion/joybox-osx/director.rb +42 -0
  74. data/template/joybox-ios/files/Rakefile.erb +9 -0
  75. data/{app → template/joybox-ios/files/app}/app_delegate.rb +1 -5
  76. data/{resources → template/joybox-ios/files/resources}/fps_images-hd.png +0 -0
  77. data/{resources → template/joybox-ios/files/resources}/fps_images-ipadhd.png +0 -0
  78. data/{resources → template/joybox-ios/files/resources}/fps_images.png +0 -0
  79. data/template/joybox-ios/files/spec/main_spec.rb.erb +9 -0
  80. data/template/joybox-osx/files/Rakefile.erb +9 -0
  81. data/template/joybox-osx/files/app/app_delegate.rb +23 -0
  82. data/template/joybox-osx/files/app/layers/default_layer.rb +5 -0
  83. data/template/joybox-osx/files/app/menu.rb +51 -0
  84. data/template/joybox-osx/files/resources/Credits.rtf +29 -0
  85. data/template/joybox-osx/files/resources/fps_images-hd.png +0 -0
  86. data/template/joybox-osx/files/resources/fps_images-ipadhd.png +0 -0
  87. data/template/joybox-osx/files/resources/fps_images.png +0 -0
  88. data/template/joybox-osx/files/spec/main_spec.rb.erb +9 -0
  89. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Box2D +0 -0
  90. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Box2D.framework.bridgesupport +47 -37
  91. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Box2D +0 -0
  92. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/B2DContactListener.h +0 -0
  93. data/vendor/vendor-ios/Box2D.framework/Versions/A/Headers/Collision/Shapes/B2DCircleShape.h +16 -0
  94. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/Shapes/B2DEdgeShape.h +0 -0
  95. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/Shapes/B2DPolygonShape.h +0 -0
  96. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/Shapes/B2DShape.h +0 -0
  97. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Dynamics/B2DBody.h +6 -6
  98. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Dynamics/B2DWorld.h +0 -0
  99. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Resources/Box2DConfig.cmake +0 -0
  100. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Resources/CMakeLists.txt +0 -0
  101. data/vendor/vendor-ios/Box2D.framework/Versions/A/Resources/LICENSE +22 -0
  102. data/vendor/vendor-ios/cocos_2d/cocos_2d.bridgesupport +9154 -0
  103. data/vendor/vendor-ios/cocos_2d/cocos_2d_exceptions.bridgesupport +39 -0
  104. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAction.h +23 -23
  105. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionCamera.h +21 -19
  106. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionCatmullRom.h +18 -6
  107. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionEase.h +117 -31
  108. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionGrid.h +19 -17
  109. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionGrid3D.h +45 -42
  110. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionInstant.h +21 -13
  111. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionInterval.h +123 -81
  112. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionManager.h +2 -2
  113. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionPageTurn3D.h +2 -1
  114. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionProgressTimer.h +4 -4
  115. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionTiledGrid.h +46 -38
  116. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionTween.h +3 -3
  117. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAnimation.h +8 -8
  118. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAnimationCache.h +2 -2
  119. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAtlasNode.h +19 -17
  120. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCCamera.h +12 -12
  121. data/vendor/vendor-ios/cocos_2d/include/CCClippingNode.h +77 -0
  122. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCConfiguration.h +31 -13
  123. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCDirector.h +51 -42
  124. data/vendor/vendor-ios/cocos_2d/include/CCDrawNode.h +65 -0
  125. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCDrawingPrimitives.h +42 -8
  126. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCGLProgram.h +56 -21
  127. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCGrabber.h +2 -2
  128. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCGrid.h +29 -29
  129. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLabelAtlas.h +5 -2
  130. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLabelBMFont.h +56 -32
  131. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLabelTTF.h +20 -20
  132. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLayer.h +107 -79
  133. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCMenu.h +10 -14
  134. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCMenuItem.h +37 -32
  135. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCMotionStreak.h +18 -19
  136. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCNode+Debug.h +0 -0
  137. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCNode.h +87 -37
  138. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParallaxNode.h +2 -2
  139. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleBatchNode.h +2 -2
  140. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleExamples.h +22 -0
  141. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleSystem.h +51 -40
  142. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleSystemQuad.h +4 -4
  143. data/vendor/vendor-ios/cocos_2d/include/CCPhysicsDebugNode.h +58 -0
  144. data/vendor/vendor-ios/cocos_2d/include/CCPhysicsSprite.h +82 -0
  145. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCProgressTimer.h +9 -11
  146. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCProtocols.h +54 -26
  147. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCRenderTexture.h +29 -9
  148. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCScene.h +4 -0
  149. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCScheduler.h +94 -40
  150. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCShaderCache.h +1 -1
  151. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSprite.h +21 -28
  152. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSpriteBatchNode.h +16 -9
  153. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSpriteFrame.h +10 -10
  154. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSpriteFrameCache.h +6 -6
  155. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXLayer.h +16 -16
  156. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXObjectGroup.h +4 -4
  157. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXTiledMap.h +9 -9
  158. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXXMLParser.h +44 -33
  159. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTexture2D.h +17 -25
  160. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTextureAtlas.h +10 -10
  161. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTextureCache.h +4 -4
  162. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTexturePVR.h +25 -8
  163. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTileMapAtlas.h +6 -6
  164. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTransition.h +57 -12
  165. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTransitionPageTurn.h +2 -2
  166. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTransitionProgress.h +27 -5
  167. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms}/CCGL.h +4 -2
  168. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms}/CCNS.h +0 -0
  169. data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCDirectorMac.h +110 -0
  170. data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCEventDispatcher.h +343 -0
  171. data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCGLView.h +103 -0
  172. data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCWindow.h +41 -0
  173. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCDirectorIOS.h +12 -5
  174. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCES2Renderer.h +12 -12
  175. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCESRenderer.h +0 -0
  176. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCGLView.h +28 -13
  177. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCTouchDelegateProtocol.h +4 -4
  178. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCTouchDispatcher.h +2 -2
  179. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCTouchHandler.h +7 -7
  180. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CCArray.h +1 -1
  181. data/vendor/vendor-ios/cocos_2d/include/Support/CCFileUtils.h +394 -0
  182. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CCProfiling.h +0 -0
  183. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CCVertex.h +1 -1
  184. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CGPointExtension.h +4 -2
  185. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/NSThread+performBlock.h +0 -0
  186. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/OpenGL_Internal.h +0 -0
  187. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/TGAlib.h +0 -0
  188. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/TransformUtils.h +0 -0
  189. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/ZipUtils.h +4 -4
  190. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/base64.h +0 -0
  191. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/ccCArray.h +15 -15
  192. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/ccUtils.h +0 -0
  193. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/uthash.h +129 -184
  194. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/utlist.h +298 -55
  195. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccConfig.h +56 -9
  196. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccDeprecated.h +131 -0
  197. data/vendor/vendor-ios/cocos_2d/include/ccFPSImages.h +39 -0
  198. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccGLStateCache.h +44 -26
  199. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccMacros.h +9 -9
  200. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColorLengthTexture_frag.h +41 -0
  201. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColorLengthTexture_vert.h +47 -0
  202. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColor_frag.h +37 -0
  203. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColor_vert.h +40 -0
  204. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureA8Color_frag.h +41 -0
  205. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureA8Color_vert.h +45 -0
  206. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureColorAlphaTest_frag.h +47 -0
  207. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureColor_frag.h +39 -0
  208. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureColor_vert.h +45 -0
  209. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_frag.h +38 -0
  210. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_uColor_frag.h +41 -0
  211. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_uColor_vert.h +41 -0
  212. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_vert.h +41 -0
  213. data/vendor/vendor-ios/cocos_2d/include/ccShader_Position_uColor_frag.h +37 -0
  214. data/vendor/vendor-ios/cocos_2d/include/ccShader_Position_uColor_vert.h +43 -0
  215. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccShaders.h +11 -0
  216. data/vendor/vendor-ios/cocos_2d/include/ccTypes.h +392 -0
  217. data/vendor/vendor-ios/cocos_2d/include/cocos2d-ios-exceptions.bridgesupport +39 -0
  218. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/cocos2d.h +28 -3
  219. data/vendor/vendor-ios/cocos_2d/include/gen_cocos2d_bridgesupport.sh +17 -0
  220. data/vendor/vendor-ios/cocos_2d/include/gen_cocos2d_complement.sh +17 -0
  221. data/vendor/vendor-ios/cocos_2d/libcocos2d.a +0 -0
  222. data/vendor/vendor-osx/box_2d/box_2d.bridgesupport +176 -0
  223. data/vendor/vendor-osx/box_2d/include/B2DBody.h +46 -0
  224. data/vendor/vendor-osx/box_2d/include/B2DCircleShape.h +16 -0
  225. data/vendor/vendor-osx/box_2d/include/B2DContactListener.h +30 -0
  226. data/vendor/vendor-osx/box_2d/include/B2DEdgeShape.h +17 -0
  227. data/vendor/vendor-osx/box_2d/include/B2DPolygonShape.h +16 -0
  228. data/vendor/vendor-osx/box_2d/include/B2DShape.h +18 -0
  229. data/vendor/vendor-osx/box_2d/include/B2DWorld.h +44 -0
  230. data/vendor/vendor-osx/box_2d/libBox2D.a +0 -0
  231. data/vendor/vendor-osx/cocos_2d/cocos_2d.bridgesupport +8292 -0
  232. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAction.h +195 -0
  233. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionCamera.h +75 -0
  234. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionCatmullRom.h +151 -0
  235. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionEase.h +245 -0
  236. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionGrid.h +167 -0
  237. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionGrid3D.h +208 -0
  238. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionInstant.h +235 -0
  239. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionInterval.h +473 -0
  240. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionManager.h +113 -0
  241. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionPageTurn3D.h +43 -0
  242. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionProgressTimer.h +59 -0
  243. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionTiledGrid.h +219 -0
  244. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionTween.h +62 -0
  245. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAnimation.h +150 -0
  246. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAnimationCache.h +74 -0
  247. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAtlasNode.h +98 -0
  248. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCCamera.h +98 -0
  249. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCClippingNode.h +77 -0
  250. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCConfiguration.h +144 -0
  251. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCDirector.h +353 -0
  252. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCDrawNode.h +65 -0
  253. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCDrawingPrimitives.h +173 -0
  254. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCGLProgram.h +185 -0
  255. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCGrabber.h +44 -0
  256. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCGrid.h +130 -0
  257. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelAtlas.h +71 -0
  258. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelBMFont.h +240 -0
  259. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelTTF.h +132 -0
  260. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLayer.h +308 -0
  261. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMenu.h +96 -0
  262. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMenuItem.h +428 -0
  263. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMotionStreak.h +86 -0
  264. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCNode+Debug.h +39 -0
  265. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCNode.h +619 -0
  266. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParallaxNode.h +50 -0
  267. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleBatchNode.h +99 -0
  268. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleExamples.h +117 -0
  269. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleSystem.h +464 -0
  270. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleSystemQuad.h +73 -0
  271. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCPhysicsDebugNode.h +58 -0
  272. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCPhysicsSprite.h +82 -0
  273. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCProgressTimer.h +92 -0
  274. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCProtocols.h +160 -0
  275. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCRenderTexture.h +159 -0
  276. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCScene.h +47 -0
  277. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCScheduler.h +284 -0
  278. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCShaderCache.h +60 -0
  279. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSprite.h +281 -0
  280. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSpriteBatchNode.h +145 -0
  281. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSpriteFrame.h +126 -0
  282. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSpriteFrameCache.h +121 -0
  283. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXLayer.h +164 -0
  284. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXObjectGroup.h +67 -0
  285. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXTiledMap.h +145 -0
  286. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXXMLParser.h +228 -0
  287. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTexture2D.h +349 -0
  288. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTextureAtlas.h +188 -0
  289. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTextureCache.h +146 -0
  290. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTexturePVR.h +146 -0
  291. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTileMapAtlas.h +83 -0
  292. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTransition.h +341 -0
  293. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTransitionPageTurn.h +60 -0
  294. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTransitionProgress.h +84 -0
  295. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/CCGL.h +74 -0
  296. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/CCNS.h +54 -0
  297. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCDirectorMac.h +110 -0
  298. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCEventDispatcher.h +343 -0
  299. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCGLView.h +103 -0
  300. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCWindow.h +41 -0
  301. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCArray.h +119 -0
  302. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCFileUtils.h +394 -0
  303. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCProfiling.h +89 -0
  304. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCVertex.h +36 -0
  305. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CGPointExtension.h +346 -0
  306. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/NSThread+performBlock.h +22 -0
  307. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/OpenGL_Internal.h +86 -0
  308. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/TGAlib.h +55 -0
  309. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/TransformUtils.h +36 -0
  310. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/ZipUtils.h +91 -0
  311. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/base64.h +33 -0
  312. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/ccCArray.h +229 -0
  313. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/ccUtils.h +36 -0
  314. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/uthash.h +917 -0
  315. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/utlist.h +733 -0
  316. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccConfig.h +292 -0
  317. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccDeprecated.h +431 -0
  318. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccFPSImages.h +39 -0
  319. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccGLStateCache.h +156 -0
  320. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccMacros.h +353 -0
  321. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColorLengthTexture_frag.h +41 -0
  322. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColorLengthTexture_vert.h +47 -0
  323. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColor_frag.h +37 -0
  324. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColor_vert.h +40 -0
  325. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureA8Color_frag.h +41 -0
  326. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureA8Color_vert.h +45 -0
  327. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureColorAlphaTest_frag.h +47 -0
  328. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureColor_frag.h +39 -0
  329. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureColor_vert.h +45 -0
  330. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_frag.h +38 -0
  331. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_uColor_frag.h +41 -0
  332. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_uColor_vert.h +41 -0
  333. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_vert.h +41 -0
  334. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_Position_uColor_frag.h +37 -0
  335. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_Position_uColor_vert.h +43 -0
  336. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShaders.h +56 -0
  337. data/vendor/{Cocos2D/include → vendor-osx/cocos_2d/cocos_2d_include}/ccTypes.h +39 -35
  338. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/cocos2d.h +203 -0
  339. data/vendor/vendor-osx/cocos_2d/libcocos2d.a +0 -0
  340. metadata +363 -195
  341. data/app/layers/box2d_layer.rb +0 -109
  342. data/app/layers/cocos2d_layer.rb +0 -14
  343. data/app/layers/cocos_motion_layer.rb +0 -145
  344. data/app/layers/menu_layer.rb +0 -59
  345. data/lib/joybox/box2d/world.rb +0 -79
  346. data/resources/box2d/blocks_sprite_sheet.png +0 -0
  347. data/resources/cocos_motion/dot.png +0 -0
  348. data/resources/cocos_motion/dot_selected.png +0 -0
  349. data/resources/cocos_motion/grossini.png +0 -0
  350. data/resources/cocos_motion/grossinis_sister.png +0 -0
  351. data/resources/cocos_motion/grossinis_sister_two.png +0 -0
  352. data/resources/cocos_motion/left_arrow.png +0 -0
  353. data/resources/cocos_motion/left_arrow_selected.png +0 -0
  354. data/resources/cocos_motion/right_arrow.png +0 -0
  355. data/resources/cocos_motion/right_arrow_selected.png +0 -0
  356. data/vendor/Cocos2D/Cocos2D.bridgesupport +0 -7808
  357. data/vendor/Cocos2D/include/CCFileUtils.h +0 -188
  358. data/vendor/Cocos2D/include/CocosDenshion/CDAudioManager.h +0 -243
  359. data/vendor/Cocos2D/include/CocosDenshion/CDConfig.h +0 -60
  360. data/vendor/Cocos2D/include/CocosDenshion/CDOpenALSupport.h +0 -77
  361. data/vendor/Cocos2D/include/CocosDenshion/CDXPropertyModifierAction.h +0 -45
  362. data/vendor/Cocos2D/include/CocosDenshion/CocosDenshion.h +0 -440
  363. data/vendor/Cocos2D/include/CocosDenshion/SimpleAudioEngine.h +0 -90
  364. data/vendor/Cocos2D/include/RubyMotionSchedule.h +0 -7
  365. data/vendor/Cocos2D/include/ccShader_PositionColor_frag.h +0 -12
  366. data/vendor/Cocos2D/include/ccShader_PositionColor_vert.h +0 -17
  367. data/vendor/Cocos2D/include/ccShader_PositionTextureA8Color_frag.h +0 -16
  368. data/vendor/Cocos2D/include/ccShader_PositionTextureA8Color_vert.h +0 -21
  369. data/vendor/Cocos2D/include/ccShader_PositionTextureColorAlphaTest_frag.h +0 -23
  370. data/vendor/Cocos2D/include/ccShader_PositionTextureColor_frag.h +0 -14
  371. data/vendor/Cocos2D/include/ccShader_PositionTextureColor_vert.h +0 -22
  372. data/vendor/Cocos2D/include/ccShader_PositionTexture_frag.h +0 -13
  373. data/vendor/Cocos2D/include/ccShader_PositionTexture_uColor_frag.h +0 -16
  374. data/vendor/Cocos2D/include/ccShader_PositionTexture_uColor_vert.h +0 -18
  375. data/vendor/Cocos2D/include/ccShader_PositionTexture_vert.h +0 -17
  376. data/vendor/Cocos2D/include/ccShader_Position_uColor_frag.h +0 -12
  377. data/vendor/Cocos2D/include/ccShader_Position_uColor_vert.h +0 -19
  378. data/vendor/Cocos2D/include/kazmath/GL/mat4stack.h +0 -51
  379. data/vendor/Cocos2D/include/kazmath/GL/matrix.h +0 -58
  380. data/vendor/Cocos2D/include/kazmath/aabb.h +0 -53
  381. data/vendor/Cocos2D/include/kazmath/kazmath.h +0 -39
  382. data/vendor/Cocos2D/include/kazmath/mat3.h +0 -75
  383. data/vendor/Cocos2D/include/kazmath/mat4.h +0 -93
  384. data/vendor/Cocos2D/include/kazmath/neon_matrix_impl.h +0 -41
  385. data/vendor/Cocos2D/include/kazmath/plane.h +0 -70
  386. data/vendor/Cocos2D/include/kazmath/quaternion.h +0 -113
  387. data/vendor/Cocos2D/include/kazmath/ray2.h +0 -50
  388. data/vendor/Cocos2D/include/kazmath/utility.h +0 -74
  389. data/vendor/Cocos2D/include/kazmath/vec2.h +0 -64
  390. data/vendor/Cocos2D/include/kazmath/vec3.h +0 -68
  391. data/vendor/Cocos2D/include/kazmath/vec4.h +0 -68
  392. data/vendor/Cocos2D/libCocosDenshion.a +0 -0
  393. data/vendor/Cocos2D/libcocos2d.a +0 -0
@@ -0,0 +1,619 @@
1
+ /*
2
+ * cocos2d for iPhone: http://www.cocos2d-iphone.org
3
+ *
4
+ * Copyright (c) 2009 Valentin Milea
5
+ *
6
+ * Copyright (c) 2008-2010 Ricardo Quesada
7
+ * Copyright (c) 2011 Zynga Inc.
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
+
28
+ #import "Platforms/CCGL.h"
29
+ #import "ccTypes.h"
30
+ #import "CCProtocols.h"
31
+ #import "ccConfig.h"
32
+ #import "ccGLStateCache.h"
33
+ #import "Support/CCArray.h"
34
+ #import "kazmath/kazmath.h"
35
+
36
+ enum {
37
+ kCCNodeTagInvalid = -1,
38
+ };
39
+
40
+ @class CCCamera;
41
+ @class CCGridBase;
42
+ @class CCGLProgram;
43
+ @class CCScheduler;
44
+ @class CCActionManager;
45
+ @class CCAction;
46
+
47
+ /** CCNode is the main element. Anything thats gets drawn or contains things that get drawn is a CCNode.
48
+ The most popular CCNodes are: CCScene, CCLayer, CCSprite, CCMenu.
49
+
50
+ The main features of a CCNode are:
51
+ - They can contain other CCNode nodes (addChild, getChildByTag, removeChild, etc)
52
+ - They can schedule periodic callback (schedule, unschedule, etc)
53
+ - They can execute actions (runAction, stopAction, etc)
54
+
55
+ Some CCNode nodes provide extra functionality for them or their children.
56
+
57
+ Subclassing a CCNode usually means (one/all) of:
58
+ - overriding init to initialize resources and schedule callbacks
59
+ - create callbacks to handle the advancement of time
60
+ - overriding draw to render the node
61
+
62
+ Features of CCNode:
63
+ - position
64
+ - scale (x, y)
65
+ - rotation (in degrees, clockwise)
66
+ - CCCamera (an interface to gluLookAt )
67
+ - CCGridBase (to do mesh transformations)
68
+ - anchor point
69
+ - size
70
+ - visible
71
+ - z-order
72
+ - openGL z position
73
+
74
+ Default values:
75
+ - rotation: 0
76
+ - position: (x=0,y=0)
77
+ - scale: (x=1,y=1)
78
+ - contentSize: (x=0,y=0)
79
+ - anchorPoint: (x=0,y=0)
80
+
81
+ Limitations:
82
+ - A CCNode is a "void" object. It doesn't have a texture
83
+
84
+ Order in transformations with grid disabled
85
+ -# The node will be translated (position)
86
+ -# The node will be rotated (rotation)
87
+ -# The node will be skewed (skewX, skewY)
88
+ -# The node will be scaled (scale, scaleX, scaleY)
89
+ -# The node will be moved according to the camera values (camera)
90
+
91
+ Order in transformations with grid enabled
92
+ -# The node will be translated (position)
93
+ -# The node will be rotated (rotation, rotationX, rotationY)
94
+ -# The node will be skewed (skewX, skewY)
95
+ -# The node will be scaled (scale, scaleX, scaleY)
96
+ -# The grid will capture the screen
97
+ -# The node will be moved according to the camera values (camera)
98
+ -# The grid will render the captured screen
99
+
100
+ Camera:
101
+ - Each node has a camera. By default it points to the center of the CCNode.
102
+ */
103
+ @interface CCNode : NSObject
104
+ {
105
+ // rotation angle
106
+ float _rotationX, _rotationY;
107
+
108
+ // scaling factors
109
+ float _scaleX, _scaleY;
110
+
111
+ // openGL real Z vertex
112
+ float _vertexZ;
113
+
114
+ // position of the node
115
+ CGPoint _position;
116
+
117
+ // skew angles
118
+ float _skewX, _skewY;
119
+
120
+ // anchor point in points
121
+ CGPoint _anchorPointInPoints;
122
+ // anchor point normalized (NOT in points)
123
+ CGPoint _anchorPoint;
124
+
125
+ // untransformed size of the node
126
+ CGSize _contentSize;
127
+
128
+ // transform
129
+ CGAffineTransform _transform, _inverse;
130
+ BOOL _isTransformDirty;
131
+ BOOL _isInverseDirty;
132
+
133
+ // a Camera
134
+ CCCamera *_camera;
135
+
136
+ // a Grid
137
+ CCGridBase *_grid;
138
+
139
+ // z-order value
140
+ NSInteger _zOrder;
141
+
142
+ // array of children
143
+ CCArray *_children;
144
+
145
+ // weak ref to parent
146
+ CCNode *_parent;
147
+
148
+ // a tag. any number you want to assign to the node
149
+ NSInteger _tag;
150
+
151
+ // user data field
152
+ void *_userData;
153
+ id _userObject;
154
+
155
+ // Shader
156
+ CCGLProgram *_shaderProgram;
157
+
158
+ // Server side state
159
+ ccGLServerState _glServerState;
160
+
161
+ // used to preserve sequence while sorting children with the same zOrder
162
+ NSUInteger _orderOfArrival;
163
+
164
+ // scheduler used to schedule timers and updates
165
+ CCScheduler *_scheduler;
166
+
167
+ // ActionManager used to handle all the actions
168
+ CCActionManager *_actionManager;
169
+
170
+ // Is running
171
+ BOOL _isRunning;
172
+
173
+ // is visible
174
+ BOOL _visible;
175
+ // If YES, the Anchor Point will be (0,0) when you position the CCNode.
176
+ // Used by CCLayer and CCScene
177
+ BOOL _ignoreAnchorPointForPosition;
178
+
179
+ BOOL _isReorderChildDirty;
180
+ }
181
+
182
+ /** The z order of the node relative to its "siblings": children of the same parent */
183
+ @property(nonatomic,assign) NSInteger zOrder;
184
+ /** The real openGL Z vertex.
185
+ Differences between openGL Z vertex and cocos2d Z order:
186
+ - OpenGL Z modifies the Z vertex, and not the Z order in the relation between parent-children
187
+ - OpenGL Z might require to set 2D projection
188
+ - cocos2d Z order works OK if all the nodes uses the same openGL Z vertex. eg: vertexZ = 0
189
+ @warning: Use it at your own risk since it might break the cocos2d parent-children z order
190
+ @since v0.8
191
+ */
192
+ @property (nonatomic,readwrite) float vertexZ;
193
+
194
+ /** The X skew angle of the node in degrees.
195
+ This angle describes the shear distortion in the X direction.
196
+ Thus, it is the angle between the Y axis and the left edge of the shape
197
+ The default skewX angle is 0. Positive values distort the node in a CW direction.
198
+ */
199
+ @property(nonatomic,readwrite,assign) float skewX;
200
+
201
+ /** The Y skew angle of the node in degrees.
202
+ This angle describes the shear distortion in the Y direction.
203
+ Thus, it is the angle between the X axis and the bottom edge of the shape
204
+ The default skewY angle is 0. Positive values distort the node in a CCW direction.
205
+ */
206
+ @property(nonatomic,readwrite,assign) float skewY;
207
+ /** The rotation (angle) of the node in degrees. 0 is the default rotation angle. Positive values rotate node CW. */
208
+ @property(nonatomic,readwrite,assign) float rotation;
209
+ /** The rotation (angle) of the node in degrees. 0 is the default rotation angle. Positive values rotate node CW. It only modifies the X rotation performing a horizontal rotational skew . */
210
+ @property(nonatomic,readwrite,assign) float rotationX;
211
+ /** The rotation (angle) of the node in degrees. 0 is the default rotation angle. Positive values rotate node CW. It only modifies the Y rotation performing a vertical rotational skew . */
212
+ @property(nonatomic,readwrite,assign) float rotationY;
213
+
214
+ /** The scale factor of the node. 1.0 is the default scale factor. It modifies the X and Y scale at the same time. */
215
+ @property(nonatomic,readwrite,assign) float scale;
216
+ /** The scale factor of the node. 1.0 is the default scale factor. It only modifies the X scale factor. */
217
+ @property(nonatomic,readwrite,assign) float scaleX;
218
+ /** The scale factor of the node. 1.0 is the default scale factor. It only modifies the Y scale factor. */
219
+ @property(nonatomic,readwrite,assign) float scaleY;
220
+ /** Position (x,y) of the node in points. (0,0) is the left-bottom corner. */
221
+ @property(nonatomic,readwrite,assign) CGPoint position;
222
+ /** A CCCamera object that lets you move the node using a gluLookAt */
223
+ @property(nonatomic,readonly) CCCamera* camera;
224
+ /** Array of children */
225
+ @property(nonatomic,readonly) CCArray *children;
226
+ /** A CCGrid object that is used when applying effects */
227
+ @property(nonatomic,readwrite,retain) CCGridBase* grid;
228
+ /** Whether of not the node is visible. Default is YES */
229
+ @property(nonatomic,readwrite,assign) BOOL visible;
230
+ /** anchorPoint is the point around which all transformations and positioning manipulations take place.
231
+ It's like a pin in the node where it is "attached" to its parent.
232
+ The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner.
233
+ But you can use values higher than (1,1) and lower than (0,0) too.
234
+ The default anchorPoint is (0,0). It starts in the bottom-left corner. CCSprite and other subclasses have a different default anchorPoint.
235
+ @since v0.8
236
+ */
237
+ @property(nonatomic,readwrite) CGPoint anchorPoint;
238
+ /** The anchorPoint in absolute pixels.
239
+ Since v0.8 you can only read it. If you wish to modify it, use anchorPoint instead
240
+ */
241
+ @property(nonatomic,readonly) CGPoint anchorPointInPoints;
242
+
243
+ /** The untransformed size of the node in Points
244
+ The contentSize remains the same no matter the node is scaled or rotated.
245
+ All nodes has a size. Layer and Scene has the same size of the screen.
246
+ @since v0.8
247
+ */
248
+ @property (nonatomic,readwrite) CGSize contentSize;
249
+
250
+ /** whether or not the node is running */
251
+ @property(nonatomic,readonly) BOOL isRunning;
252
+ /** A weak reference to the parent */
253
+ @property(nonatomic,readwrite,assign) CCNode* parent;
254
+ /** If YES, the Anchor Point will be (0,0) when you position the CCNode.
255
+ Used by CCLayer and CCScene.
256
+ */
257
+ @property(nonatomic,readwrite,assign) BOOL ignoreAnchorPointForPosition;
258
+ /** A tag used to identify the node easily */
259
+ @property(nonatomic,readwrite,assign) NSInteger tag;
260
+ /** A custom user data pointer */
261
+ @property(nonatomic,readwrite,assign) void* userData;
262
+ /** Similar to userData, but instead of holding a void* it holds an id */
263
+ @property(nonatomic,readwrite,retain) id userObject;
264
+
265
+ /** Shader Program
266
+ @since v2.0
267
+ */
268
+ @property(nonatomic,readwrite,retain) CCGLProgram *shaderProgram;
269
+
270
+ /** used internally for zOrder sorting, don't change this manually */
271
+ @property(nonatomic,readwrite) NSUInteger orderOfArrival;
272
+
273
+ /** GL server side state
274
+ @since v2.0
275
+ */
276
+ @property (nonatomic, readwrite) ccGLServerState glServerState;
277
+
278
+ /** CCActionManager used by all the actions.
279
+ IMPORTANT: If you set a new CCActionManager, then previously created actions are going to be removed.
280
+ @since v2.0
281
+ */
282
+ @property (nonatomic, readwrite, retain) CCActionManager *actionManager;
283
+
284
+ /** CCScheduler used to schedule all "updates" and timers.
285
+ IMPORTANT: If you set a new CCScheduler, then previously created timers/update are going to be removed.
286
+ @since v2.0
287
+ */
288
+ @property (nonatomic, readwrite, retain) CCScheduler *scheduler;
289
+
290
+ // initializators
291
+ /** allocates and initializes a node.
292
+ The node will be created as "autorelease".
293
+ */
294
+ +(id) node;
295
+ /** initializes the node */
296
+ -(id) init;
297
+
298
+ // scene management
299
+
300
+ /** Event that is called every time the CCNode enters the 'stage'.
301
+ If the CCNode enters the 'stage' with a transition, this event is called when the transition starts.
302
+ During onEnter you can't access a sibling node.
303
+ If you override onEnter, you shall call [super onEnter].
304
+ */
305
+ -(void) onEnter;
306
+
307
+ /** Event that is called when the CCNode enters in the 'stage'.
308
+ If the CCNode enters the 'stage' with a transition, this event is called when the transition finishes.
309
+ If you override onEnterTransitionDidFinish, you shall call [super onEnterTransitionDidFinish].
310
+ @since v0.8
311
+ */
312
+ -(void) onEnterTransitionDidFinish;
313
+
314
+ /** Event that is called every time the CCNode leaves the 'stage'.
315
+ If the CCNode leaves the 'stage' with a transition, this event is called when the transition finishes.
316
+ During onExit you can't access a sibling node.
317
+ If you override onExit, you shall call [super onExit].
318
+ */
319
+ -(void) onExit;
320
+
321
+ /** callback that is called every time the CCNode leaves the 'stage'.
322
+ If the CCNode leaves the 'stage' with a transition, this callback is called when the transition starts.
323
+ */
324
+ -(void) onExitTransitionDidStart;
325
+
326
+ // composition: ADD
327
+
328
+ /** Adds a child to the container with z-order as 0.
329
+ If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.
330
+ @since v0.7.1
331
+ */
332
+ -(void) addChild: (CCNode*)node;
333
+
334
+ /** Adds a child to the container with a z-order.
335
+ If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.
336
+ @since v0.7.1
337
+ */
338
+ -(void) addChild: (CCNode*)node z:(NSInteger)z;
339
+
340
+ /** Adds a child to the container with z order and tag.
341
+ If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.
342
+ @since v0.7.1
343
+ */
344
+ -(void) addChild: (CCNode*)node z:(NSInteger)z tag:(NSInteger)tag;
345
+
346
+ // composition: REMOVE
347
+
348
+ /** Remove itself from its parent node forcing a cleanup.
349
+ If the node orphan, then nothing happens.
350
+ @since v2.1
351
+ */
352
+ -(void) removeFromParent;
353
+
354
+ /** Remove itself from its parent node. If cleanup is YES, then also remove all actions and callbacks.
355
+ If the node orphan, then nothing happens.
356
+ @since v0.99.3
357
+ */
358
+ -(void) removeFromParentAndCleanup:(BOOL)cleanup;
359
+
360
+ /** Removes a child from the container forcing a cleanup
361
+ @since v2.1
362
+ */
363
+ -(void) removeChild:(CCNode*)child;
364
+
365
+ /** Removes a child from the container. It will also cleanup all running actions depending on the cleanup parameter.
366
+ @since v0.7.1
367
+ */
368
+ -(void) removeChild: (CCNode*)node cleanup:(BOOL)cleanup;
369
+
370
+ /** Removes a child from the container by tag value forcing a cleanup.
371
+ @since v2.1
372
+ */
373
+ -(void) removeChildByTag:(NSInteger) tag;
374
+
375
+ /** Removes a child from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter
376
+ @since v0.7.1
377
+ */
378
+ -(void) removeChildByTag:(NSInteger) tag cleanup:(BOOL)cleanup;
379
+
380
+ /** Removes all children from the container forcing a cleanup.
381
+ @since v2.1
382
+ */
383
+ -(void) removeAllChildren;
384
+
385
+ /** Removes all children from the container and do a cleanup all running actions depending on the cleanup parameter.
386
+ @since v0.7.1
387
+ */
388
+ -(void) removeAllChildrenWithCleanup:(BOOL)cleanup;
389
+
390
+ // composition: GET
391
+ /** Gets a child from the container given its tag
392
+ @return returns a CCNode object
393
+ @since v0.7.1
394
+ */
395
+ -(CCNode*) getChildByTag:(NSInteger) tag;
396
+
397
+ /** Reorders a child according to a new z value.
398
+ * The child MUST be already added.
399
+ */
400
+ -(void) reorderChild:(CCNode*)child z:(NSInteger)zOrder;
401
+
402
+ /** performance improvement, Sort the children array once before drawing, instead of every time when a child is added or reordered
403
+ don't call this manually unless a child added needs to be removed in the same frame */
404
+ - (void) sortAllChildren;
405
+
406
+ /** Event that is called when the running node is no longer running (eg: its CCScene is being removed from the "stage" ).
407
+ On cleanup you should break any possible circular references.
408
+ CCNode's cleanup removes any possible scheduled timer and/or any possible action.
409
+ If you override cleanup, you shall call [super cleanup]
410
+ @since v0.8
411
+ */
412
+ -(void) cleanup;
413
+
414
+ // draw
415
+
416
+ /** Override this method to draw your own node.
417
+ You should use cocos2d's GL API to enable/disable the GL state / shaders.
418
+ For further info, please see ccGLstate.h.
419
+ You shall NOT call [super draw];
420
+ */
421
+ -(void) draw;
422
+
423
+ /** recursive method that visit its children and draw them */
424
+ -(void) visit;
425
+
426
+ // transformations
427
+
428
+ /** performs OpenGL view-matrix transformation based on position, scale, rotation and other attributes. */
429
+ -(void) transform;
430
+
431
+ /** performs OpenGL view-matrix transformation of its ancestors.
432
+ Generally the ancestors are already transformed, but in certain cases (eg: attaching a FBO) it is necessary to transform the ancestors again.
433
+ @since v0.7.2
434
+ */
435
+ -(void) transformAncestors;
436
+
437
+ /** returns a "local" axis aligned bounding box of the node in points.
438
+ The returned box is relative only to its parent.
439
+ The returned box is in Points.
440
+
441
+ @since v0.8.2
442
+ */
443
+ - (CGRect) boundingBox;
444
+
445
+ // actions
446
+
447
+ /** Executes an action, and returns the action that is executed.
448
+ The node becomes the action's target.
449
+ @warning Starting from v0.8 actions don't retain their target anymore.
450
+ @since v0.7.1
451
+ @return An Action pointer
452
+ */
453
+ -(CCAction*) runAction: (CCAction*) action;
454
+ /** Removes all actions from the running action list */
455
+ -(void) stopAllActions;
456
+ /** Removes an action from the running action list */
457
+ -(void) stopAction: (CCAction*) action;
458
+ /** Removes an action from the running action list given its tag
459
+ @since v0.7.1
460
+ */
461
+ -(void) stopActionByTag:(NSInteger) tag;
462
+ /** Gets an action from the running action list given its tag
463
+ @since v0.7.1
464
+ @return the Action the with the given tag
465
+ */
466
+ -(CCAction*) getActionByTag:(NSInteger) tag;
467
+ /** Returns the numbers of actions that are running plus the ones that are schedule to run (actions in actionsToAdd and actions arrays).
468
+ * Composable actions are counted as 1 action. Example:
469
+ * If you are running 1 Sequence of 7 actions, it will return 1.
470
+ * If you are running 7 Sequences of 2 actions, it will return 7.
471
+ */
472
+ -(NSUInteger) numberOfRunningActions;
473
+
474
+ // timers
475
+
476
+ /** check whether a selector is scheduled. */
477
+ //-(BOOL) isScheduled: (SEL) selector;
478
+
479
+ /** schedules the "update" method. It will use the order number 0. This method will be called every frame.
480
+ Scheduled methods with a lower order value will be called before the ones that have a higher order value.
481
+ Only one "update" method could be scheduled per node.
482
+
483
+ @since v0.99.3
484
+ */
485
+ -(void) scheduleUpdate;
486
+
487
+ /** schedules the "update" selector with a custom priority. This selector will be called every frame.
488
+ Scheduled selectors with a lower priority will be called before the ones that have a higher value.
489
+ Only one "update" selector could be scheduled per node (You can't have 2 'update' selectors).
490
+
491
+ @since v0.99.3
492
+ */
493
+ -(void) scheduleUpdateWithPriority:(NSInteger)priority;
494
+
495
+ /* unschedules the "update" method.
496
+
497
+ @since v0.99.3
498
+ */
499
+ -(void) unscheduleUpdate;
500
+
501
+ /** schedules a selector.
502
+ The scheduled selector will be ticked every frame
503
+ */
504
+ -(void) schedule: (SEL) s;
505
+ /** schedules a custom selector with an interval time in seconds.
506
+ If time is 0 it will be ticked every frame.
507
+ If time is 0, it is recommended to use 'scheduleUpdate' instead.
508
+
509
+ If the selector is already scheduled, then the interval parameter will be updated without scheduling it again.
510
+ */
511
+ -(void) schedule: (SEL) s interval:(ccTime)seconds;
512
+ /**
513
+ repeat will execute the action repeat + 1 times, for a continues action use kCCRepeatForever
514
+ delay is the amount of time the action will wait before execution
515
+ */
516
+ -(void) schedule:(SEL)selector interval:(ccTime)interval repeat: (uint) repeat delay:(ccTime) delay;
517
+
518
+ /**
519
+ Schedules a selector that runs only once, with a delay of 0 or larger
520
+ */
521
+ - (void) scheduleOnce:(SEL) selector delay:(ccTime) delay;
522
+
523
+ /** unschedules a custom selector.*/
524
+ -(void) unschedule: (SEL) s;
525
+
526
+ /** unschedule all scheduled selectors: custom selectors, and the 'update' selector.
527
+ Actions are not affected by this method.
528
+ @since v0.99.3
529
+ */
530
+ -(void) unscheduleAllSelectors;
531
+
532
+ /** resumes all scheduled selectors and actions.
533
+ Called internally by onEnter
534
+ */
535
+ -(void) resumeSchedulerAndActions;
536
+ /** pauses all scheduled selectors and actions.
537
+ Called internally by onExit
538
+ */
539
+ -(void) pauseSchedulerAndActions;
540
+
541
+ /* Update will be called automatically every frame if "scheduleUpdate" is called, and the node is "live"
542
+ */
543
+ -(void) update:(ccTime)delta;
544
+
545
+ // transformation methods
546
+
547
+ /** Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates.
548
+ The matrix is in Pixels.
549
+ @since v0.7.1
550
+ */
551
+ - (CGAffineTransform)nodeToParentTransform;
552
+ /** Returns the matrix that transform parent's space coordinates to the node's (local) space coordinates.
553
+ The matrix is in Pixels.
554
+ @since v0.7.1
555
+ */
556
+ - (CGAffineTransform)parentToNodeTransform;
557
+ /** Returns the world affine transform matrix. The matrix is in Pixels.
558
+ @since v0.7.1
559
+ */
560
+ - (CGAffineTransform)nodeToWorldTransform;
561
+ /** Returns the inverse world affine transform matrix. The matrix is in Pixels.
562
+ @since v0.7.1
563
+ */
564
+ - (CGAffineTransform)worldToNodeTransform;
565
+ /** Converts a Point to node (local) space coordinates. The result is in Points.
566
+ @since v0.7.1
567
+ */
568
+ - (CGPoint)convertToNodeSpace:(CGPoint)worldPoint;
569
+ /** Converts a Point to world space coordinates. The result is in Points.
570
+ @since v0.7.1
571
+ */
572
+ - (CGPoint)convertToWorldSpace:(CGPoint)nodePoint;
573
+ /** Converts a Point to node (local) space coordinates. The result is in Points.
574
+ treating the returned/received node point as anchor relative.
575
+ @since v0.7.1
576
+ */
577
+ - (CGPoint)convertToNodeSpaceAR:(CGPoint)worldPoint;
578
+ /** Converts a local Point to world space coordinates.The result is in Points.
579
+ treating the returned/received node point as anchor relative.
580
+ @since v0.7.1
581
+ */
582
+ - (CGPoint)convertToWorldSpaceAR:(CGPoint)nodePoint;
583
+
584
+ #ifdef __CC_PLATFORM_IOS
585
+ /** Converts a UITouch to node (local) space coordinates. The result is in Points.
586
+ @since v0.7.1
587
+ */
588
+ - (CGPoint)convertTouchToNodeSpace:(UITouch *)touch;
589
+ /** Converts a UITouch to node (local) space coordinates. The result is in Points.
590
+ This method is AR (Anchor Relative)..
591
+ @since v0.7.1
592
+ */
593
+ - (CGPoint)convertTouchToNodeSpaceAR:(UITouch *)touch;
594
+ #endif // __CC_PLATFORM_IOS
595
+ @end
596
+
597
+
598
+ #pragma mark - CCNodeRGBA
599
+
600
+ /** CCNodeRGBA is a subclass of CCNode that implements the CCRGBAProtocol protocol.
601
+
602
+ All features from CCNode are valid, plus the following new features:
603
+ - opacity
604
+ - RGB colors
605
+
606
+ Opacity/Color propagates into children that conform to the CCRGBAProtocol if cascadeOpacity/cascadeColor is enabled.
607
+ @since v2.1
608
+ */
609
+ @interface CCNodeRGBA : CCNode <CCRGBAProtocol>
610
+ {
611
+ GLubyte _displayedOpacity, _realOpacity;
612
+ ccColor3B _displayedColor, _realColor;
613
+ BOOL _cascadeColorEnabled, _cascadeOpacityEnabled;
614
+ }
615
+
616
+ // XXX To make BridgeSupport happy
617
+ -(GLubyte) opacity;
618
+
619
+ @end
@@ -0,0 +1,50 @@
1
+ /*
2
+ * cocos2d for iPhone: http://www.cocos2d-iphone.org
3
+ *
4
+ * Copyright (c) 2009-2010 Ricardo Quesada
5
+ * Copyright (c) 2011 Zynga Inc.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ *
25
+ */
26
+
27
+ #import "CCNode.h"
28
+ #import "Support/ccCArray.h"
29
+
30
+ /** CCParallaxNode: A node that simulates a parallax scroller
31
+
32
+ The children will be moved faster / slower than the parent according the the parallax ratio.
33
+
34
+ */
35
+ @interface CCParallaxNode : CCNode
36
+ {
37
+ ccArray *_parallaxArray;
38
+ CGPoint _lastPosition;
39
+ }
40
+
41
+ /** array that holds the offset / ratio of the children */
42
+ @property (nonatomic,readwrite) ccArray * parallaxArray;
43
+
44
+ /** Adds a child to the container with a z-order, a parallax ratio and a position offset
45
+ It returns self, so you can chain several addChilds.
46
+ @since v0.8
47
+ */
48
+ -(void) addChild: (CCNode*)node z:(NSInteger)z parallaxRatio:(CGPoint)c positionOffset:(CGPoint)positionOffset;
49
+
50
+ @end