joybox 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/LICENSE +1 -1
- data/LICENSE_Box2D +20 -0
- data/LICENSE_Cocos2D +24 -0
- data/README.md +34 -66
- data/Rakefile +2 -3
- data/bin/joybox +49 -0
- data/command/joybox/USAGE +24 -0
- data/command/joybox/templates/layer.erb +11 -0
- data/command/joybox/templates/layer_spec.erb +3 -0
- data/command/joybox/templates/scene.erb +11 -0
- data/command/joybox/templates/scene_spec.erb +3 -0
- data/command/joybox/templates/sprite.erb +11 -0
- data/command/joybox/templates/sprite_spec.erb +3 -0
- data/command/joybox_generate_command.rb +114 -0
- data/joybox.gemspec +44 -0
- data/lib/joybox/joybox-ios.rb +47 -0
- data/lib/joybox/joybox-osx.rb +47 -0
- data/lib/joybox/version.rb +1 -1
- data/lib/joybox.rb +18 -36
- data/{lib/joybox/cocos2d → motion/joybox}/actions/actions.rb +0 -0
- data/motion/joybox/actions/animate.rb +22 -0
- data/motion/joybox/actions/bezier.rb +33 -0
- data/motion/joybox/actions/blink.rb +24 -0
- data/motion/joybox/actions/ease.rb +149 -0
- data/motion/joybox/actions/fade.rb +38 -0
- data/motion/joybox/actions/jump.rb +39 -0
- data/{lib/joybox/cocos2d → motion/joybox}/actions/move.rb +4 -2
- data/motion/joybox/actions/place.rb +22 -0
- data/{lib/joybox/cocos2d → motion/joybox}/actions/repeat.rb +10 -1
- data/{lib/joybox/cocos2d → motion/joybox}/actions/rotate.rb +4 -2
- data/{lib/joybox/cocos2d → motion/joybox}/actions/scale.rb +4 -2
- data/{lib/joybox/cocos2d → motion/joybox}/actions/sequence.rb +3 -3
- data/{lib/joybox/cocos2d → motion/joybox}/actions/skew.rb +0 -0
- data/motion/joybox/actions/spawn.rb +22 -0
- data/motion/joybox/actions/tint.rb +37 -0
- data/motion/joybox/animations/animation.rb +60 -0
- data/{lib/joybox/cocos2d → motion/joybox}/common/color.rb +12 -1
- data/{lib/joybox/cocos2d → motion/joybox}/common/gc_size.rb +4 -4
- data/{lib/joybox/cocos2d → motion/joybox}/common/ns_set.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/common/numeric.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/common/screen.rb +4 -4
- data/motion/joybox/core/layer.rb +51 -0
- data/{lib/joybox/cocos2d → motion/joybox}/core/node.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/core/scene.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/core/sprite.rb +22 -3
- data/{lib/joybox/cocos2d → motion/joybox}/core/sprite_batch.rb +0 -0
- data/motion/joybox/core/sprite_frame_cache.rb +147 -0
- data/{lib/joybox/cocos2d/cocos2d.rb → motion/joybox/joybox.rb} +3 -1
- data/{lib/joybox/cocos2d → motion/joybox}/macros.rb +0 -0
- data/{lib/joybox/box2d → motion/joybox/physics}/body.rb +44 -17
- data/{lib/joybox/cocos2d/core → motion/joybox/physics}/physics_sprite.rb +1 -1
- data/motion/joybox/physics/world.rb +79 -0
- data/{lib/joybox/cocos2d → motion/joybox}/ui/label.rb +3 -2
- data/{lib/joybox/cocos2d → motion/joybox}/ui/menu.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/ui/menu_image.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/ui/menu_label.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox}/ui/ui.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox-ios}/common/cg_point.rb +9 -2
- data/{lib/joybox/cocos2d → motion/joybox-ios}/common/ui_touch.rb +1 -1
- data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/configuration.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/file_utils.rb +0 -3
- data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/gl_view.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/texture_2d.rb +0 -0
- data/{lib/joybox/cocos2d → motion/joybox-ios}/core/layer.rb +1 -45
- data/{lib/joybox/cocos2d → motion/joybox-ios}/director.rb +6 -6
- data/motion/joybox-osx/common/ats_point.rb +48 -0
- data/motion/joybox-osx/common/ns_event.rb +8 -0
- data/motion/joybox-osx/configuration/configuration.rb +46 -0
- data/motion/joybox-osx/configuration/gl_view.rb +57 -0
- data/motion/joybox-osx/core/layer.rb +135 -0
- data/motion/joybox-osx/director.rb +42 -0
- data/template/joybox-ios/files/Rakefile.erb +9 -0
- data/{app → template/joybox-ios/files/app}/app_delegate.rb +1 -5
- data/{resources → template/joybox-ios/files/resources}/fps_images-hd.png +0 -0
- data/{resources → template/joybox-ios/files/resources}/fps_images-ipadhd.png +0 -0
- data/{resources → template/joybox-ios/files/resources}/fps_images.png +0 -0
- data/template/joybox-ios/files/spec/main_spec.rb.erb +9 -0
- data/template/joybox-osx/files/Rakefile.erb +9 -0
- data/template/joybox-osx/files/app/app_delegate.rb +23 -0
- data/template/joybox-osx/files/app/layers/default_layer.rb +5 -0
- data/template/joybox-osx/files/app/menu.rb +51 -0
- data/template/joybox-osx/files/resources/Credits.rtf +29 -0
- data/template/joybox-osx/files/resources/fps_images-hd.png +0 -0
- data/template/joybox-osx/files/resources/fps_images-ipadhd.png +0 -0
- data/template/joybox-osx/files/resources/fps_images.png +0 -0
- data/template/joybox-osx/files/spec/main_spec.rb.erb +9 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Box2D +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Box2D.framework.bridgesupport +47 -37
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Box2D +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/B2DContactListener.h +0 -0
- data/vendor/vendor-ios/Box2D.framework/Versions/A/Headers/Collision/Shapes/B2DCircleShape.h +16 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/Shapes/B2DEdgeShape.h +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/Shapes/B2DPolygonShape.h +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/Shapes/B2DShape.h +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Dynamics/B2DBody.h +6 -6
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Dynamics/B2DWorld.h +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Resources/Box2DConfig.cmake +0 -0
- data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Resources/CMakeLists.txt +0 -0
- data/vendor/vendor-ios/Box2D.framework/Versions/A/Resources/LICENSE +22 -0
- data/vendor/vendor-ios/cocos_2d/cocos_2d.bridgesupport +9154 -0
- data/vendor/vendor-ios/cocos_2d/cocos_2d_exceptions.bridgesupport +39 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAction.h +23 -23
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionCamera.h +21 -19
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionCatmullRom.h +18 -6
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionEase.h +117 -31
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionGrid.h +19 -17
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionGrid3D.h +45 -42
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionInstant.h +21 -13
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionInterval.h +123 -81
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionManager.h +2 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionPageTurn3D.h +2 -1
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionProgressTimer.h +4 -4
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionTiledGrid.h +46 -38
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionTween.h +3 -3
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAnimation.h +8 -8
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAnimationCache.h +2 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAtlasNode.h +19 -17
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCCamera.h +12 -12
- data/vendor/vendor-ios/cocos_2d/include/CCClippingNode.h +77 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCConfiguration.h +31 -13
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCDirector.h +51 -42
- data/vendor/vendor-ios/cocos_2d/include/CCDrawNode.h +65 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCDrawingPrimitives.h +42 -8
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCGLProgram.h +56 -21
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCGrabber.h +2 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCGrid.h +29 -29
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLabelAtlas.h +5 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLabelBMFont.h +56 -32
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLabelTTF.h +20 -20
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLayer.h +107 -79
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCMenu.h +10 -14
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCMenuItem.h +37 -32
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCMotionStreak.h +18 -19
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCNode+Debug.h +0 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCNode.h +87 -37
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParallaxNode.h +2 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleBatchNode.h +2 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleExamples.h +22 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleSystem.h +51 -40
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleSystemQuad.h +4 -4
- data/vendor/vendor-ios/cocos_2d/include/CCPhysicsDebugNode.h +58 -0
- data/vendor/vendor-ios/cocos_2d/include/CCPhysicsSprite.h +82 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCProgressTimer.h +9 -11
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCProtocols.h +54 -26
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCRenderTexture.h +29 -9
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCScene.h +4 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCScheduler.h +94 -40
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCShaderCache.h +1 -1
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSprite.h +21 -28
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSpriteBatchNode.h +16 -9
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSpriteFrame.h +10 -10
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSpriteFrameCache.h +6 -6
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXLayer.h +16 -16
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXObjectGroup.h +4 -4
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXTiledMap.h +9 -9
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXXMLParser.h +44 -33
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTexture2D.h +17 -25
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTextureAtlas.h +10 -10
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTextureCache.h +4 -4
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTexturePVR.h +25 -8
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTileMapAtlas.h +6 -6
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTransition.h +57 -12
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTransitionPageTurn.h +2 -2
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTransitionProgress.h +27 -5
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms}/CCGL.h +4 -2
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms}/CCNS.h +0 -0
- data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCDirectorMac.h +110 -0
- data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCEventDispatcher.h +343 -0
- data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCGLView.h +103 -0
- data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCWindow.h +41 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCDirectorIOS.h +12 -5
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCES2Renderer.h +12 -12
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCESRenderer.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCGLView.h +28 -13
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCTouchDelegateProtocol.h +4 -4
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCTouchDispatcher.h +2 -2
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCTouchHandler.h +7 -7
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CCArray.h +1 -1
- data/vendor/vendor-ios/cocos_2d/include/Support/CCFileUtils.h +394 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CCProfiling.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CCVertex.h +1 -1
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CGPointExtension.h +4 -2
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/NSThread+performBlock.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/OpenGL_Internal.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/TGAlib.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/TransformUtils.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/ZipUtils.h +4 -4
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/base64.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/ccCArray.h +15 -15
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/ccUtils.h +0 -0
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/uthash.h +129 -184
- data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/utlist.h +298 -55
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccConfig.h +56 -9
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccDeprecated.h +131 -0
- data/vendor/vendor-ios/cocos_2d/include/ccFPSImages.h +39 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccGLStateCache.h +44 -26
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccMacros.h +9 -9
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColorLengthTexture_frag.h +41 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColorLengthTexture_vert.h +47 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColor_frag.h +37 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColor_vert.h +40 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureA8Color_frag.h +41 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureA8Color_vert.h +45 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureColorAlphaTest_frag.h +47 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureColor_frag.h +39 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureColor_vert.h +45 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_frag.h +38 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_uColor_frag.h +41 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_uColor_vert.h +41 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_vert.h +41 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_Position_uColor_frag.h +37 -0
- data/vendor/vendor-ios/cocos_2d/include/ccShader_Position_uColor_vert.h +43 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccShaders.h +11 -0
- data/vendor/vendor-ios/cocos_2d/include/ccTypes.h +392 -0
- data/vendor/vendor-ios/cocos_2d/include/cocos2d-ios-exceptions.bridgesupport +39 -0
- data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/cocos2d.h +28 -3
- data/vendor/vendor-ios/cocos_2d/include/gen_cocos2d_bridgesupport.sh +17 -0
- data/vendor/vendor-ios/cocos_2d/include/gen_cocos2d_complement.sh +17 -0
- data/vendor/vendor-ios/cocos_2d/libcocos2d.a +0 -0
- data/vendor/vendor-osx/box_2d/box_2d.bridgesupport +176 -0
- data/vendor/vendor-osx/box_2d/include/B2DBody.h +46 -0
- data/vendor/vendor-osx/box_2d/include/B2DCircleShape.h +16 -0
- data/vendor/vendor-osx/box_2d/include/B2DContactListener.h +30 -0
- data/vendor/vendor-osx/box_2d/include/B2DEdgeShape.h +17 -0
- data/vendor/vendor-osx/box_2d/include/B2DPolygonShape.h +16 -0
- data/vendor/vendor-osx/box_2d/include/B2DShape.h +18 -0
- data/vendor/vendor-osx/box_2d/include/B2DWorld.h +44 -0
- data/vendor/vendor-osx/box_2d/libBox2D.a +0 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d.bridgesupport +8292 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAction.h +195 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionCamera.h +75 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionCatmullRom.h +151 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionEase.h +245 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionGrid.h +167 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionGrid3D.h +208 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionInstant.h +235 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionInterval.h +473 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionManager.h +113 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionPageTurn3D.h +43 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionProgressTimer.h +59 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionTiledGrid.h +219 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionTween.h +62 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAnimation.h +150 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAnimationCache.h +74 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAtlasNode.h +98 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCCamera.h +98 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCClippingNode.h +77 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCConfiguration.h +144 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCDirector.h +353 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCDrawNode.h +65 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCDrawingPrimitives.h +173 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCGLProgram.h +185 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCGrabber.h +44 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCGrid.h +130 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelAtlas.h +71 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelBMFont.h +240 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelTTF.h +132 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLayer.h +308 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMenu.h +96 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMenuItem.h +428 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMotionStreak.h +86 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCNode+Debug.h +39 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCNode.h +619 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParallaxNode.h +50 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleBatchNode.h +99 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleExamples.h +117 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleSystem.h +464 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleSystemQuad.h +73 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCPhysicsDebugNode.h +58 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCPhysicsSprite.h +82 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCProgressTimer.h +92 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCProtocols.h +160 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCRenderTexture.h +159 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCScene.h +47 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCScheduler.h +284 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCShaderCache.h +60 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSprite.h +281 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSpriteBatchNode.h +145 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSpriteFrame.h +126 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSpriteFrameCache.h +121 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXLayer.h +164 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXObjectGroup.h +67 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXTiledMap.h +145 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXXMLParser.h +228 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTexture2D.h +349 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTextureAtlas.h +188 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTextureCache.h +146 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTexturePVR.h +146 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTileMapAtlas.h +83 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTransition.h +341 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTransitionPageTurn.h +60 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTransitionProgress.h +84 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/CCGL.h +74 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/CCNS.h +54 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCDirectorMac.h +110 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCEventDispatcher.h +343 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCGLView.h +103 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCWindow.h +41 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCArray.h +119 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCFileUtils.h +394 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCProfiling.h +89 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCVertex.h +36 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CGPointExtension.h +346 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/NSThread+performBlock.h +22 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/OpenGL_Internal.h +86 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/TGAlib.h +55 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/TransformUtils.h +36 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/ZipUtils.h +91 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/base64.h +33 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/ccCArray.h +229 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/ccUtils.h +36 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/uthash.h +917 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/utlist.h +733 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccConfig.h +292 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccDeprecated.h +431 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccFPSImages.h +39 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccGLStateCache.h +156 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccMacros.h +353 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColorLengthTexture_frag.h +41 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColorLengthTexture_vert.h +47 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColor_frag.h +37 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColor_vert.h +40 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureA8Color_frag.h +41 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureA8Color_vert.h +45 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureColorAlphaTest_frag.h +47 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureColor_frag.h +39 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureColor_vert.h +45 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_frag.h +38 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_uColor_frag.h +41 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_uColor_vert.h +41 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_vert.h +41 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_Position_uColor_frag.h +37 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_Position_uColor_vert.h +43 -0
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShaders.h +56 -0
- data/vendor/{Cocos2D/include → vendor-osx/cocos_2d/cocos_2d_include}/ccTypes.h +39 -35
- data/vendor/vendor-osx/cocos_2d/cocos_2d_include/cocos2d.h +203 -0
- data/vendor/vendor-osx/cocos_2d/libcocos2d.a +0 -0
- metadata +363 -195
- data/app/layers/box2d_layer.rb +0 -109
- data/app/layers/cocos2d_layer.rb +0 -14
- data/app/layers/cocos_motion_layer.rb +0 -145
- data/app/layers/menu_layer.rb +0 -59
- data/lib/joybox/box2d/world.rb +0 -79
- data/resources/box2d/blocks_sprite_sheet.png +0 -0
- data/resources/cocos_motion/dot.png +0 -0
- data/resources/cocos_motion/dot_selected.png +0 -0
- data/resources/cocos_motion/grossini.png +0 -0
- data/resources/cocos_motion/grossinis_sister.png +0 -0
- data/resources/cocos_motion/grossinis_sister_two.png +0 -0
- data/resources/cocos_motion/left_arrow.png +0 -0
- data/resources/cocos_motion/left_arrow_selected.png +0 -0
- data/resources/cocos_motion/right_arrow.png +0 -0
- data/resources/cocos_motion/right_arrow_selected.png +0 -0
- data/vendor/Cocos2D/Cocos2D.bridgesupport +0 -7808
- data/vendor/Cocos2D/include/CCFileUtils.h +0 -188
- data/vendor/Cocos2D/include/CocosDenshion/CDAudioManager.h +0 -243
- data/vendor/Cocos2D/include/CocosDenshion/CDConfig.h +0 -60
- data/vendor/Cocos2D/include/CocosDenshion/CDOpenALSupport.h +0 -77
- data/vendor/Cocos2D/include/CocosDenshion/CDXPropertyModifierAction.h +0 -45
- data/vendor/Cocos2D/include/CocosDenshion/CocosDenshion.h +0 -440
- data/vendor/Cocos2D/include/CocosDenshion/SimpleAudioEngine.h +0 -90
- data/vendor/Cocos2D/include/RubyMotionSchedule.h +0 -7
- data/vendor/Cocos2D/include/ccShader_PositionColor_frag.h +0 -12
- data/vendor/Cocos2D/include/ccShader_PositionColor_vert.h +0 -17
- data/vendor/Cocos2D/include/ccShader_PositionTextureA8Color_frag.h +0 -16
- data/vendor/Cocos2D/include/ccShader_PositionTextureA8Color_vert.h +0 -21
- data/vendor/Cocos2D/include/ccShader_PositionTextureColorAlphaTest_frag.h +0 -23
- data/vendor/Cocos2D/include/ccShader_PositionTextureColor_frag.h +0 -14
- data/vendor/Cocos2D/include/ccShader_PositionTextureColor_vert.h +0 -22
- data/vendor/Cocos2D/include/ccShader_PositionTexture_frag.h +0 -13
- data/vendor/Cocos2D/include/ccShader_PositionTexture_uColor_frag.h +0 -16
- data/vendor/Cocos2D/include/ccShader_PositionTexture_uColor_vert.h +0 -18
- data/vendor/Cocos2D/include/ccShader_PositionTexture_vert.h +0 -17
- data/vendor/Cocos2D/include/ccShader_Position_uColor_frag.h +0 -12
- data/vendor/Cocos2D/include/ccShader_Position_uColor_vert.h +0 -19
- data/vendor/Cocos2D/include/kazmath/GL/mat4stack.h +0 -51
- data/vendor/Cocos2D/include/kazmath/GL/matrix.h +0 -58
- data/vendor/Cocos2D/include/kazmath/aabb.h +0 -53
- data/vendor/Cocos2D/include/kazmath/kazmath.h +0 -39
- data/vendor/Cocos2D/include/kazmath/mat3.h +0 -75
- data/vendor/Cocos2D/include/kazmath/mat4.h +0 -93
- data/vendor/Cocos2D/include/kazmath/neon_matrix_impl.h +0 -41
- data/vendor/Cocos2D/include/kazmath/plane.h +0 -70
- data/vendor/Cocos2D/include/kazmath/quaternion.h +0 -113
- data/vendor/Cocos2D/include/kazmath/ray2.h +0 -50
- data/vendor/Cocos2D/include/kazmath/utility.h +0 -74
- data/vendor/Cocos2D/include/kazmath/vec2.h +0 -64
- data/vendor/Cocos2D/include/kazmath/vec3.h +0 -68
- data/vendor/Cocos2D/include/kazmath/vec4.h +0 -68
- data/vendor/Cocos2D/libCocosDenshion.a +0 -0
- data/vendor/Cocos2D/libcocos2d.a +0 -0
@@ -0,0 +1,145 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (C) 2009 Matt Oswald
|
5
|
+
*
|
6
|
+
* Copyright (c) 2009-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
|
+
|
29
|
+
|
30
|
+
#import "CCNode.h"
|
31
|
+
#import "CCProtocols.h"
|
32
|
+
#import "CCTextureAtlas.h"
|
33
|
+
#import "ccMacros.h"
|
34
|
+
|
35
|
+
#pragma mark CCSpriteBatchNode
|
36
|
+
|
37
|
+
@class CCSprite;
|
38
|
+
|
39
|
+
/** CCSpriteBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call
|
40
|
+
* (often known as "batch draw").
|
41
|
+
*
|
42
|
+
* A CCSpriteBatchNode can reference one and only one texture (one image file, one texture atlas).
|
43
|
+
* Only the CCSprites that are contained in that texture can be added to the CCSpriteBatchNode.
|
44
|
+
* All CCSprites added to a CCSpriteBatchNode are drawn in one OpenGL ES draw call.
|
45
|
+
* If the CCSprites are not added to a CCSpriteBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient.
|
46
|
+
*
|
47
|
+
*
|
48
|
+
* Limitations:
|
49
|
+
* - The only object that is accepted as child (or grandchild, grand-grandchild, etc...) is CCSprite or any subclass of CCSprite. eg: particles, labels and layer can't be added to a CCSpriteBatchNode.
|
50
|
+
* - Either all its children are Aliased or Antialiased. It can't be a mix. This is because "alias" is a property of the texture, and all the sprites share the same texture.
|
51
|
+
*
|
52
|
+
* @since v0.7.1
|
53
|
+
*/
|
54
|
+
@interface CCSpriteBatchNode : CCNode <CCTextureProtocol>
|
55
|
+
{
|
56
|
+
CCTextureAtlas *_textureAtlas;
|
57
|
+
ccBlendFunc _blendFunc;
|
58
|
+
|
59
|
+
// all descendants: children, grandchildren, etc...
|
60
|
+
CCArray *_descendants;
|
61
|
+
}
|
62
|
+
|
63
|
+
/** returns the TextureAtlas that is used */
|
64
|
+
@property (nonatomic,readwrite,retain) CCTextureAtlas * textureAtlas;
|
65
|
+
|
66
|
+
/** conforms to CCTextureProtocol protocol */
|
67
|
+
@property (nonatomic,readwrite) ccBlendFunc blendFunc;
|
68
|
+
|
69
|
+
/** descendants (children, grandchildren, etc) */
|
70
|
+
@property (nonatomic,readonly) CCArray *descendants;
|
71
|
+
|
72
|
+
/** creates a CCSpriteBatchNode with a texture2d and a default capacity of 29 children.
|
73
|
+
The capacity will be increased in 33% in runtime if it run out of space.
|
74
|
+
*/
|
75
|
+
+(id)batchNodeWithTexture:(CCTexture2D *)tex;
|
76
|
+
|
77
|
+
/** creates a CCSpriteBatchNode with a texture2d and capacity of children.
|
78
|
+
The capacity will be increased in 33% in runtime if it run out of space.
|
79
|
+
*/
|
80
|
+
+(id)batchNodeWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity;
|
81
|
+
|
82
|
+
/** creates a CCSpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) with a default capacity of 29 children.
|
83
|
+
The capacity will be increased in 33% in runtime if it run out of space.
|
84
|
+
The file will be loaded using the TextureMgr.
|
85
|
+
*/
|
86
|
+
+(id)batchNodeWithFile:(NSString*) fileImage;
|
87
|
+
|
88
|
+
/** creates a CCSpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) and capacity of children.
|
89
|
+
The capacity will be increased in 33% in runtime if it run out of space.
|
90
|
+
The file will be loaded using the TextureMgr.
|
91
|
+
*/
|
92
|
+
+(id)batchNodeWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity;
|
93
|
+
|
94
|
+
/** initializes a CCSpriteBatchNode with a texture2d and capacity of children.
|
95
|
+
The capacity will be increased in 33% in runtime if it run out of space.
|
96
|
+
*/
|
97
|
+
-(id)initWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity;
|
98
|
+
/** initializes a CCSpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) and a capacity of children.
|
99
|
+
The capacity will be increased in 33% in runtime if it run out of space.
|
100
|
+
The file will be loaded using the TextureMgr.
|
101
|
+
*/
|
102
|
+
-(id)initWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity;
|
103
|
+
|
104
|
+
-(void) increaseAtlasCapacity;
|
105
|
+
|
106
|
+
/** removes a child given a certain index. It will also cleanup the running actions depending on the cleanup parameter.
|
107
|
+
@warning Removing a child from a CCSpriteBatchNode is very slow
|
108
|
+
*/
|
109
|
+
-(void)removeChildAtIndex:(NSUInteger)index cleanup:(BOOL)doCleanup;
|
110
|
+
|
111
|
+
/** removes a child given a reference. It will also cleanup the running actions depending on the cleanup parameter.
|
112
|
+
@warning Removing a child from a CCSpriteBatchNode is very slow
|
113
|
+
*/
|
114
|
+
-(void)removeChild: (CCSprite *)sprite cleanup:(BOOL)doCleanup;
|
115
|
+
|
116
|
+
-(void) insertChild:(CCSprite*)child inAtlasAtIndex:(NSUInteger)index;
|
117
|
+
-(void) appendChild:(CCSprite*)sprite;
|
118
|
+
-(void) removeSpriteFromAtlas:(CCSprite*)sprite;
|
119
|
+
|
120
|
+
-(NSUInteger) rebuildIndexInOrder:(CCSprite*)parent atlasIndex:(NSUInteger)index;
|
121
|
+
-(NSUInteger) atlasIndexForChild:(CCSprite*)sprite atZ:(NSInteger)z;
|
122
|
+
/* Sprites use this to start sortChildren, don't call this manually */
|
123
|
+
- (void) reorderBatch:(BOOL) reorder;
|
124
|
+
|
125
|
+
@end
|
126
|
+
|
127
|
+
@interface CCSpriteBatchNode (QuadExtensions)
|
128
|
+
/** Inserts a quad at a certain index into the texture atlas. The CCSprite won't be added into the children array.
|
129
|
+
This method should be called only when you are dealing with very big AtlasSrite and when most of the CCSprite won't be updated.
|
130
|
+
For example: a tile map (CCTMXMap) or a label with lots of characters (CCLabelBMFont)
|
131
|
+
*/
|
132
|
+
-(void) insertQuadFromSprite:(CCSprite*)sprite quadIndex:(NSUInteger)index;
|
133
|
+
|
134
|
+
/** Updates a quad at a certain index into the texture atlas. The CCSprite won't be added into the children array.
|
135
|
+
This method should be called only when you are dealing with very big AtlasSrite and when most of the CCSprite won't be updated.
|
136
|
+
For example: a tile map (CCTMXMap) or a label with lots of characters (CCLabelBMFont)
|
137
|
+
*/
|
138
|
+
-(void) updateQuadFromSprite:(CCSprite*)sprite quadIndex:(NSUInteger)index;
|
139
|
+
|
140
|
+
/* This is the opposite of "addQuadFromSprite".
|
141
|
+
It adds the sprite to the children and descendants array, but it doesn't add it to the texture atlas.
|
142
|
+
*/
|
143
|
+
-(id) addSpriteWithoutQuad:(CCSprite*)child z:(NSUInteger)z tag:(NSInteger)aTag;
|
144
|
+
|
145
|
+
@end
|
@@ -0,0 +1,126 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2011 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 <Foundation/Foundation.h>
|
28
|
+
#import "CCNode.h"
|
29
|
+
#import "CCProtocols.h"
|
30
|
+
|
31
|
+
/** A CCSpriteFrame has:
|
32
|
+
- texture: A CCTexture2D that will be used by the CCSprite
|
33
|
+
- rectangle: A rectangle of the texture
|
34
|
+
|
35
|
+
|
36
|
+
You can modify the frame of a CCSprite by doing:
|
37
|
+
|
38
|
+
CCSpriteFrame *frame = [CCSpriteFrame frameWithTexture:texture rect:rect offset:offset];
|
39
|
+
[sprite setDisplayFrame:frame];
|
40
|
+
*/
|
41
|
+
@interface CCSpriteFrame : NSObject <NSCopying>
|
42
|
+
{
|
43
|
+
CGRect _rect;
|
44
|
+
CGRect _rectInPixels;
|
45
|
+
BOOL _rotated;
|
46
|
+
CGPoint _offset;
|
47
|
+
CGPoint _offsetInPixels;
|
48
|
+
CGSize _originalSize;
|
49
|
+
CGSize _originalSizeInPixels;
|
50
|
+
CCTexture2D *_texture;
|
51
|
+
NSString *_textureFilename;
|
52
|
+
}
|
53
|
+
/** rect of the frame in points. If it is updated, then rectInPixels will be updated too. */
|
54
|
+
@property (nonatomic,readwrite) CGRect rect;
|
55
|
+
|
56
|
+
/** rect of the frame in pixels. If it is updated, then rect (points) will be updated too. */
|
57
|
+
@property (nonatomic,readwrite) CGRect rectInPixels;
|
58
|
+
|
59
|
+
/** whether or not the rect of the frame is rotated ( x = x+width, y = y+height, width = height, height = width ) */
|
60
|
+
@property (nonatomic,readwrite) BOOL rotated;
|
61
|
+
|
62
|
+
/** offset of the frame in points */
|
63
|
+
@property (nonatomic,readwrite) CGPoint offset;
|
64
|
+
|
65
|
+
/** offset of the frame in pixels */
|
66
|
+
@property (nonatomic,readwrite) CGPoint offsetInPixels;
|
67
|
+
|
68
|
+
/** original size of the trimmed image in points */
|
69
|
+
@property (nonatomic,readwrite) CGSize originalSize;
|
70
|
+
|
71
|
+
/** original size of the trimmed image in pixels */
|
72
|
+
@property (nonatomic,readwrite) CGSize originalSizeInPixels;
|
73
|
+
|
74
|
+
/** texture of the frame */
|
75
|
+
@property (nonatomic, retain, readwrite) CCTexture2D *texture;
|
76
|
+
|
77
|
+
/** texture file name of the frame */
|
78
|
+
@property (nonatomic, retain, readonly) NSString *textureFilename;
|
79
|
+
|
80
|
+
/** Create a CCSpriteFrame with a texture, rect in points.
|
81
|
+
It is assumed that the frame was not trimmed.
|
82
|
+
*/
|
83
|
+
+(id) frameWithTexture:(CCTexture2D*)texture rect:(CGRect)rect;
|
84
|
+
|
85
|
+
/** Create a CCSpriteFrame with a texture filename, rect in points.
|
86
|
+
It is assumed that the frame was not trimmed.
|
87
|
+
*/
|
88
|
+
+(id) frameWithTextureFilename:(NSString*)filename rect:(CGRect)rect;
|
89
|
+
|
90
|
+
/** Create a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels.
|
91
|
+
The originalSize is the size in pixels of the frame before being trimmed.
|
92
|
+
*/
|
93
|
+
+(id) frameWithTexture:(CCTexture2D*)texture rectInPixels:(CGRect)rect rotated:(BOOL)rotated offset:(CGPoint)offset originalSize:(CGSize)originalSize;
|
94
|
+
|
95
|
+
|
96
|
+
/** Create a CCSpriteFrame with a texture filename, rect, rotated, offset and originalSize in pixels.
|
97
|
+
The originalSize is the size in pixels of the frame before being trimmed.
|
98
|
+
*/
|
99
|
+
+(id) frameWithTextureFilename:(NSString*)filename rectInPixels:(CGRect)rect rotated:(BOOL)rotated offset:(CGPoint)offset originalSize:(CGSize)originalSize;
|
100
|
+
|
101
|
+
|
102
|
+
/** Initializes a CCSpriteFrame with a texture, rect in points;
|
103
|
+
It is assumed that the frame was not trimmed.
|
104
|
+
*/
|
105
|
+
-(id) initWithTexture:(CCTexture2D*)texture rect:(CGRect)rect;
|
106
|
+
|
107
|
+
/** Initializes a CCSpriteFrame with a texture filename, rect in points;
|
108
|
+
It is assumed that the frame was not trimmed.
|
109
|
+
*/
|
110
|
+
-(id) initWithTextureFilename:(NSString*)filename rect:(CGRect)rect;
|
111
|
+
|
112
|
+
|
113
|
+
/** Initializes a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels.
|
114
|
+
The originalSize is the size in pixels of the frame before being trimmed.
|
115
|
+
*/
|
116
|
+
-(id) initWithTexture:(CCTexture2D*)texture rectInPixels:(CGRect)rect rotated:(BOOL)rotated offset:(CGPoint)offset originalSize:(CGSize)originalSize;
|
117
|
+
|
118
|
+
/** Initializes a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels.
|
119
|
+
The originalSize is the size in pixels of the frame before being trimmed.
|
120
|
+
|
121
|
+
@since v1.1
|
122
|
+
*/
|
123
|
+
-(id) initWithTextureFilename:(NSString*)filename rectInPixels:(CGRect)rect rotated:(BOOL)rotated offset:(CGPoint)offset originalSize:(CGSize)originalSize;
|
124
|
+
|
125
|
+
@end
|
126
|
+
|
@@ -0,0 +1,121 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (c) 2009 Jason Booth
|
5
|
+
*
|
6
|
+
* Copyright (c) 2009 Robert J Payne
|
7
|
+
*
|
8
|
+
* Copyright (c) 2008-2010 Ricardo Quesada
|
9
|
+
* Copyright (c) 2011 Zynga Inc.
|
10
|
+
*
|
11
|
+
*
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
|
+
* of this software and associated documentation files (the "Software"), to deal
|
14
|
+
* in the Software without restriction, including without limitation the rights
|
15
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
16
|
+
* copies of the Software, and to permit persons to whom the Software is
|
17
|
+
* furnished to do so, subject to the following conditions:
|
18
|
+
*
|
19
|
+
* The above copyright notice and this permission notice shall be included in
|
20
|
+
* all copies or substantial portions of the Software.
|
21
|
+
*
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
23
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
24
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
25
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
26
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
27
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
28
|
+
* THE SOFTWARE.
|
29
|
+
*
|
30
|
+
*/
|
31
|
+
|
32
|
+
|
33
|
+
/*
|
34
|
+
* To create sprite frames and texture atlas, use this tool:
|
35
|
+
* http://zwoptex.zwopple.com/
|
36
|
+
*/
|
37
|
+
|
38
|
+
#import <Foundation/Foundation.h>
|
39
|
+
|
40
|
+
#import "CCSpriteFrame.h"
|
41
|
+
|
42
|
+
@class CCSprite;
|
43
|
+
@class CCTexture2D;
|
44
|
+
|
45
|
+
/** Singleton that handles the loading of the sprite frames.
|
46
|
+
It saves in a cache the sprite frames.
|
47
|
+
@since v0.9
|
48
|
+
*/
|
49
|
+
@interface CCSpriteFrameCache : NSObject
|
50
|
+
{
|
51
|
+
NSMutableDictionary *_spriteFrames;
|
52
|
+
NSMutableDictionary *_spriteFramesAliases;
|
53
|
+
NSMutableSet *_loadedFilenames;
|
54
|
+
}
|
55
|
+
|
56
|
+
/** Retruns ths shared instance of the Sprite Frame cache */
|
57
|
+
+ (CCSpriteFrameCache *) sharedSpriteFrameCache;
|
58
|
+
|
59
|
+
/** Purges the cache. It releases all the Sprite Frames and the retained instance.
|
60
|
+
*/
|
61
|
+
+(void)purgeSharedSpriteFrameCache;
|
62
|
+
|
63
|
+
|
64
|
+
/** Adds multiple Sprite Frames from a plist file.
|
65
|
+
* A texture will be loaded automatically. The texture name will composed by replacing the .plist suffix with .png .
|
66
|
+
* If you want to use another texture, you should use the addSpriteFramesWithFile:texture method.
|
67
|
+
*/
|
68
|
+
-(void) addSpriteFramesWithFile:(NSString*)plist;
|
69
|
+
|
70
|
+
/** Adds multiple Sprite Frames from a plist file. The texture filename will be associated with the created sprite frames.
|
71
|
+
*/
|
72
|
+
-(void) addSpriteFramesWithFile:(NSString*)plist textureFilename:(NSString*)filename;
|
73
|
+
|
74
|
+
/** Adds multiple Sprite Frames from a plist file. The texture will be associated with the created sprite frames.
|
75
|
+
*/
|
76
|
+
-(void) addSpriteFramesWithFile:(NSString*)plist texture:(CCTexture2D*)texture;
|
77
|
+
|
78
|
+
/** Adds an sprite frame with a given name.
|
79
|
+
If the name already exists, then the contents of the old name will be replaced with the new one.
|
80
|
+
*/
|
81
|
+
-(void) addSpriteFrame:(CCSpriteFrame*)frame name:(NSString*)frameName;
|
82
|
+
|
83
|
+
|
84
|
+
/** Purges the dictionary of loaded sprite frames.
|
85
|
+
* Call this method if you receive the "Memory Warning".
|
86
|
+
* In the short term: it will free some resources preventing your app from being killed.
|
87
|
+
* In the medium term: it will allocate more resources.
|
88
|
+
* In the long term: it will be the same.
|
89
|
+
*/
|
90
|
+
-(void) removeSpriteFrames;
|
91
|
+
|
92
|
+
/** Removes unused sprite frames.
|
93
|
+
* Sprite Frames that have a retain count of 1 will be deleted.
|
94
|
+
* It is convenient to call this method after when starting a new Scene.
|
95
|
+
*/
|
96
|
+
-(void) removeUnusedSpriteFrames;
|
97
|
+
|
98
|
+
/** Deletes an sprite frame from the sprite frame cache.
|
99
|
+
*/
|
100
|
+
-(void) removeSpriteFrameByName:(NSString*)name;
|
101
|
+
|
102
|
+
/** Removes multiple Sprite Frames from a plist file.
|
103
|
+
* Sprite Frames stored in this file will be removed.
|
104
|
+
* It is convenient to call this method when a specific texture needs to be removed.
|
105
|
+
* @since v0.99.5
|
106
|
+
*/
|
107
|
+
- (void) removeSpriteFramesFromFile:(NSString*) plist;
|
108
|
+
|
109
|
+
/** Removes all Sprite Frames associated with the specified textures.
|
110
|
+
* It is convenient to call this method when a specific texture needs to be removed.
|
111
|
+
* @since v0.995.
|
112
|
+
*/
|
113
|
+
- (void) removeSpriteFramesFromTexture:(CCTexture2D*) texture;
|
114
|
+
|
115
|
+
/** Returns an Sprite Frame that was previously added.
|
116
|
+
If the name is not found it will return nil.
|
117
|
+
You should retain the returned copy if you are going to use it.
|
118
|
+
*/
|
119
|
+
-(CCSpriteFrame*) spriteFrameByName:(NSString*)name;
|
120
|
+
|
121
|
+
@end
|
@@ -0,0 +1,164 @@
|
|
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
|
+
* TMX Tiled Map support:
|
27
|
+
* http://www.mapeditor.org
|
28
|
+
*
|
29
|
+
*/
|
30
|
+
|
31
|
+
|
32
|
+
#import "CCAtlasNode.h"
|
33
|
+
#import "CCSpriteBatchNode.h"
|
34
|
+
#import "CCTMXXMLParser.h"
|
35
|
+
|
36
|
+
@class CCTMXMapInfo;
|
37
|
+
@class CCTMXLayerInfo;
|
38
|
+
@class CCTMXTilesetInfo;
|
39
|
+
|
40
|
+
|
41
|
+
/** CCTMXLayer represents the TMX layer.
|
42
|
+
|
43
|
+
It is a subclass of CCSpriteBatchNode. By default the tiles are rendered using a CCTextureAtlas.
|
44
|
+
If you mofify a tile on runtime, then, that tile will become a CCSprite, otherwise no CCSprite objects are created.
|
45
|
+
The benefits of using CCSprite objects as tiles are:
|
46
|
+
- tiles (CCSprite) can be rotated/scaled/moved with a nice API
|
47
|
+
|
48
|
+
cocos2d v2.0 doesn't support the cc_vertexz value. Whenever a the cc_vertexz property is found, it will raise an exception.
|
49
|
+
|
50
|
+
"value" by default is 0, but you can change it from Tiled by adding the "cc_alpha_func" property to the layer.
|
51
|
+
The value 0 should work for most cases, but if you have tiles that are semi-transparent, then you might want to use a differnt
|
52
|
+
value, like 0.5.
|
53
|
+
|
54
|
+
For further information, please see the programming guide:
|
55
|
+
|
56
|
+
http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps
|
57
|
+
|
58
|
+
@since v0.8.1
|
59
|
+
|
60
|
+
Tiles can have tile flags for additional properties. At the moment only flip horizontal and flip vertical are used. These bit flags are defined in CCTMXXMLParser.h.
|
61
|
+
|
62
|
+
@since 1.1
|
63
|
+
*/
|
64
|
+
@interface CCTMXLayer : CCSpriteBatchNode
|
65
|
+
{
|
66
|
+
CCTMXTilesetInfo *_tileset;
|
67
|
+
NSString *_layerName;
|
68
|
+
CGSize _layerSize;
|
69
|
+
CGSize _mapTileSize;
|
70
|
+
uint32_t *_tiles; // GID are 32 bit
|
71
|
+
NSUInteger _layerOrientation;
|
72
|
+
NSMutableArray *_properties;
|
73
|
+
|
74
|
+
unsigned char _opacity; // TMX Layer supports opacity
|
75
|
+
|
76
|
+
NSUInteger _minGID;
|
77
|
+
NSUInteger _maxGID;
|
78
|
+
|
79
|
+
// Only used when vertexZ is used
|
80
|
+
NSInteger _vertexZvalue;
|
81
|
+
BOOL _useAutomaticVertexZ;
|
82
|
+
|
83
|
+
// used for optimization
|
84
|
+
CCSprite *_reusedTile;
|
85
|
+
ccCArray *_atlasIndexArray;
|
86
|
+
}
|
87
|
+
/** name of the layer */
|
88
|
+
@property (nonatomic,readwrite,retain) NSString *layerName;
|
89
|
+
/** size of the layer in tiles */
|
90
|
+
@property (nonatomic,readwrite) CGSize layerSize;
|
91
|
+
/** size of the map's tile (could be different from the tile's size) */
|
92
|
+
@property (nonatomic,readwrite) CGSize mapTileSize;
|
93
|
+
/** pointer to the map of tiles */
|
94
|
+
@property (nonatomic,readwrite) uint32_t *tiles;
|
95
|
+
/** Tileset information for the layer */
|
96
|
+
@property (nonatomic,readwrite,retain) CCTMXTilesetInfo *tileset;
|
97
|
+
/** Layer orientation, which is the same as the map orientation */
|
98
|
+
@property (nonatomic,readwrite) NSUInteger layerOrientation;
|
99
|
+
/** properties from the layer. They can be added using Tiled */
|
100
|
+
@property (nonatomic,readwrite,retain) NSMutableArray *properties;
|
101
|
+
|
102
|
+
/** creates a CCTMXLayer with an tileset info, a layer info and a map info */
|
103
|
+
+(id) layerWithTilesetInfo:(CCTMXTilesetInfo*)tilesetInfo layerInfo:(CCTMXLayerInfo*)layerInfo mapInfo:(CCTMXMapInfo*)mapInfo;
|
104
|
+
/** initializes a CCTMXLayer with a tileset info, a layer info and a map info */
|
105
|
+
-(id) initWithTilesetInfo:(CCTMXTilesetInfo*)tilesetInfo layerInfo:(CCTMXLayerInfo*)layerInfo mapInfo:(CCTMXMapInfo*)mapInfo;
|
106
|
+
|
107
|
+
/** dealloc the map that contains the tile position from memory.
|
108
|
+
Unless you want to know at runtime the tiles positions, you can safely call this method.
|
109
|
+
If you are going to call [layer tileGIDAt:] then, don't release the map
|
110
|
+
*/
|
111
|
+
-(void) releaseMap;
|
112
|
+
|
113
|
+
/** returns the tile (CCSprite) at a given a tile coordinate.
|
114
|
+
The returned CCSprite will be already added to the CCTMXLayer. Don't add it again.
|
115
|
+
The CCSprite can be treated like any other CCSprite: rotated, scaled, translated, opacity, color, etc.
|
116
|
+
You can remove either by calling:
|
117
|
+
- [layer removeChild:sprite cleanup:cleanup];
|
118
|
+
- or [layer removeTileAt:ccp(x,y)];
|
119
|
+
*/
|
120
|
+
-(CCSprite*) tileAt:(CGPoint)tileCoordinate;
|
121
|
+
|
122
|
+
/** returns the tile gid at a given tile coordinate.
|
123
|
+
if it returns 0, it means that the tile is empty.
|
124
|
+
This method requires the the tile map has not been previously released (eg. don't call [layer releaseMap])
|
125
|
+
*/
|
126
|
+
-(uint32_t) tileGIDAt:(CGPoint)tileCoordinate;
|
127
|
+
|
128
|
+
/** returns the tile gid at a given tile coordinate. It also returns the tile flags.
|
129
|
+
This method requires the the tile map has not been previously released (eg. don't call [layer releaseMap])
|
130
|
+
*/
|
131
|
+
-(uint32_t) tileGIDAt:(CGPoint)pos withFlags:(ccTMXTileFlags*)flags;
|
132
|
+
|
133
|
+
/** sets the tile gid (gid = tile global id) at a given tile coordinate.
|
134
|
+
The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1.
|
135
|
+
If a tile is already placed at that position, then it will be removed.
|
136
|
+
*/
|
137
|
+
-(void) setTileGID:(uint32_t)gid at:(CGPoint)tileCoordinate;
|
138
|
+
|
139
|
+
/** sets the tile gid (gid = tile global id) at a given tile coordinate.
|
140
|
+
The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1.
|
141
|
+
If a tile is already placed at that position, then it will be removed.
|
142
|
+
|
143
|
+
Use withFlags if the tile flags need to be changed as well
|
144
|
+
*/
|
145
|
+
|
146
|
+
-(void) setTileGID:(uint32_t)gid at:(CGPoint)pos withFlags:(ccTMXTileFlags)flags;
|
147
|
+
|
148
|
+
/** removes a tile at given tile coordinate */
|
149
|
+
-(void) removeTileAt:(CGPoint)tileCoordinate;
|
150
|
+
|
151
|
+
/** returns the position in points of a given tile coordinate */
|
152
|
+
-(CGPoint) positionAt:(CGPoint)tileCoordinate;
|
153
|
+
|
154
|
+
/** return the value for the specific property name */
|
155
|
+
-(id) propertyNamed:(NSString *)propertyName;
|
156
|
+
|
157
|
+
/** Creates the tiles */
|
158
|
+
-(void) setupTiles;
|
159
|
+
|
160
|
+
/** CCTMXLayer doesn't support adding a CCSprite manually.
|
161
|
+
@warning addchild:z:tag: is not supported on CCTMXLayer. Instead of setTileGID:at:/tileAt:
|
162
|
+
*/
|
163
|
+
-(void) addChild: (CCNode*)node z:(NSInteger)z tag:(NSInteger)tag;
|
164
|
+
@end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (c) 2010 Neophit
|
5
|
+
*
|
6
|
+
* Copyright (c) 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
|
+
* TMX Tiled Map support:
|
29
|
+
* http://www.mapeditor.org
|
30
|
+
*
|
31
|
+
*/
|
32
|
+
|
33
|
+
#import "CCNode.h"
|
34
|
+
|
35
|
+
|
36
|
+
@class CCTMXObjectGroup;
|
37
|
+
|
38
|
+
|
39
|
+
/** CCTMXObjectGroup represents the TMX object group.
|
40
|
+
@since v0.99.0
|
41
|
+
*/
|
42
|
+
@interface CCTMXObjectGroup : NSObject
|
43
|
+
{
|
44
|
+
NSString *_groupName;
|
45
|
+
CGPoint _positionOffset;
|
46
|
+
NSMutableArray *_objects;
|
47
|
+
NSMutableDictionary *_properties;
|
48
|
+
}
|
49
|
+
|
50
|
+
/** name of the group */
|
51
|
+
@property (nonatomic,readwrite,retain) NSString *groupName;
|
52
|
+
/** offset position of child objects */
|
53
|
+
@property (nonatomic,readwrite,assign) CGPoint positionOffset;
|
54
|
+
/** array of the objects */
|
55
|
+
@property (nonatomic,readwrite,retain) NSMutableArray *objects;
|
56
|
+
/** list of properties stored in a dictionary */
|
57
|
+
@property (nonatomic,readwrite,retain) NSMutableDictionary *properties;
|
58
|
+
|
59
|
+
/** return the value for the specific property name */
|
60
|
+
-(id) propertyNamed:(NSString *)propertyName;
|
61
|
+
|
62
|
+
/** return the dictionary for the specific object name.
|
63
|
+
It will return the 1st object found on the array for the given name.
|
64
|
+
*/
|
65
|
+
-(NSMutableDictionary*) objectNamed:(NSString *)objectName;
|
66
|
+
|
67
|
+
@end
|