joybox 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. data/.travis.yml +3 -0
  2. data/Gemfile +2 -2
  3. data/Gemfile.lock +4 -4
  4. data/README.md +66 -22
  5. data/Rakefile +22 -4
  6. data/app/ios/app_delegate.rb +48 -0
  7. data/app/osx/app_delegate.rb +26 -0
  8. data/app/osx/layers/game_layer.rb +5 -0
  9. data/app/osx/menu.rb +51 -0
  10. data/command/command/image.rb +26 -0
  11. data/command/command/string.rb +15 -0
  12. data/command/command/template.rb +59 -0
  13. data/command/command/tmx.rb +75 -0
  14. data/command/joybox_generate_command.rb +64 -110
  15. data/command/joybox_retina_command.rb +87 -0
  16. data/command/{joybox/templates → templates}/layer.erb +0 -0
  17. data/command/{joybox/templates → templates}/layer_spec.erb +0 -0
  18. data/command/{joybox/templates → templates}/scene.erb +0 -0
  19. data/command/{joybox/templates → templates}/scene_spec.erb +0 -0
  20. data/command/{joybox/templates → templates}/sprite.erb +0 -0
  21. data/command/{joybox/templates → templates}/sprite_spec.erb +0 -0
  22. data/ext/extconf.rb +34 -0
  23. data/joybox.gemspec +103 -50
  24. data/lib/joybox.rb +2 -0
  25. data/lib/joybox/joybox-ios.rb +18 -3
  26. data/lib/joybox/joybox-osx.rb +18 -2
  27. data/lib/joybox/version.rb +1 -1
  28. data/motion/joybox-ios/common/cg_point.rb +46 -16
  29. data/motion/joybox-ios/common/device.rb +56 -0
  30. data/motion/joybox-ios/common/ui_touch.rb +0 -2
  31. data/motion/joybox-ios/configuration/configuration.rb +10 -40
  32. data/motion/joybox-ios/configuration/file_utils.rb +0 -4
  33. data/motion/joybox-ios/configuration/gl_view.rb +14 -20
  34. data/motion/joybox-ios/configuration/texture_2d.rb +0 -4
  35. data/motion/joybox-ios/core/layer.rb +2 -8
  36. data/motion/joybox-ios/debug/proxy_view.rb +5 -5
  37. data/motion/joybox-ios/debug/{node.rb → repl.rb} +25 -19
  38. data/motion/joybox-ios/director.rb +15 -4
  39. data/motion/joybox-osx/common/ats_point.rb +45 -15
  40. data/motion/joybox-osx/common/device.rb +30 -0
  41. data/motion/joybox-osx/common/ns_event.rb +0 -1
  42. data/motion/joybox-osx/configuration/configuration.rb +6 -26
  43. data/motion/joybox-osx/configuration/gl_view.rb +16 -14
  44. data/motion/joybox-osx/core/layer.rb +45 -26
  45. data/motion/joybox-osx/debug/proxy_view.rb +5 -5
  46. data/motion/joybox-osx/debug/{node.rb → repl.rb} +13 -7
  47. data/motion/joybox-osx/director.rb +4 -3
  48. data/motion/joybox/actions/animate.rb +0 -1
  49. data/motion/joybox/actions/bezier.rb +2 -9
  50. data/motion/joybox/actions/blink.rb +1 -4
  51. data/motion/joybox/actions/callback.rb +19 -0
  52. data/motion/joybox/actions/d3/flip.rb +27 -0
  53. data/motion/joybox/actions/d3/jump.rb +30 -0
  54. data/motion/joybox/actions/d3/lens.rb +30 -0
  55. data/motion/joybox/actions/d3/shake.rb +32 -0
  56. data/motion/joybox/actions/d3/shatter.rb +30 -0
  57. data/motion/joybox/actions/d3/wave.rb +33 -0
  58. data/motion/joybox/actions/delay.rb +19 -0
  59. data/motion/joybox/actions/ease.rb +3 -21
  60. data/motion/joybox/actions/fade.rb +30 -6
  61. data/motion/joybox/actions/jump.rb +0 -5
  62. data/motion/joybox/actions/liquid.rb +28 -0
  63. data/motion/joybox/actions/move.rb +2 -9
  64. data/motion/joybox/actions/place.rb +0 -2
  65. data/motion/joybox/actions/repeat.rb +0 -2
  66. data/motion/joybox/actions/rotate.rb +2 -9
  67. data/motion/joybox/actions/scale.rb +2 -9
  68. data/motion/joybox/actions/sequence.rb +0 -1
  69. data/motion/joybox/actions/shuffle.rb +26 -0
  70. data/motion/joybox/actions/skew.rb +2 -11
  71. data/motion/joybox/actions/spawn.rb +0 -1
  72. data/motion/joybox/actions/split.rb +24 -0
  73. data/motion/joybox/actions/tint.rb +0 -5
  74. data/motion/joybox/actions/turn.rb +24 -0
  75. data/motion/joybox/actions/twirl.rb +30 -0
  76. data/motion/joybox/actions/visibility.rb +21 -0
  77. data/motion/joybox/actions/wave.rb +32 -0
  78. data/motion/joybox/animations/animation.rb +7 -11
  79. data/motion/joybox/audio/audio.rb +31 -0
  80. data/motion/joybox/audio/audio_effect.rb +69 -0
  81. data/motion/joybox/audio/background_audio.rb +77 -0
  82. data/motion/joybox/common/{gc_size.rb → cg_size.rb} +13 -12
  83. data/motion/joybox/common/color.rb +4 -13
  84. data/motion/joybox/common/initialize.rb +11 -0
  85. data/motion/joybox/common/ns_array.rb +15 -0
  86. data/motion/joybox/common/ns_string.rb +7 -0
  87. data/motion/joybox/common/numeric.rb +13 -4
  88. data/motion/joybox/common/screen.rb +4 -12
  89. data/motion/joybox/configuration/debug.rb +29 -0
  90. data/motion/joybox/core/layer.rb +0 -24
  91. data/motion/joybox/core/layer_color.rb +47 -0
  92. data/motion/joybox/core/node.rb +18 -8
  93. data/motion/joybox/core/scene.rb +0 -5
  94. data/motion/joybox/core/sprite.rb +43 -25
  95. data/motion/joybox/core/sprite_batch.rb +15 -6
  96. data/motion/joybox/core/sprite_frame_cache.rb +9 -58
  97. data/motion/joybox/debug/physics.rb +40 -0
  98. data/motion/joybox/debug/physics_draw.rb +191 -0
  99. data/motion/joybox/joybox.rb +9 -1
  100. data/motion/joybox/macros.rb +13 -13
  101. data/motion/joybox/physics/aabb.rb +28 -0
  102. data/motion/joybox/physics/body.rb +163 -68
  103. data/motion/joybox/physics/chain_shape.rb +71 -0
  104. data/motion/joybox/physics/circle_shape.rb +31 -0
  105. data/motion/joybox/physics/edge_shape.rb +37 -0
  106. data/motion/joybox/physics/filter.rb +17 -0
  107. data/motion/joybox/physics/fixture.rb +52 -0
  108. data/motion/joybox/physics/mass_data.rb +19 -0
  109. data/motion/joybox/physics/physics_sprite.rb +50 -16
  110. data/motion/joybox/physics/polygon_shape.rb +54 -0
  111. data/motion/joybox/physics/profile.rb +14 -0
  112. data/motion/joybox/physics/ray_cast_input.rb +30 -0
  113. data/motion/joybox/physics/ray_cast_output.rb +17 -0
  114. data/motion/joybox/physics/shape.rb +61 -0
  115. data/motion/joybox/physics/transform.rb +17 -0
  116. data/motion/joybox/physics/world.rb +101 -30
  117. data/motion/joybox/tmx/object_layer.rb +12 -0
  118. data/motion/joybox/tmx/tile_layer.rb +74 -0
  119. data/motion/joybox/tmx/tile_map.rb +112 -0
  120. data/motion/joybox/tmx/tile_set.rb +26 -0
  121. data/motion/joybox/tmx/tmx.rb +16 -0
  122. data/motion/joybox/ui/label.rb +44 -16
  123. data/motion/joybox/ui/menu.rb +7 -9
  124. data/motion/joybox/ui/menu_image.rb +11 -8
  125. data/motion/joybox/ui/menu_label.rb +14 -13
  126. data/resources/Default-568h@2x.png +0 -0
  127. data/resources/animation_frames-hd.plist +126 -0
  128. data/resources/animation_frames-ipadhd.plist +126 -0
  129. data/resources/animation_frames.plist +126 -0
  130. data/resources/animation_sprite_sheet-hd.png +0 -0
  131. data/resources/animation_sprite_sheet-ipadhd.png +0 -0
  132. data/resources/animation_sprite_sheet.png +0 -0
  133. data/resources/fps_images-hd.png +0 -0
  134. data/resources/fps_images-ipadhd.png +0 -0
  135. data/resources/fps_images.png +0 -0
  136. data/resources/sprite.png +0 -0
  137. data/resources/sprite_inverted.png +0 -0
  138. data/resources/sprite_sheet.png +0 -0
  139. data/spec/motion/joybox-ios/common/screen_spec.rb +21 -0
  140. data/spec/{main_spec.rb → motion/joybox-ios/main_spec.rb} +6 -2
  141. data/spec/motion/joybox-ios/ui/label_spec.rb +20 -0
  142. data/spec/motion/joybox-ios/ui/menu_label_spec.rb +15 -0
  143. data/spec/motion/joybox-ios/ui/menu_spec.rb +87 -0
  144. data/spec/motion/joybox-osx/common/screen_spec.rb +21 -0
  145. data/spec/motion/joybox-osx/main_spec.rb +13 -0
  146. data/spec/motion/joybox-osx/ui/label_spec.rb +18 -0
  147. data/spec/motion/joybox-osx/ui/menu_label_spec.rb +13 -0
  148. data/spec/motion/joybox-osx/ui/menu_spec.rb +87 -0
  149. data/spec/motion/joybox/actions/actions_spec.rb +11 -0
  150. data/spec/motion/joybox/actions/bezier_spec.rb +37 -0
  151. data/spec/motion/joybox/actions/blink_spec.rb +16 -0
  152. data/spec/motion/joybox/actions/fade_spec.rb +49 -0
  153. data/spec/motion/joybox/actions/jump_spec.rb +37 -0
  154. data/spec/motion/joybox/actions/move_spec.rb +37 -0
  155. data/spec/motion/joybox/actions/place_spec.rb +12 -0
  156. data/spec/motion/joybox/actions/rotate_spec.rb +35 -0
  157. data/spec/motion/joybox/actions/scale_spec.rb +43 -0
  158. data/spec/motion/joybox/actions/skew_spec.rb +43 -0
  159. data/spec/motion/joybox/common/cg_size_spec.rb +29 -0
  160. data/spec/motion/joybox/common/color_spec.rb +31 -0
  161. data/spec/motion/joybox/common/ns_string_spec.rb +8 -0
  162. data/spec/motion/joybox/common/numeric_spec.rb +13 -0
  163. data/spec/motion/joybox/core/node_spec.rb +36 -0
  164. data/spec/motion/joybox/core/sprite_batch_spec.rb +34 -0
  165. data/spec/motion/joybox/core/sprite_frame_cache_spec.rb +111 -0
  166. data/spec/motion/joybox/core/sprite_spec.rb +121 -0
  167. data/spec/motion/joybox/macros_spec.rb +280 -0
  168. data/spec/motion/joybox/physics/aabb_spec.rb +17 -0
  169. data/spec/motion/joybox/physics/body_spec.rb +318 -0
  170. data/spec/motion/joybox/physics/chain_shape_spec.rb +80 -0
  171. data/spec/motion/joybox/physics/circle_shape_spec.rb +63 -0
  172. data/spec/motion/joybox/physics/edge_shape_spec.rb +48 -0
  173. data/spec/motion/joybox/physics/fixture_spec.rb +106 -0
  174. data/spec/motion/joybox/physics/mass_data_spec.rb +13 -0
  175. data/spec/motion/joybox/physics/physics_sprite_spec.rb +50 -0
  176. data/spec/motion/joybox/physics/polygon_shape_spec.rb +92 -0
  177. data/spec/motion/joybox/physics/ray_cast_input_spec.rb +17 -0
  178. data/spec/motion/joybox/physics/ray_cast_output_spec.rb +13 -0
  179. data/spec/motion/joybox/physics/shape_spec.rb +50 -0
  180. data/spec/motion/joybox/physics/transform_spec.rb +13 -0
  181. data/spec/motion/joybox/physics/world_spec.rb +228 -0
  182. data/spec/motion/joybox/ui/label_spec.rb +53 -0
  183. data/spec/motion/joybox/ui/menu_image_spec.rb +51 -0
  184. data/spec/motion/joybox/ui/menu_label_spec.rb +68 -0
  185. data/spec/motion/joybox/ui/menu_spec.rb +26 -0
  186. data/spec/spec_helpers/cg_point.rb +5 -0
  187. data/spec/spec_helpers/cg_point_spec.rb +14 -0
  188. data/template/joybox-ios-example-repl/files/.gitignore +16 -0
  189. data/template/joybox-ios/files/.gitignore +16 -0
  190. data/template/joybox-osx-example-repl/files/.gitignore +16 -0
  191. data/template/joybox-osx/files/.gitignore +16 -0
  192. data/vendor/vendor-ios/box_2d/box_2d.bridgesupport +1201 -85
  193. data/vendor/vendor-ios/box_2d/box_2d_include/B2DAABB.h +21 -0
  194. data/vendor/vendor-ios/box_2d/box_2d_include/B2DBody.h +58 -13
  195. data/vendor/vendor-ios/box_2d/box_2d_include/B2DBodyDef.h +44 -0
  196. data/vendor/vendor-ios/box_2d/box_2d_include/B2DBodyTypes.h +20 -0
  197. data/vendor/vendor-ios/box_2d/box_2d_include/B2DChainShape.h +29 -0
  198. data/vendor/vendor-ios/box_2d/box_2d_include/B2DCircleShape.h +7 -0
  199. data/vendor/vendor-ios/box_2d/box_2d_include/B2DColor.h +23 -0
  200. data/vendor/vendor-ios/box_2d/box_2d_include/B2DContactFilter.h +24 -0
  201. data/vendor/vendor-ios/box_2d/box_2d_include/B2DContactListener.h +1 -1
  202. data/vendor/vendor-ios/box_2d/box_2d_include/B2DDestructionListener.h +24 -0
  203. data/vendor/vendor-ios/box_2d/box_2d_include/B2DDraw.h +54 -0
  204. data/vendor/vendor-ios/box_2d/box_2d_include/B2DEdgeShape.h +13 -2
  205. data/vendor/vendor-ios/box_2d/box_2d_include/B2DFilter.h +23 -0
  206. data/vendor/vendor-ios/box_2d/box_2d_include/B2DFixture.h +47 -0
  207. data/vendor/vendor-ios/box_2d/box_2d_include/B2DFixtureDef.h +29 -0
  208. data/vendor/vendor-ios/box_2d/box_2d_include/B2DMassData.h +23 -0
  209. data/vendor/vendor-ios/box_2d/box_2d_include/B2DPolygonShape.h +14 -1
  210. data/vendor/vendor-ios/box_2d/box_2d_include/B2DProfile.h +31 -0
  211. data/vendor/vendor-ios/box_2d/box_2d_include/B2DQueryCallback.h +24 -0
  212. data/vendor/vendor-ios/box_2d/box_2d_include/B2DRayCastCallback.h +24 -0
  213. data/vendor/vendor-ios/box_2d/box_2d_include/B2DRayCastInput.h +23 -0
  214. data/vendor/vendor-ios/box_2d/box_2d_include/B2DRayCastOutput.h +21 -0
  215. data/vendor/vendor-ios/box_2d/box_2d_include/B2DShape.h +23 -3
  216. data/vendor/vendor-ios/box_2d/box_2d_include/B2DShapeTypes.h +22 -0
  217. data/vendor/vendor-ios/box_2d/box_2d_include/B2DTransform.h +21 -0
  218. data/vendor/vendor-ios/box_2d/box_2d_include/B2DWorld.h +40 -19
  219. data/vendor/vendor-ios/box_2d/libBox2D.a +0 -0
  220. data/vendor/vendor-ios/cocos_2d/cocos_2d.bridgesupport +808 -1578
  221. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/CCActionEase.h +47 -0
  222. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/CCFontDefinition.h +85 -0
  223. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/CCLabelTTF.h +54 -6
  224. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/CCMenuItem.h +1 -0
  225. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/CCTMXLayer.h +2 -2
  226. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/CCTexture2D.h +4 -0
  227. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/ccTypes.h +51 -1
  228. data/vendor/vendor-ios/cocos_2d/libcocos2d.a +0 -0
  229. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader.bridgesupport +510 -0
  230. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCBAnimationManager.h +149 -0
  231. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCBKeyframe.h +40 -0
  232. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCBReader.h +176 -0
  233. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCBSequence.h +49 -0
  234. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCBSequenceProperty.h +38 -0
  235. data/vendor/vendor-ios/cocos_builder_reader/cocos_builder_reader_include/CCNode+CCBRelativePositioning.h +65 -0
  236. data/vendor/vendor-ios/cocos_builder_reader/libCocosBuilderReader.a +0 -0
  237. data/vendor/vendor-ios/cocos_denshion/cocos_denshion.bridgesupport +1001 -0
  238. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/CDAudioManager.h +243 -0
  239. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/CDConfig.h +60 -0
  240. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/CDOpenALSupport.h +77 -0
  241. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/CDXMacOSXSupport.h +232 -0
  242. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/CDXPropertyModifierAction.h +45 -0
  243. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/CocosDenshion.h +440 -0
  244. data/vendor/vendor-ios/cocos_denshion/cocos_denshion_include/SimpleAudioEngine.h +90 -0
  245. data/vendor/vendor-ios/cocos_denshion/libCocosDenshion.a +0 -0
  246. data/vendor/vendor-ios/kazmath/kazmath.bridgesupport +865 -0
  247. data/vendor/vendor-ios/kazmath/kazmath_include/GL/mat4stack.h +51 -0
  248. data/vendor/vendor-ios/kazmath/kazmath_include/GL/matrix.h +58 -0
  249. data/vendor/vendor-ios/kazmath/kazmath_include/aabb.h +53 -0
  250. data/vendor/vendor-ios/kazmath/kazmath_include/kazmath.h +39 -0
  251. data/vendor/vendor-ios/kazmath/kazmath_include/mat3.h +75 -0
  252. data/vendor/vendor-ios/kazmath/kazmath_include/mat4.h +93 -0
  253. data/vendor/vendor-ios/kazmath/kazmath_include/neon_matrix_impl.h +41 -0
  254. data/vendor/vendor-ios/kazmath/kazmath_include/plane.h +70 -0
  255. data/vendor/vendor-ios/kazmath/kazmath_include/quaternion.h +113 -0
  256. data/vendor/vendor-ios/kazmath/kazmath_include/ray2.h +50 -0
  257. data/vendor/vendor-ios/kazmath/kazmath_include/utility.h +74 -0
  258. data/vendor/vendor-ios/kazmath/kazmath_include/vec2.h +64 -0
  259. data/vendor/vendor-ios/kazmath/kazmath_include/vec3.h +68 -0
  260. data/vendor/vendor-ios/kazmath/kazmath_include/vec4.h +68 -0
  261. data/vendor/vendor-ios/kazmath/libkazmath.a +0 -0
  262. data/vendor/vendor-osx/box_2d/box_2d.bridgesupport +1199 -83
  263. data/vendor/vendor-osx/box_2d/box_2d_include/B2DAABB.h +21 -0
  264. data/vendor/vendor-osx/box_2d/box_2d_include/B2DBody.h +58 -13
  265. data/vendor/vendor-osx/box_2d/box_2d_include/B2DBodyDef.h +44 -0
  266. data/vendor/vendor-osx/box_2d/box_2d_include/B2DBodyTypes.h +20 -0
  267. data/vendor/vendor-osx/box_2d/box_2d_include/B2DChainShape.h +29 -0
  268. data/vendor/vendor-osx/box_2d/box_2d_include/B2DCircleShape.h +7 -0
  269. data/vendor/vendor-osx/box_2d/box_2d_include/B2DColor.h +23 -0
  270. data/vendor/vendor-osx/box_2d/box_2d_include/B2DContactFilter.h +24 -0
  271. data/vendor/vendor-osx/box_2d/box_2d_include/B2DContactListener.h +1 -1
  272. data/vendor/vendor-osx/box_2d/box_2d_include/B2DDestructionListener.h +24 -0
  273. data/vendor/vendor-osx/box_2d/box_2d_include/B2DDraw.h +54 -0
  274. data/vendor/vendor-osx/box_2d/box_2d_include/B2DEdgeShape.h +13 -2
  275. data/vendor/vendor-osx/box_2d/box_2d_include/B2DFilter.h +23 -0
  276. data/vendor/vendor-osx/box_2d/box_2d_include/B2DFixture.h +47 -0
  277. data/vendor/vendor-osx/box_2d/box_2d_include/B2DFixtureDef.h +29 -0
  278. data/vendor/vendor-osx/box_2d/box_2d_include/B2DMassData.h +23 -0
  279. data/vendor/vendor-osx/box_2d/box_2d_include/B2DPolygonShape.h +14 -1
  280. data/vendor/vendor-osx/box_2d/box_2d_include/B2DProfile.h +31 -0
  281. data/vendor/vendor-osx/box_2d/box_2d_include/B2DQueryCallback.h +24 -0
  282. data/vendor/vendor-osx/box_2d/box_2d_include/B2DRayCastCallback.h +24 -0
  283. data/vendor/vendor-osx/box_2d/box_2d_include/B2DRayCastInput.h +23 -0
  284. data/vendor/vendor-osx/box_2d/box_2d_include/B2DRayCastOutput.h +21 -0
  285. data/vendor/vendor-osx/box_2d/box_2d_include/B2DShape.h +23 -3
  286. data/vendor/vendor-osx/box_2d/box_2d_include/B2DShapeTypes.h +22 -0
  287. data/vendor/vendor-osx/box_2d/box_2d_include/B2DTransform.h +21 -0
  288. data/vendor/vendor-osx/box_2d/box_2d_include/B2DWorld.h +40 -19
  289. data/vendor/vendor-osx/box_2d/libBox2D.a +0 -0
  290. data/vendor/vendor-osx/cocos_2d/cocos_2d.bridgesupport +2820 -2633
  291. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionEase.h +47 -0
  292. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCFontDefinition.h +85 -0
  293. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelTTF.h +54 -6
  294. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMenuItem.h +1 -0
  295. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXLayer.h +2 -2
  296. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTexture2D.h +4 -0
  297. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCDirectorIOS.h +111 -0
  298. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCES2Renderer.h +83 -0
  299. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCESRenderer.h +54 -0
  300. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCGLView.h +175 -0
  301. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCTouchDelegateProtocol.h +75 -0
  302. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCTouchDispatcher.h +120 -0
  303. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/iOS/CCTouchHandler.h +93 -0
  304. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccTypes.h +65 -1
  305. data/vendor/vendor-osx/cocos_2d/libcocos2d.a +0 -0
  306. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader.bridgesupport +510 -0
  307. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCBAnimationManager.h +149 -0
  308. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCBKeyframe.h +40 -0
  309. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCBReader.h +176 -0
  310. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCBSequence.h +49 -0
  311. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCBSequenceProperty.h +38 -0
  312. data/vendor/vendor-osx/cocos_builder_reader/cocos_builder_reader_include/CCNode+CCBRelativePositioning.h +65 -0
  313. data/vendor/vendor-osx/cocos_builder_reader/libCocosBuilderReader.a +0 -0
  314. data/vendor/vendor-osx/cocos_denshion/cocos_denshion.bridgesupport +1001 -0
  315. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/CDAudioManager.h +243 -0
  316. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/CDConfig.h +60 -0
  317. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/CDOpenALSupport.h +77 -0
  318. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/CDXMacOSXSupport.h +232 -0
  319. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/CDXPropertyModifierAction.h +45 -0
  320. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/CocosDenshion.h +440 -0
  321. data/vendor/vendor-osx/cocos_denshion/cocos_denshion_include/SimpleAudioEngine.h +90 -0
  322. data/vendor/vendor-osx/cocos_denshion/libCocosDenshion.a +0 -0
  323. data/vendor/vendor-osx/kazmath/kazmath.bridgesupport +865 -0
  324. data/vendor/vendor-osx/kazmath/kazmath_include/GL/mat4stack.h +51 -0
  325. data/vendor/vendor-osx/kazmath/kazmath_include/GL/matrix.h +58 -0
  326. data/vendor/vendor-osx/kazmath/kazmath_include/aabb.h +53 -0
  327. data/vendor/vendor-osx/kazmath/kazmath_include/kazmath.h +39 -0
  328. data/vendor/vendor-osx/kazmath/kazmath_include/mat3.h +75 -0
  329. data/vendor/vendor-osx/kazmath/kazmath_include/mat4.h +93 -0
  330. data/vendor/vendor-osx/kazmath/kazmath_include/neon_matrix_impl.h +41 -0
  331. data/vendor/vendor-osx/kazmath/kazmath_include/plane.h +70 -0
  332. data/vendor/vendor-osx/kazmath/kazmath_include/quaternion.h +113 -0
  333. data/vendor/vendor-osx/kazmath/kazmath_include/ray2.h +50 -0
  334. data/vendor/vendor-osx/kazmath/kazmath_include/utility.h +74 -0
  335. data/vendor/vendor-osx/kazmath/kazmath_include/vec2.h +64 -0
  336. data/vendor/vendor-osx/kazmath/kazmath_include/vec3.h +68 -0
  337. data/vendor/vendor-osx/kazmath/kazmath_include/vec4.h +68 -0
  338. data/vendor/vendor-osx/kazmath/libkazmath.a +0 -0
  339. metadata +353 -57
  340. checksums.yaml +0 -15
  341. data/bin/joybox +0 -49
  342. data/command/joybox/USAGE +0 -24
  343. data/motion/joybox-ios/configuration/debug.rb +0 -27
  344. data/motion/joybox-ios/debug/debug.rb +0 -10
  345. data/motion/joybox-osx/configuration/debug.rb +0 -27
  346. data/motion/joybox-osx/configuration/sprite_view.rb +0 -91
  347. data/motion/joybox-osx/debug/debug.rb +0 -10
  348. data/motion/joybox/core/ns_object.rb +0 -8
  349. data/spec/lib/joybox/cocos2d/cocos2d_spec.rb +0 -7
  350. data/spec/lib/joybox/cocos2d/macros_spec.rb +0 -37
  351. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/cocos2d-ios-exceptions.bridgesupport +0 -39
  352. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/gen_cocos2d_bridgesupport.sh +0 -17
  353. data/vendor/vendor-ios/cocos_2d/cocos_2d_include/gen_cocos2d_complement.sh +0 -17
