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,73 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (c) 2009 Leonardo Kasperavičius
|
5
|
+
*
|
6
|
+
* Copyright (c) 2008-2010 Ricardo Quesada
|
7
|
+
* Copyright (c) 2011 Zynga Inc.
|
8
|
+
*
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
+
* of this software and associated documentation files (the "Software"), to deal
|
11
|
+
* in the Software without restriction, including without limitation the rights
|
12
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
* copies of the Software, and to permit persons to whom the Software is
|
14
|
+
* furnished to do so, subject to the following conditions:
|
15
|
+
*
|
16
|
+
* The above copyright notice and this permission notice shall be included in
|
17
|
+
* all copies or substantial portions of the Software.
|
18
|
+
*
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
25
|
+
* THE SOFTWARE.
|
26
|
+
*
|
27
|
+
*/
|
28
|
+
|
29
|
+
|
30
|
+
#import "CCParticleSystem.h"
|
31
|
+
#import "ccConfig.h"
|
32
|
+
|
33
|
+
@class CCSpriteFrame;
|
34
|
+
|
35
|
+
/** CCParticleSystemQuad is a subclass of CCParticleSystem
|
36
|
+
|
37
|
+
It includes all the features of ParticleSystem.
|
38
|
+
|
39
|
+
Special features and Limitations:
|
40
|
+
- Particle size can be any float number.
|
41
|
+
- The system can be scaled
|
42
|
+
- The particles can be rotated
|
43
|
+
- It supports subrects
|
44
|
+
- It supports batched rendering since 1.1
|
45
|
+
@since v0.8
|
46
|
+
*/
|
47
|
+
@interface CCParticleSystemQuad : CCParticleSystem
|
48
|
+
{
|
49
|
+
ccV3F_C4B_T2F_Quad *_quads; // quads to be rendered
|
50
|
+
GLushort *_indices; // indices
|
51
|
+
GLuint _VAOname;
|
52
|
+
GLuint _buffersVBO[2]; //0: vertex 1: indices
|
53
|
+
}
|
54
|
+
|
55
|
+
/** initialices the indices for the vertices */
|
56
|
+
-(void) initIndices;
|
57
|
+
|
58
|
+
/** initilizes the texture with a rectangle measured Points */
|
59
|
+
-(void) initTexCoordsWithRect:(CGRect)rect;
|
60
|
+
|
61
|
+
/** Sets a new CCSpriteFrame as particle.
|
62
|
+
WARNING: this method is experimental. Use setTexture:withRect instead.
|
63
|
+
@since v0.99.4
|
64
|
+
*/
|
65
|
+
-(void)setDisplayFrame:(CCSpriteFrame*)spriteFrame;
|
66
|
+
|
67
|
+
/** Sets a new texture with a rect. The rect is in Points.
|
68
|
+
@since v0.99.4
|
69
|
+
*/
|
70
|
+
-(void) setTexture:(CCTexture2D *)texture withRect:(CGRect)rect;
|
71
|
+
|
72
|
+
@end
|
73
|
+
|
@@ -0,0 +1,58 @@
|
|
1
|
+
/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to deal
|
5
|
+
* in the Software without restriction, including without limitation the rights
|
6
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
* copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
* SOFTWARE.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#import "ccConfig.h"
|
23
|
+
|
24
|
+
#if CC_ENABLE_CHIPMUNK_INTEGRATION
|
25
|
+
|
26
|
+
#import "chipmunk.h"
|
27
|
+
|
28
|
+
#import "CCDrawNode.h"
|
29
|
+
|
30
|
+
@class ChipmunkSpace;
|
31
|
+
|
32
|
+
/**
|
33
|
+
A Node that draws the components of a physics engine.
|
34
|
+
|
35
|
+
Supported physics engines:
|
36
|
+
- Chipmunk
|
37
|
+
- Objective-Chipmunk
|
38
|
+
|
39
|
+
@since v2.1
|
40
|
+
*/
|
41
|
+
@interface CCPhysicsDebugNode : CCDrawNode
|
42
|
+
{
|
43
|
+
ChipmunkSpace *_spaceObj;
|
44
|
+
cpSpace *_spacePtr;
|
45
|
+
}
|
46
|
+
|
47
|
+
// property for the cpSpace
|
48
|
+
@property (nonatomic, readwrite, assign) cpSpace *space;
|
49
|
+
|
50
|
+
/** Create a debug node for an Objective-Chipmunk space. */
|
51
|
+
+ (id) debugNodeForChipmunkSpace:(ChipmunkSpace *)space;
|
52
|
+
|
53
|
+
/** Create a debug node for a regular Chipmunk space. */
|
54
|
+
+ (id) debugNodeForCPSpace:(cpSpace *)space;
|
55
|
+
|
56
|
+
@end
|
57
|
+
|
58
|
+
#endif // CC_ENABLE_CHIPMUNK_INTEGRATION
|
@@ -0,0 +1,82 @@
|
|
1
|
+
/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to deal
|
5
|
+
* in the Software without restriction, including without limitation the rights
|
6
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
* copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
* SOFTWARE.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#import "ccConfig.h"
|
23
|
+
#import "CCSprite.h"
|
24
|
+
|
25
|
+
|
26
|
+
#if CC_ENABLE_CHIPMUNK_INTEGRATION
|
27
|
+
#import "chipmunk.h"
|
28
|
+
@class ChipmunkBody;
|
29
|
+
|
30
|
+
#elif CC_ENABLE_BOX2D_INTEGRATION
|
31
|
+
class b2Body;
|
32
|
+
#endif // CC_ENABLE_BOX2D_INTEGRATION
|
33
|
+
|
34
|
+
/** A CCSprite subclass that is bound to a physics body.
|
35
|
+
It works with:
|
36
|
+
- Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined
|
37
|
+
- Objective-Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined
|
38
|
+
- Box2d: Preprocessor macro CC_ENABLE_BOX2D_INTEGRATION should be defined
|
39
|
+
|
40
|
+
Features and Limitations:
|
41
|
+
- Scale and Skew properties are ignored.
|
42
|
+
- Position and rotation are going to updated from the physics body
|
43
|
+
- If you update the rotation or position manually, the physics body will be updated
|
44
|
+
- You can't eble both Chipmunk support and Box2d support at the same time. Only one can be enabled at compile time
|
45
|
+
*/
|
46
|
+
@interface CCPhysicsSprite : CCSprite
|
47
|
+
{
|
48
|
+
BOOL _ignoreBodyRotation;
|
49
|
+
|
50
|
+
#if CC_ENABLE_CHIPMUNK_INTEGRATION
|
51
|
+
cpBody *_cpBody;
|
52
|
+
|
53
|
+
#elif CC_ENABLE_BOX2D_INTEGRATION
|
54
|
+
b2Body *_b2Body;
|
55
|
+
|
56
|
+
// Pixels to Meters ratio
|
57
|
+
float _PTMRatio;
|
58
|
+
#endif // CC_ENABLE_BOX2D_INTEGRATION
|
59
|
+
}
|
60
|
+
|
61
|
+
/** Keep the sprite's rotation separate from the body. */
|
62
|
+
@property(nonatomic, assign) BOOL ignoreBodyRotation;
|
63
|
+
|
64
|
+
#if CC_ENABLE_CHIPMUNK_INTEGRATION
|
65
|
+
|
66
|
+
/** Body accessor when using regular Chipmunk */
|
67
|
+
@property(nonatomic, assign) cpBody *CPBody;
|
68
|
+
|
69
|
+
/** Body accessor when using Objective-Chipmunk */
|
70
|
+
@property(nonatomic, assign) ChipmunkBody *chipmunkBody;
|
71
|
+
|
72
|
+
|
73
|
+
#elif CC_ENABLE_BOX2D_INTEGRATION
|
74
|
+
|
75
|
+
/** Body accessor when using box2d */
|
76
|
+
@property(nonatomic, assign) b2Body *b2Body;
|
77
|
+
|
78
|
+
@property(nonatomic, assign) float PTMRatio;
|
79
|
+
|
80
|
+
#endif // CC_ENABLE_BOX2D_INTEGRATION
|
81
|
+
|
82
|
+
@end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (c) 2010 Lam Pham
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*
|
24
|
+
*/
|
25
|
+
|
26
|
+
#import <Foundation/Foundation.h>
|
27
|
+
#import "CCSprite.h"
|
28
|
+
|
29
|
+
/** Types of progress
|
30
|
+
@since v0.99.1
|
31
|
+
*/
|
32
|
+
typedef enum {
|
33
|
+
/// Radial Counter-Clockwise
|
34
|
+
kCCProgressTimerTypeRadial,
|
35
|
+
/// Bar
|
36
|
+
kCCProgressTimerTypeBar,
|
37
|
+
} CCProgressTimerType;
|
38
|
+
|
39
|
+
/**
|
40
|
+
CCProgresstimer is a subclass of CCNode.
|
41
|
+
It renders the inner sprite according to the percentage.
|
42
|
+
The progress can be Radial, Horizontal or vertical.
|
43
|
+
@since v0.99.1
|
44
|
+
*/
|
45
|
+
@interface CCProgressTimer : CCNodeRGBA {
|
46
|
+
CCProgressTimerType _type;
|
47
|
+
float _percentage;
|
48
|
+
CCSprite *_sprite;
|
49
|
+
|
50
|
+
int _vertexDataCount;
|
51
|
+
ccV2F_C4B_T2F *_vertexData;
|
52
|
+
CGPoint _midpoint;
|
53
|
+
CGPoint _barChangeRate;
|
54
|
+
BOOL _reverseDirection;
|
55
|
+
}
|
56
|
+
/** Change the percentage to change progress. */
|
57
|
+
@property (nonatomic, readwrite) CCProgressTimerType type;
|
58
|
+
@property (nonatomic, readwrite) BOOL reverseDirection;
|
59
|
+
@property (nonatomic, readonly) ccV2F_C4B_T2F *vertexData;
|
60
|
+
@property (nonatomic, readonly) int vertexDataCount;
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Midpoint is used to modify the progress start position.
|
64
|
+
* If you're using radials type then the midpoint changes the center point
|
65
|
+
* If you're using bar type the the midpoint changes the bar growth
|
66
|
+
* it expands from the center but clamps to the sprites edge so:
|
67
|
+
* you want a left to right then set the midpoint all the way to ccp(0,y)
|
68
|
+
* you want a right to left then set the midpoint all the way to ccp(1,y)
|
69
|
+
* you want a bottom to top then set the midpoint all the way to ccp(x,0)
|
70
|
+
* you want a top to bottom then set the midpoint all the way to ccp(x,1)
|
71
|
+
*/
|
72
|
+
@property (nonatomic, readwrite) CGPoint midpoint;
|
73
|
+
|
74
|
+
/**
|
75
|
+
* This allows the bar type to move the component at a specific rate
|
76
|
+
* Set the component to 0 to make sure it stays at 100%.
|
77
|
+
* For example you want a left to right bar but not have the height stay 100%
|
78
|
+
* Set the rate to be ccp(0,1); and set the midpoint to = ccp(0,.5f);
|
79
|
+
*/
|
80
|
+
@property (nonatomic, readwrite) CGPoint barChangeRate;
|
81
|
+
|
82
|
+
/** Percentages are from 0 to 100 */
|
83
|
+
@property (nonatomic, readwrite) float percentage;
|
84
|
+
|
85
|
+
/** The image to show the progress percentage */
|
86
|
+
@property (nonatomic, readwrite, retain) CCSprite *sprite;
|
87
|
+
|
88
|
+
/** Creates a progress timer with the sprite as the shape the timer goes through */
|
89
|
+
+ (id) progressWithSprite:(CCSprite*) sprite;
|
90
|
+
/** Initializes a progress timer with the sprite as the shape the timer goes through */
|
91
|
+
- (id) initWithSprite:(CCSprite*) sprite;
|
92
|
+
@end
|
@@ -0,0 +1,160 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-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
|
+
#import "ccMacros.h"
|
27
|
+
#import "ccTypes.h"
|
28
|
+
|
29
|
+
|
30
|
+
@class CCTexture2D;
|
31
|
+
@class CCDirector;
|
32
|
+
|
33
|
+
#pragma mark - CCRGBAProtocol
|
34
|
+
|
35
|
+
/// CC RGBA protocol
|
36
|
+
@protocol CCRGBAProtocol <NSObject>
|
37
|
+
/** sets and returns the color (tint)
|
38
|
+
@since v0.8
|
39
|
+
*/
|
40
|
+
@property (nonatomic) ccColor3B color;
|
41
|
+
/** returns the displayed color */
|
42
|
+
@property (nonatomic, readonly) ccColor3B displayedColor;
|
43
|
+
/** whether or not color should be propagated to its children */
|
44
|
+
@property (nonatomic, getter = isCascadeColorEnabled) BOOL cascadeColorEnabled;
|
45
|
+
|
46
|
+
/** recursive method that updates display color */
|
47
|
+
- (void)updateDisplayedColor:(ccColor3B)color;
|
48
|
+
|
49
|
+
/** sets and returns the opacity.
|
50
|
+
@warning If the the texture has premultiplied alpha then, the R, G and B channels will be modified.
|
51
|
+
Values goes from 0 to 255, where 255 means fully opaque.
|
52
|
+
*/
|
53
|
+
@property (nonatomic) GLubyte opacity;
|
54
|
+
/** returns the displayed opacity */
|
55
|
+
@property (nonatomic, readonly) GLubyte displayedOpacity;
|
56
|
+
/** whether or not opacity should be propagated to its children */
|
57
|
+
@property (nonatomic, getter = isCascadeOpacityEnabled) BOOL cascadeOpacityEnabled;
|
58
|
+
|
59
|
+
/** recursive method that updates the displayed opacity */
|
60
|
+
- (void)updateDisplayedOpacity:(GLubyte)opacity;
|
61
|
+
|
62
|
+
@optional
|
63
|
+
/** sets the premultipliedAlphaOpacity property.
|
64
|
+
If set to NO then opacity will be applied as: glColor(R,G,B,opacity);
|
65
|
+
If set to YES then opacity will be applied as: glColor(opacity, opacity, opacity, opacity );
|
66
|
+
Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO
|
67
|
+
@since v0.8
|
68
|
+
*/
|
69
|
+
-(void) setOpacityModifyRGB:(BOOL)boolean;
|
70
|
+
/** returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity);
|
71
|
+
@since v0.8
|
72
|
+
*/
|
73
|
+
-(BOOL) doesOpacityModifyRGB;
|
74
|
+
@end
|
75
|
+
|
76
|
+
#pragma mark - CCBlendProtocol
|
77
|
+
/**
|
78
|
+
You can specify the blending function.
|
79
|
+
@since v0.99.0
|
80
|
+
*/
|
81
|
+
@protocol CCBlendProtocol <NSObject>
|
82
|
+
/** set the source blending function for the texture */
|
83
|
+
-(void) setBlendFunc:(ccBlendFunc)blendFunc;
|
84
|
+
/** returns the blending function used for the texture */
|
85
|
+
-(ccBlendFunc) blendFunc;
|
86
|
+
@end
|
87
|
+
|
88
|
+
|
89
|
+
#pragma mark - CCTextureProtocol
|
90
|
+
|
91
|
+
/** CCNode objects that uses a Texture2D to render the images.
|
92
|
+
The texture can have a blending function.
|
93
|
+
If the texture has alpha premultiplied the default blending function is:
|
94
|
+
src=GL_ONE dst= GL_ONE_MINUS_SRC_ALPHA
|
95
|
+
else
|
96
|
+
src=GL_SRC_ALPHA dst= GL_ONE_MINUS_SRC_ALPHA
|
97
|
+
But you can change the blending function at any time.
|
98
|
+
@since v0.8.0
|
99
|
+
*/
|
100
|
+
@protocol CCTextureProtocol <CCBlendProtocol>
|
101
|
+
/** returns the used texture */
|
102
|
+
-(CCTexture2D*) texture;
|
103
|
+
/** sets a new texture. it will be retained */
|
104
|
+
-(void) setTexture:(CCTexture2D*)texture;
|
105
|
+
@end
|
106
|
+
|
107
|
+
#pragma mark - CCLabelProtocol
|
108
|
+
/** Common interface for Labels */
|
109
|
+
@protocol CCLabelProtocol <NSObject>
|
110
|
+
/** sets a new label using an NSString.
|
111
|
+
The string will be copied.
|
112
|
+
*/
|
113
|
+
-(void) setString:(NSString*)label;
|
114
|
+
/** returns the string that is rendered */
|
115
|
+
-(NSString*) string;
|
116
|
+
@optional
|
117
|
+
/** sets a new label using a CString.
|
118
|
+
It is faster than setString since it doesn't require to alloc/retain/release an NString object.
|
119
|
+
@since v0.99.0
|
120
|
+
*/
|
121
|
+
-(void) setCString:(char*)label;
|
122
|
+
@end
|
123
|
+
|
124
|
+
|
125
|
+
#pragma mark - CCDirectorDelegate
|
126
|
+
/** CCDirector delegate */
|
127
|
+
@protocol CCDirectorDelegate <NSObject>
|
128
|
+
|
129
|
+
@optional
|
130
|
+
/** Called by CCDirector when the projection is updated, and "custom" projection is used */
|
131
|
+
-(void) updateProjection;
|
132
|
+
|
133
|
+
#ifdef __CC_PLATFORM_IOS
|
134
|
+
/** Returns a Boolean value indicating whether the CCDirector supports the specified orientation. Default value is YES (supports all possible orientations) */
|
135
|
+
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
|
136
|
+
|
137
|
+
// Commented. See issue #1453 for further info: http://code.google.com/p/cocos2d-iphone/issues/detail?id=1453
|
138
|
+
//- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;
|
139
|
+
|
140
|
+
/** Called when projection is resized (due to layoutSubviews on the view). This is important to respond to in order to setup your scene with the proper dimensions (which only exist after the first call to layoutSubviews) so that you can set your scene as early as possible to avoid startup flicker
|
141
|
+
*/
|
142
|
+
-(void) directorDidReshapeProjection:(CCDirector*)director;
|
143
|
+
|
144
|
+
#endif // __CC_PLATFORM_IOS
|
145
|
+
|
146
|
+
@end
|
147
|
+
|
148
|
+
|
149
|
+
#pragma mark - CCAccelerometerDelegate
|
150
|
+
|
151
|
+
#ifdef __CC_PLATFORM_IOS
|
152
|
+
/** CCAccelerometerDelegate delegate */
|
153
|
+
@class UIAcceleration;
|
154
|
+
@class UIAccelerometer;
|
155
|
+
@protocol CCAccelerometerDelegate <NSObject>
|
156
|
+
|
157
|
+
@optional
|
158
|
+
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration;
|
159
|
+
@end
|
160
|
+
#endif // __CC_PLATFORM_IOS
|
@@ -0,0 +1,159 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (c) 2009 Jason Booth
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*
|
24
|
+
*/
|
25
|
+
|
26
|
+
#import <Foundation/Foundation.h>
|
27
|
+
|
28
|
+
#import "ccMacros.h"
|
29
|
+
#import "CCNode.h"
|
30
|
+
#import "CCSprite.h"
|
31
|
+
#import "Support/OpenGL_Internal.h"
|
32
|
+
#import "kazmath/mat4.h"
|
33
|
+
|
34
|
+
#ifdef __CC_PLATFORM_IOS
|
35
|
+
#import <UIKit/UIKit.h>
|
36
|
+
#endif // iPHone
|
37
|
+
|
38
|
+
typedef enum
|
39
|
+
{
|
40
|
+
kCCImageFormatJPEG = 0,
|
41
|
+
kCCImageFormatPNG = 1,
|
42
|
+
} tCCImageFormat;
|
43
|
+
|
44
|
+
|
45
|
+
/**
|
46
|
+
CCRenderTexture is a generic rendering target. To render things into it,
|
47
|
+
simply construct a render target, call begin on it, call visit on any cocos2d
|
48
|
+
scenes or objects to render them, and call end. For convenience, render texture
|
49
|
+
adds a sprite as its display child with the results, so you can simply add
|
50
|
+
the render texture to your scene and treat it like any other CCNode.
|
51
|
+
There are also functions for saving the render texture to disk in PNG or JPG format.
|
52
|
+
|
53
|
+
@since v0.8.1
|
54
|
+
*/
|
55
|
+
@interface CCRenderTexture : CCNode
|
56
|
+
{
|
57
|
+
GLuint _FBO;
|
58
|
+
GLuint _depthRenderBufffer;
|
59
|
+
GLint _oldFBO;
|
60
|
+
CCTexture2D* _texture;
|
61
|
+
CCSprite* _sprite;
|
62
|
+
GLenum _pixelFormat;
|
63
|
+
|
64
|
+
// code for "auto" update
|
65
|
+
GLbitfield _clearFlags;
|
66
|
+
ccColor4F _clearColor;
|
67
|
+
GLclampf _clearDepth;
|
68
|
+
GLint _clearStencil;
|
69
|
+
BOOL _autoDraw;
|
70
|
+
}
|
71
|
+
|
72
|
+
/** The CCSprite being used.
|
73
|
+
The sprite, by default, will use the following blending function: GL_ONE, GL_ONE_MINUS_SRC_ALPHA.
|
74
|
+
The blending function can be changed in runtime by calling:
|
75
|
+
- [[renderTexture sprite] setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}];
|
76
|
+
*/
|
77
|
+
@property (nonatomic,readwrite, retain) CCSprite* sprite;
|
78
|
+
|
79
|
+
/** Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when "autoDraw is YES. */
|
80
|
+
@property (nonatomic, readwrite) GLbitfield clearFlags;
|
81
|
+
/** Clear color value. Valid only when "autoDraw" is YES. */
|
82
|
+
@property (nonatomic, readwrite) ccColor4F clearColor;
|
83
|
+
/** Value for clearDepth. Valid only when autoDraw is YES. */
|
84
|
+
@property (nonatomic, readwrite) GLclampf clearDepth;
|
85
|
+
/** Value for clear Stencil. Valid only when autoDraw is YES */
|
86
|
+
@property (nonatomic, readwrite) GLint clearStencil;
|
87
|
+
/** When enabled, it will render its children into the texture automatically. Disabled by default for compatiblity reasons.
|
88
|
+
Will be enabled in the future.
|
89
|
+
*/
|
90
|
+
@property (nonatomic, readwrite) BOOL autoDraw;
|
91
|
+
|
92
|
+
|
93
|
+
/** initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format*/
|
94
|
+
+(id)renderTextureWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat) format depthStencilFormat:(GLuint)depthStencilFormat;
|
95
|
+
|
96
|
+
/** creates a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid */
|
97
|
+
+(id)renderTextureWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat) format;
|
98
|
+
|
99
|
+
/** creates a RenderTexture object with width and height in Points, pixel format is RGBA8888 */
|
100
|
+
+(id)renderTextureWithWidth:(int)w height:(int)h;
|
101
|
+
|
102
|
+
/** initializes a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid */
|
103
|
+
-(id)initWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat) format;
|
104
|
+
|
105
|
+
/** initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format*/
|
106
|
+
- (id)initWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat)format depthStencilFormat:(GLuint)depthStencilFormat;
|
107
|
+
|
108
|
+
/** starts grabbing */
|
109
|
+
-(void)begin;
|
110
|
+
|
111
|
+
/** starts rendering to the texture while clearing the texture first.
|
112
|
+
This is more efficient then calling -clear first and then -begin */
|
113
|
+
-(void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a;
|
114
|
+
|
115
|
+
/** starts rendering to the texture while clearing the texture first.
|
116
|
+
This is more efficient then calling -clear first and then -begin */
|
117
|
+
- (void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a depth:(float)depthValue;
|
118
|
+
|
119
|
+
/** starts rendering to the texture while clearing the texture first.
|
120
|
+
This is more efficient then calling -clear first and then -begin */
|
121
|
+
- (void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a depth:(float)depthValue stencil:(int)stencilValue;
|
122
|
+
|
123
|
+
|
124
|
+
/** ends grabbing */
|
125
|
+
-(void)end;
|
126
|
+
|
127
|
+
/** clears the texture with a color */
|
128
|
+
-(void)clear:(float)r g:(float)g b:(float)b a:(float)a;
|
129
|
+
|
130
|
+
/** clears the texture with a specified depth value */
|
131
|
+
- (void)clearDepth:(float)depthValue;
|
132
|
+
|
133
|
+
/** clears the texture with a specified stencil value */
|
134
|
+
- (void)clearStencil:(int)stencilValue;
|
135
|
+
|
136
|
+
/* creates a new CGImage from with the texture's data.
|
137
|
+
Caller is responsible for releasing it by calling CGImageRelease().
|
138
|
+
*/
|
139
|
+
-(CGImageRef) newCGImage;
|
140
|
+
|
141
|
+
/** saves the texture into a file using JPEG format. The file will be saved in the Documents folder.
|
142
|
+
Returns YES if the operation is successful.
|
143
|
+
*/
|
144
|
+
-(BOOL)saveToFile:(NSString*)name;
|
145
|
+
|
146
|
+
/** saves the texture into a file. The format could be JPG or PNG. The file will be saved in the Documents folder.
|
147
|
+
Returns YES if the operation is successful.
|
148
|
+
*/
|
149
|
+
-(BOOL)saveToFile:(NSString*)name format:(tCCImageFormat)format;
|
150
|
+
|
151
|
+
#ifdef __CC_PLATFORM_IOS
|
152
|
+
|
153
|
+
/* returns an autoreleased UIImage from the texture */
|
154
|
+
-(UIImage *) getUIImage;
|
155
|
+
|
156
|
+
#endif // __CC_PLATFORM_IOS
|
157
|
+
|
158
|
+
@end
|
159
|
+
|
@@ -0,0 +1,47 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2010 Ricardo Quesada
|
5
|
+
* Copyright (c) 2011 Zynga Inc.
|
6
|
+
*
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
12
|
+
* furnished to do so, subject to the following conditions:
|
13
|
+
*
|
14
|
+
* The above copyright notice and this permission notice shall be included in
|
15
|
+
* all copies or substantial portions of the Software.
|
16
|
+
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
|
+
* THE SOFTWARE.
|
24
|
+
*
|
25
|
+
*/
|
26
|
+
|
27
|
+
|
28
|
+
#import "CCNode.h"
|
29
|
+
|
30
|
+
/** CCScene is a subclass of CCNode that is used only as an abstract concept.
|
31
|
+
|
32
|
+
CCScene an CCNode are almost identical with the difference that CCScene has its
|
33
|
+
anchor point (by default) at the center of the screen.
|
34
|
+
|
35
|
+
For the moment CCScene has no other logic than that, but in future releases it might have
|
36
|
+
additional logic.
|
37
|
+
|
38
|
+
It is a good practice to use and CCScene as the parent of all your nodes.
|
39
|
+
*/
|
40
|
+
@interface CCScene : CCNode
|
41
|
+
{
|
42
|
+
}
|
43
|
+
/** initializes a node.
|
44
|
+
The node will be created as "autorelease".
|
45
|
+
*/
|
46
|
+
-(id) init;
|
47
|
+
@end
|