@@ -26,4 +26,6 @@ Motion::Project::App.setup do |app|
26
26
  Dir.glob(File.join(joybox, '**/*.rb')).reverse.each do |file|
27
27
  app.files.insert(insert_point, file)
28
28
  end
29
+
30
+ app.files_dependencies File.join(joybox, 'physics/aabb.rb') => File.join(joybox, 'physics/world.rb')
29
31
  end
@@ -1,5 +1,4 @@
1
1
  Motion::Project::App.setup do |app|
2
-
3
2
  # Extracted from Teacup: https://github.com/rubymotion/teacup
4
3
  # Thanks Colin! (@colinta)
5
4
  platform = app.respond_to?(:template) ? app.template : :ios
@@ -11,7 +10,7 @@ Motion::Project::App.setup do |app|
11
10
  app.frameworks += ["QuartzCore",
12
11
  "CoreGraphics",
13
12
  "Foundation",
14
- "ApplicationServices",
13
+ "OpenGLES",
15
14
  "OpenAL",
16
15
  "AVFoundation",
17
16
  "AudioToolbox",
@@ -21,7 +20,10 @@ Motion::Project::App.setup do |app|
21
20
 
22
21
 
23
22
  cocos2d_vendor = File.expand_path(File.join(platform_vendor, "cocos_2d"))
23
+ cocos_denshion_vendor = File.expand_path(File.join(platform_vendor, "cocos_denshion"))
24
+ cocos_builder_reader_vendor = File.expand_path(File.join(platform_vendor, "cocos_builder_reader"))
24
25
  box2d_vendor = File.expand_path(File.join(platform_vendor, "box_2d"))
26
+ kazmath_vendor = File.expand_path(File.join(platform_vendor, "kazmath"))
25
27
 
26
28
  app.vendor_project(cocos2d_vendor,
27
29
  :static,
@@ -29,10 +31,23 @@ Motion::Project::App.setup do |app|
29
31
  :bridgesupport_cflags => "-D__CC_PLATFORM_IOS -ISupport -IPlatforms -IPlatforms/iOS",
30
32
  :bridgesupport_exceptions => ["cocos_2d_exceptions.bridgesupport"])
31
33
 
34
+ app.vendor_project(cocos_denshion_vendor,
35
+ :static,
36
+ :products => ['libCocosDenshion.a'],
37
+ :bridgesupport_cflags => "-DNDEBUG")
38
+
39
+ app.vendor_project(cocos_builder_reader_vendor,
40
+ :static,
41
+ :products => ['libCocosBuilderReader.a'],
42
+ :bridgesupport_cflags => "-DNDEBUG -I../../cocos_2d/cocos_2d_include/.")
43
+
32
44
  app.vendor_project(box2d_vendor,
33
45
  :static,
34
46
  :products => ['libBox2D.a'])
35
47
 
48
+ app.vendor_project(kazmath_vendor,
49
+ :static,
50
+ :products => ['libkazmath.a'])
36
51
 
37
52
  # Scans app.files until it finds app/ (the default)
38
53
  # if found, it inserts just before those files, otherwise it will insert to
@@ -42,4 +57,4 @@ Motion::Project::App.setup do |app|
42
57
  Dir.glob(File.join(platform_joybox, '**/*.rb')).reverse.each do |file|
43
58
  app.files.insert(insert_point, file)
44
59
  end
45
- end
60
+ end
@@ -1,5 +1,4 @@
1
1
  Motion::Project::App.setup do |app|
2
-
3
2
  # Extracted from Teacup: https://github.com/rubymotion/teacup
4
3
  # Thanks Colin! (@colinta)
5
4
  platform = app.respond_to?(:template) ? app.template : :ios
@@ -9,7 +8,8 @@ Motion::Project::App.setup do |app|
9
8
 
10
9
 
11
10
  app.frameworks += ["Cocoa",
12
- "OpenGL",
11
+ "OpenGL",
12
+ "OpenAL",
13
13
  "QuartzCore",
14
14
  "ApplicationServices",
15
15
  "AppKit",
@@ -23,18 +23,34 @@ Motion::Project::App.setup do |app|
23
23
 
24
24
 
25
25
  cocos2d_vendor = File.expand_path(File.join(platform_vendor, "cocos_2d"))
26
+ cocos_denshion_vendor = File.expand_path(File.join(platform_vendor, "cocos_denshion"))
27
+ cocos_builder_reader_vendor = File.expand_path(File.join(platform_vendor, "cocos_builder_reader"))
26
28
  box2d_vendor = File.expand_path(File.join(platform_vendor, "box_2d"))
29
+ kazmath_vendor = File.expand_path(File.join(platform_vendor, "kazmath"))
27
30
 
28
31
  app.vendor_project(cocos2d_vendor,
29
32
  :static,
30
33
  :products => ["libcocos2d.a"],
31
34
  :bridgesupport_cflags => "-D__CC_PLATFORM_MAC -ISupport -IPlatforms -IPlatforms/Mac")
32
35
 
36
+ app.vendor_project(cocos_denshion_vendor,
37
+ :static,
38
+ :products => ['libCocosDenshion.a'],
39
+ :bridgesupport_cflags => "-DNDEBUG")
40
+
41
+ app.vendor_project(cocos_builder_reader_vendor,
42
+ :static,
43
+ :products => ['libCocosBuilderReader.a'],
44
+ :bridgesupport_cflags => "-DNDEBUG -I../../cocos_2d/cocos_2d_include/.")
45
+
33
46
  app.vendor_project(box2d_vendor,
34
47
  :static,
35
48
  :products => ['libBox2D.a'],
36
49
  :bridgesupport_cflags => "-D__CC_PLATFORM_MAC -ISupport -IPlatforms -IPlatforms/Mac")
37
50
 
51
+ app.vendor_project(kazmath_vendor,
52
+ :static,
53
+ :products => ['libkazmath.a'])
38
54
 
39
55
  # Scans app.files until it finds app/ (the default)
40
56
  # if found, it inserts just before those files, otherwise it will insert to
@@ -1,3 +1,3 @@
1
1
  module Joybox
2
- VERSION = '1.0.0' unless defined?(Joybox::VERSION)
2
+ VERSION = '1.1.0' unless defined?(Joybox::VERSION)
3
3
  end
@@ -1,44 +1,74 @@
1
1
  class CGPoint
2
2
 
3
- def to_opengl_coordinates
3
+ def coerce(other)
4
+ [self, other]
5
+ end
4
6
 
7
+ def to_opengl_coordinates
5
8
  Joybox.director.convertToGL(self)
6
9
  end
7
10
 
8
-
9
11
  def from_opengl_coordinates
10
-
11
12
  Joybox.director.convertToUI(self)
12
13
  end
13
14
 
15
+ def from_pixel_coordinates
16
+ CGPointMake(self.x.from_pixels, self.y.from_pixels)
17
+ end
14
18
 
15
19
  def to_pixel_coordinates
16
-
17
20
  CGPointMake(self.x.to_pixels, self.y.to_pixels)
18
21
  end
19
22
 
20
-
21
- def from_pixel_coordinates
22
-
23
- CGPointMake(self.x.from_pixels, self.y.from_pixels)
23
+ def to_local_coordinates(node)
24
+ node.convertToNodeSpace(self)
24
25
  end
25
26
 
27
+ def from_local_coordinates(node)
28
+ node.convertToWorldSpace(self)
29
+ end
26
30
 
27
- def == (point)
28
-
29
- point.is_a?(CGPoint) && CGPointEqualToPoint(self, point)
31
+ def ==(other)
32
+ other.is_a?(CGPoint) && CGPointEqualToPoint(self, other)
30
33
  end
31
34
 
35
+ def +(other)
36
+ case other
37
+ when Numeric
38
+ return CGPointMake(self.x + other, self.y + other)
39
+ when CGPoint
40
+ return CGPointMake(self.x + other.x, self.y + other.y)
41
+ end
42
+ end
32
43
 
33
- def + (point)
34
-
35
- CGPointMake(self.x + point.x, self.y + point.y)
44
+ def -@
45
+ CGPointMake(-x, -y)
36
46
  end
37
47
 
48
+ def -(other)
49
+ self.+(-other)
50
+ end
38
51
 
39
- def - (point)
52
+ def *(other)
53
+ case other
54
+ when Numeric
55
+ return CGPointMake(self.x * other, self.y * other)
56
+ when CGPoint
57
+ return CGPointMake(self.x * other.x, self.y * other.y)
58
+ end
59
+ end
40
60
 
41
- CGPointMake(self.x - point.x, self.y - point.y)
61
+ def /(other)
62
+ case other
63
+ when Numeric
64
+ return CGPointMake(self.x / other, self.y / other)
65
+ when CGPoint
66
+ return CGPointMake(self.x / other.x, self.y / other.y)
67
+ end
42
68
  end
43
69
 
70
+ def half
71
+ self / 2
72
+ end
73
+
44
74
  end
@@ -0,0 +1,56 @@
1
+ # Borrowed from Bubble-wrap: https://github.com/rubymotion/BubbleWrap
2
+ # Thank you guys! http://bubble-wrap.io
3
+ module Joybox
4
+ module Common
5
+
6
+ module Device
7
+
8
+ module_function
9
+
10
+ def self.simulator?
11
+ @simulator_state ||= !(UIDevice.currentDevice.model =~ /simulator/i).nil?
12
+ end
13
+
14
+ def self.iphone?
15
+ UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone
16
+ end
17
+
18
+ def self.ipad?
19
+ UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
20
+ end
21
+
22
+ def self.retina?
23
+ scale_factor == 2
24
+ end
25
+
26
+ def self.scale_factor
27
+ Joybox.director.contentScaleFactor
28
+ end
29
+
30
+ def orientation(device_orientation=UIDevice.currentDevice.orientation, fallback=true)
31
+ case device_orientation
32
+ when UIDeviceOrientationPortrait then :portrait
33
+ when UIDeviceceOrientationPortraitUpsideDown then :portrait_upside_down
34
+ when UIDeviceOrientationLandscapeLeft then :landscape_left
35
+ when UIDeviceOrientationLandscapeRight then :landscape_right
36
+ when UIDeviceOrientationFaceUp then :face_up
37
+ when UIDeviceOrientationFaceDown then :face_down
38
+ else
39
+ # In some cases, the accelerometer can't get an accurate read of orientation so we fall back on the orientation of
40
+ # the status bar.
41
+ if fallback && (device_orientation != UIApplication.sharedApplication.statusBarOrientation)
42
+ orientation(UIApplication.sharedApplication.statusBarOrientation)
43
+ else
44
+ :unknown
45
+ end
46
+ end
47
+ end
48
+
49
+ def self.os_version
50
+ UIDevice.currentDevice.systemVersion
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+ end
@@ -3,12 +3,10 @@ class UITouch
3
3
  # We need a method instead of the alias method because of
4
4
  # the 'Type `{CGPoint=ff}@:@' not precompiled' error
5
5
  def location_in_view(view)
6
-
7
6
  locationInView(view)
8
7
  end
9
8
 
10
9
  def location
11
-
12
10
  Joybox.director.convertTouchToGL(self)
13
11
  end
14
12
 
@@ -4,16 +4,13 @@ module Joybox
4
4
  module_function
5
5
 
6
6
  def setup(&block)
7
-
8
7
  instance_eval(&block) if block_given?
9
8
  configure
10
9
 
11
10
  Director.sharedDirector
12
11
  end
13
12
 
14
-
15
13
  def configure
16
-
17
14
  director unless @is_director_configured
18
15
  opengl_view unless @is_opengl_view_configured
19
16
  texture_2d unless @is_texture_2d_configured
@@ -21,57 +18,30 @@ module Joybox
21
18
  debug unless @is_debug_configured
22
19
  end
23
20
 
24
-
25
- def director(*hash)
26
-
27
- hash = hash.pop
28
-
29
- Director.configure(hash)
30
-
21
+ def director(options = {})
22
+ Director.configure(options)
31
23
  @is_director_configured = true
32
24
  end
33
25
 
34
-
35
- def opengl_view(*hash)
36
-
37
- hash = hash.pop
38
-
39
- opengl_view = GLView.new(hash)
40
-
26
+ def opengl_view(options = {})
27
+ opengl_view = GLView.new(options)
41
28
  director = Director.sharedDirector
42
-
43
29
  director.view = opengl_view
44
-
45
30
  @is_opengl_view_configured = true
46
31
  end
47
32
 
48
-
49
- def texture_2d(*hash)
50
-
51
- hash = hash.pop
52
-
53
- Texture2D.configure(hash)
54
-
33
+ def texture_2d(options = {})
34
+ Texture2D.configure(options)
55
35
  @is_texture_2d_configured = true
56
36
  end
57
37
 
58
-
59
- def file_utils(*hash)
60
-
61
- hash = hash.pop
62
-
63
- FileUtils.configure(hash)
64
-
38
+ def file_utils(options = {})
39
+ FileUtils.configure(options)
65
40
  @is_file_utils_configured = true
66
41
  end
67
42
 
68
-
69
- def debug(*hash)
70
-
71
- hash = hash.pop
72
-
73
- Debug.configure(hash)
74
-
43
+ def debug(options = {})
44
+ Debug.configure(options)
75
45
  @is_debug_configured = true
76
46
  end
77
47
 
@@ -8,17 +8,13 @@ module Joybox
8
8
  set_iphone_retina_display_suffix: "-hd",
9
9
  set_ipad_suffix: "-ipad",
10
10
  set_ipad_retina_display_suffix: "-ipadhd"
11
-
12
11
  }
13
12
  end
14
13
 
15
-
16
14
  def self.configure(options = {})
17
-
18
15
  options = options.nil? ? default_configuration : default_configuration.merge!(options)
19
16
 
20
17
  file_utils = FileUtils.sharedFileUtils
21
-
22
18
  file_utils.setiPhoneRetinaDisplaySuffix(options[:set_iphone_retina_display_suffix])
23
19
  file_utils.setiPadSuffix(options[:set_ipad_suffix])
24
20
  file_utils.setiPadRetinaDisplaySuffix(options[:set_ipad_retina_display_suffix])
@@ -3,9 +3,10 @@ module Joybox
3
3
 
4
4
  class GLView < CCGLView
5
5
 
6
- def self.defaults
7
- {
6
+ extend Joybox::Common::Initialize
8
7
 
8
+ def defaults
9
+ {
9
10
  bounds: UIScreen.mainScreen.bounds,
10
11
  pixel_format: KEAGLColorFormatRGB565,
11
12
  depth_format: 0,
@@ -16,29 +17,22 @@ module Joybox
16
17
  }
17
18
  end
18
19
 
19
-
20
- def self.new(options)
21
-
20
+ def initialize(options)
22
21
  options = options.nil? ? defaults : defaults.merge!(options)
23
-
24
22
  bounds = options[:bounds]
25
23
 
26
- if bounds.class == Hash
27
-
28
- bounds = [[bounds[:x], bounds[:y]], [bounds[:width], bounds[:height]]]
29
- end
24
+ bounds = [[bounds[:x], bounds[:y]], [bounds[:width], bounds[:height]]] if bounds.class == Hash
30
25
 
31
-
32
- GLView.viewWithFrame(UIScreen.mainScreen.bounds,
33
- pixelFormat: options[:pixel_format],
34
- depthFormat: options[:depth_format],
35
- preserveBackbuffer: options[:preserve_backbuffer],
36
- sharegroup: options[:share_group],
37
- multiSampling: options[:multi_sampling],
38
- numberOfSamples: options[:number_of_samples])
26
+ initWithFrame(UIScreen.mainScreen.bounds,
27
+ pixelFormat: options[:pixel_format],
28
+ depthFormat: options[:depth_format],
29
+ preserveBackbuffer: options[:preserve_backbuffer],
30
+ sharegroup: options[:share_group],
31
+ multiSampling: options[:multi_sampling],
32
+ numberOfSamples: options[:number_of_samples])
39
33
  end
40
34
 
41
35
  end
42
-
36
+
43
37
  end
44
- end
38
+ end
@@ -5,16 +5,12 @@ module Joybox
5
5
 
6
6
  def self.default_configuration
7
7
  {
8
-
9
8
  default_alpha_pixel_format: KCCTexture2DPixelFormat_RGBA8888,
10
9
  pvr_images_have_premultiplied_alpha: true
11
-
12
10
  }
13
11
  end
14
12
 
15
-
16
13
  def self.configure(options = {})
17
-
18
14
  options = options.nil? ? default_configuration : default_configuration.merge!(options)
19
15
 
20
16
  defaultAlphaPixelFormat = options[:default_alpha_pixel_format]