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,284 @@
|
|
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 "Support/uthash.h"
|
29
|
+
#import "ccTypes.h"
|
30
|
+
|
31
|
+
// Priority level reserved for system services.
|
32
|
+
#define kCCPrioritySystem INT_MIN
|
33
|
+
|
34
|
+
// Minimum priority level for user scheduling.
|
35
|
+
#define kCCPriorityNonSystemMin (kCCPrioritySystem+1)
|
36
|
+
|
37
|
+
typedef void (*TICK_IMP)(id, SEL, ccTime);
|
38
|
+
|
39
|
+
//
|
40
|
+
// CCTimer
|
41
|
+
//
|
42
|
+
/** Light weight timer */
|
43
|
+
@interface CCTimer : NSObject
|
44
|
+
{
|
45
|
+
ccTime _interval;
|
46
|
+
ccTime _elapsed;
|
47
|
+
BOOL _runForever;
|
48
|
+
BOOL _useDelay;
|
49
|
+
uint _nTimesExecuted;
|
50
|
+
uint _repeat; //0 = once, 1 is 2 x executed
|
51
|
+
ccTime _delay;
|
52
|
+
}
|
53
|
+
|
54
|
+
/** interval in seconds */
|
55
|
+
@property (nonatomic,readwrite,assign) ccTime interval;
|
56
|
+
|
57
|
+
|
58
|
+
/** triggers the timer */
|
59
|
+
-(void) update: (ccTime) dt;
|
60
|
+
@end
|
61
|
+
|
62
|
+
@interface CCTimerTargetSelector : CCTimer
|
63
|
+
{
|
64
|
+
id _target;
|
65
|
+
SEL _selector;
|
66
|
+
TICK_IMP _impMethod;
|
67
|
+
}
|
68
|
+
|
69
|
+
/** selector */
|
70
|
+
@property (nonatomic,readonly) SEL selector;
|
71
|
+
|
72
|
+
/** Allocates a timer with a target and a selector. */
|
73
|
+
+(id) timerWithTarget:(id) t selector:(SEL)s;
|
74
|
+
|
75
|
+
/** Allocates a timer with a target, a selector and an interval in seconds. */
|
76
|
+
+(id) timerWithTarget:(id) t selector:(SEL)s interval:(ccTime)seconds;
|
77
|
+
|
78
|
+
/** Initializes a timer with a target and a selector. */
|
79
|
+
-(id) initWithTarget:(id) t selector:(SEL)s;
|
80
|
+
|
81
|
+
/** Initializes a timer with a target, a selector, an interval in seconds, repeat in number of times to repeat, delay in seconds */
|
82
|
+
-(id) initWithTarget:(id)t selector:(SEL)s interval:(ccTime) seconds repeat:(uint) r delay:(ccTime) d;
|
83
|
+
@end
|
84
|
+
|
85
|
+
|
86
|
+
@interface CCTimerBlock : CCTimer
|
87
|
+
{
|
88
|
+
void (^_block)(ccTime delta);
|
89
|
+
NSString *_key;
|
90
|
+
id _target;
|
91
|
+
}
|
92
|
+
|
93
|
+
/** unique identifier of the block */
|
94
|
+
@property (nonatomic, readonly) NSString *key;
|
95
|
+
|
96
|
+
/** owner of the timer */
|
97
|
+
@property (nonatomic, readonly, assign) id target;
|
98
|
+
|
99
|
+
/** Allocates a timer with a target, interval in seconds, a key and a block */
|
100
|
+
+(id) timerWithTarget:(id)owner interval:(ccTime)seconds key:(NSString*)key block:(void(^)(ccTime delta)) block;
|
101
|
+
|
102
|
+
/** Initializes a timer with a target(owner), interval in seconds, repeat in number of times to repeat, delay in seconds and a block */
|
103
|
+
-(id) initWithTarget:(id)owner interval:(ccTime) seconds repeat:(uint) r delay:(ccTime)d key:(NSString*)key block:(void(^)(ccTime delta))block;
|
104
|
+
@end
|
105
|
+
|
106
|
+
|
107
|
+
//
|
108
|
+
// CCScheduler
|
109
|
+
//
|
110
|
+
/** CCScheduler is responsible of triggering the scheduled callbacks.
|
111
|
+
You should not use NSTimer. Instead use this class.
|
112
|
+
|
113
|
+
There are 2 different types of callbacks (selectors):
|
114
|
+
|
115
|
+
- update selector: the 'update' selector will be called every frame. You can customize the priority.
|
116
|
+
- custom selector: A custom selector will be called every frame, or with a custom interval of time
|
117
|
+
|
118
|
+
The 'custom selectors' should be avoided when possible. It is faster, and consumes less memory to use the 'update selector'.
|
119
|
+
|
120
|
+
*/
|
121
|
+
|
122
|
+
struct _listEntry;
|
123
|
+
struct _hashSelectorEntry;
|
124
|
+
struct _hashUpdateEntry;
|
125
|
+
|
126
|
+
@interface CCScheduler : NSObject
|
127
|
+
{
|
128
|
+
ccTime _timeScale;
|
129
|
+
|
130
|
+
//
|
131
|
+
// "updates with priority" stuff
|
132
|
+
//
|
133
|
+
struct _listEntry *updatesNeg; // list of priority < 0
|
134
|
+
struct _listEntry *updates0; // list priority == 0
|
135
|
+
struct _listEntry *updatesPos; // list priority > 0
|
136
|
+
struct _hashUpdateEntry *hashForUpdates; // hash used to fetch quickly the list entries for pause,delete,etc.
|
137
|
+
|
138
|
+
// Used for "selectors with interval"
|
139
|
+
struct _hashSelectorEntry *hashForTimers;
|
140
|
+
struct _hashSelectorEntry *currentTarget;
|
141
|
+
BOOL currentTargetSalvaged;
|
142
|
+
|
143
|
+
// Optimization
|
144
|
+
TICK_IMP impMethod;
|
145
|
+
SEL updateSelector;
|
146
|
+
|
147
|
+
BOOL updateHashLocked; // If true unschedule will not remove anything from a hash. Elements will only be marked for deletion.
|
148
|
+
|
149
|
+
BOOL _paused;
|
150
|
+
}
|
151
|
+
|
152
|
+
/** Modifies the time of all scheduled callbacks.
|
153
|
+
You can use this property to create a 'slow motion' or 'fast forward' effect.
|
154
|
+
Default is 1.0. To create a 'slow motion' effect, use values below 1.0.
|
155
|
+
To create a 'fast forward' effect, use values higher than 1.0.
|
156
|
+
@since v0.8
|
157
|
+
@warning It will affect EVERY scheduled selector / action.
|
158
|
+
*/
|
159
|
+
@property (nonatomic,readwrite) ccTime timeScale;
|
160
|
+
|
161
|
+
|
162
|
+
/** Will pause / resume the CCScheduler.
|
163
|
+
It won't dispatch any message to any target/selector, block if it is paused.
|
164
|
+
|
165
|
+
The difference between `pauseAllTargets` and `pause, is that `setPaused` will pause the CCScheduler,
|
166
|
+
while `pauseAllTargets` will pause all the targets, one by one.
|
167
|
+
`setPaused` will pause the whole Scheduler, meaning that calls to `resumeTargets:`, `resumeTarget:` won't affect it.
|
168
|
+
|
169
|
+
@since v2.1.0
|
170
|
+
*/
|
171
|
+
@property (nonatomic,readonly,getter=isPaused) BOOL paused;
|
172
|
+
|
173
|
+
/** 'update' the scheduler.
|
174
|
+
You should NEVER call this method, unless you know what you are doing.
|
175
|
+
*/
|
176
|
+
-(void) update:(ccTime)dt;
|
177
|
+
|
178
|
+
/** The scheduled method will be called every 'interval' seconds.
|
179
|
+
If paused is YES, then it won't be called until it is resumed.
|
180
|
+
If 'interval' is 0, it will be called every frame, but if so, it recommended to use 'scheduleUpdateForTarget:' instead.
|
181
|
+
If the selector is already scheduled, then only the interval parameter will be updated without re-scheduling it again.
|
182
|
+
repeat lets the action be repeated repeat + 1 times, use kCCRepeatForever to let the action run continuously
|
183
|
+
delay is the amount of time the action will wait before it'll start
|
184
|
+
|
185
|
+
@since v0.99.3, repeat and delay added in v1.1
|
186
|
+
*/
|
187
|
+
-(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval repeat:(uint)repeat delay:(ccTime)delay paused:(BOOL)paused;
|
188
|
+
|
189
|
+
/** calls scheduleSelector with kCCRepeatForever and a 0 delay */
|
190
|
+
-(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval paused:(BOOL)paused;
|
191
|
+
|
192
|
+
/** Schedules the 'update' selector for a given target with a given priority.
|
193
|
+
The 'update' selector will be called every frame.
|
194
|
+
The lower the priority, the earlier it is called.
|
195
|
+
@since v0.99.3
|
196
|
+
*/
|
197
|
+
-(void) scheduleUpdateForTarget:(id)target priority:(NSInteger)priority paused:(BOOL)paused;
|
198
|
+
|
199
|
+
/** The scheduled block will be called every 'interval' seconds.
|
200
|
+
'key' is a unique identifier of the block. Needed to unschedule the block or update its interval.
|
201
|
+
'target' is needed for all the method related to "target" like "pause" and "unschedule"
|
202
|
+
If 'interval' is 0, it will be called every frame, but if so, it recommended to use 'scheduleUpdateForTarget:' instead.
|
203
|
+
'repeat' lets the action be repeated repeat + 1 times, use kCCRepeatForever to let the action run continuously.
|
204
|
+
'delay' is the amount of time the action will wait before it'll start.
|
205
|
+
If paused is YES, then it won't be called until it is resumed.
|
206
|
+
If the block is already scheduled, then only the interval parameter will be updated without re-scheduling it again.
|
207
|
+
@since v2.1
|
208
|
+
*/
|
209
|
+
-(void) scheduleBlockForKey:(NSString*)key target:(id)target interval:(ccTime)interval repeat:(uint)repeat delay:(ccTime)delay paused:(BOOL)paused block:(void(^)(ccTime dt))block;
|
210
|
+
|
211
|
+
/** Unshedules a selector for a given target.
|
212
|
+
If you want to unschedule the "update", use unscheudleUpdateForTarget.
|
213
|
+
@since v0.99.3
|
214
|
+
*/
|
215
|
+
-(void) unscheduleSelector:(SEL)selector forTarget:(id)target;
|
216
|
+
|
217
|
+
/** Unshedules a block for a given key / target pair.
|
218
|
+
If you want to unschedule the "update", use unscheudleUpdateForTarget.
|
219
|
+
@since v2.1
|
220
|
+
*/
|
221
|
+
-(void) unscheduleBlockForKey:(NSString*)key target:(id)target;
|
222
|
+
|
223
|
+
/** Unschedules the update selector for a given target
|
224
|
+
@since v0.99.3
|
225
|
+
*/
|
226
|
+
-(void) unscheduleUpdateForTarget:(id)target;
|
227
|
+
|
228
|
+
/** Unschedules all selectors and blocks for a given target.
|
229
|
+
This also includes the "update" selector.
|
230
|
+
@since v0.99.3
|
231
|
+
*/
|
232
|
+
-(void) unscheduleAllForTarget:(id)target;
|
233
|
+
|
234
|
+
/** Unschedules all selectors and blocks from all targets.
|
235
|
+
You should NEVER call this method, unless you know what you are doing.
|
236
|
+
|
237
|
+
@since v0.99.3
|
238
|
+
*/
|
239
|
+
-(void) unscheduleAll;
|
240
|
+
|
241
|
+
/** Unschedules all selectors and blocks from all targets with a minimum priority.
|
242
|
+
You should only call this with kCCPriorityNonSystemMin or higher.
|
243
|
+
@since v2.0.0
|
244
|
+
*/
|
245
|
+
-(void) unscheduleAllWithMinPriority:(NSInteger)minPriority;
|
246
|
+
|
247
|
+
/** Pauses the target.
|
248
|
+
All scheduled selectors/update for a given target won't be 'ticked' until the target is resumed.
|
249
|
+
If the target is not present, nothing happens.
|
250
|
+
@since v0.99.3
|
251
|
+
*/
|
252
|
+
-(void) pauseTarget:(id)target;
|
253
|
+
|
254
|
+
/** Resumes the target.
|
255
|
+
The 'target' will be unpaused, so all schedule selectors/update will be 'ticked' again.
|
256
|
+
If the target is not present, nothing happens.
|
257
|
+
@since v0.99.3
|
258
|
+
*/
|
259
|
+
-(void) resumeTarget:(id)target;
|
260
|
+
|
261
|
+
/** Returns whether or not the target is paused
|
262
|
+
@since v1.0.0
|
263
|
+
*/
|
264
|
+
-(BOOL) isTargetPaused:(id)target;
|
265
|
+
|
266
|
+
/** Pause all selectors and blocks from all targets.
|
267
|
+
You should NEVER call this method, unless you know what you are doing.
|
268
|
+
@since v2.0.0
|
269
|
+
*/
|
270
|
+
-(NSSet*) pauseAllTargets;
|
271
|
+
|
272
|
+
/** Pause all selectors and blocks from all targets with a minimum priority.
|
273
|
+
You should only call this with kCCPriorityNonSystemMin or higher.
|
274
|
+
@since v2.0.0
|
275
|
+
*/
|
276
|
+
-(NSSet*) pauseAllTargetsWithMinPriority:(NSInteger)minPriority;
|
277
|
+
|
278
|
+
/** Resume selectors on a set of targets.
|
279
|
+
This can be useful for undoing a call to pauseAllSelectors.
|
280
|
+
@since v2.0.0
|
281
|
+
*/
|
282
|
+
-(void) resumeTargets:(NSSet *)targetsToResume;
|
283
|
+
|
284
|
+
@end
|
@@ -0,0 +1,60 @@
|
|
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 <Foundation/Foundation.h>
|
27
|
+
#import "ccMacros.h"
|
28
|
+
#ifdef __CC_PLATFORM_IOS
|
29
|
+
#import <OpenGLES/ES2/gl.h>
|
30
|
+
#endif // __CC_PLATFORM_IOS
|
31
|
+
|
32
|
+
@class CCGLProgram;
|
33
|
+
|
34
|
+
/** CCShaderCache
|
35
|
+
Singleton that stores manages GL shaders
|
36
|
+
@since v2.0
|
37
|
+
*/
|
38
|
+
@interface CCShaderCache : NSObject {
|
39
|
+
|
40
|
+
NSMutableDictionary *_programs;
|
41
|
+
|
42
|
+
}
|
43
|
+
|
44
|
+
/** returns the shared instance */
|
45
|
+
+ (CCShaderCache *)sharedShaderCache;
|
46
|
+
|
47
|
+
/** purges the cache. It releases the retained instance. */
|
48
|
+
+(void)purgeSharedShaderCache;
|
49
|
+
|
50
|
+
/** loads the default shaders */
|
51
|
+
-(void) loadDefaultShaders;
|
52
|
+
|
53
|
+
/** returns a GL program for a given key */
|
54
|
+
-(CCGLProgram *) programForKey:(NSString*)key;
|
55
|
+
|
56
|
+
/** adds a CCGLProgram to the cache for a given name */
|
57
|
+
- (void) addProgram:(CCGLProgram*)program forKey:(NSString*)key;
|
58
|
+
|
59
|
+
@end
|
60
|
+
|
@@ -0,0 +1,281 @@
|
|
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
|
+
#import "CCProtocols.h"
|
30
|
+
#import "CCTextureAtlas.h"
|
31
|
+
|
32
|
+
@class CCSpriteBatchNode;
|
33
|
+
@class CCSpriteFrame;
|
34
|
+
@class CCAnimation;
|
35
|
+
|
36
|
+
#pragma mark CCSprite
|
37
|
+
|
38
|
+
#define CCSpriteIndexNotInitialized 0xffffffff /// CCSprite invalid index on the CCSpriteBatchode
|
39
|
+
|
40
|
+
|
41
|
+
/** CCSprite is a 2d image ( http://en.wikipedia.org/wiki/Sprite_(computer_graphics) )
|
42
|
+
*
|
43
|
+
* CCSprite can be created with an image, or with a sub-rectangle of an image.
|
44
|
+
*
|
45
|
+
* If the parent or any of its ancestors is a CCSpriteBatchNode then the following features/limitations are valid
|
46
|
+
* - Features when the parent is a CCBatchNode:
|
47
|
+
* - MUCH faster rendering, specially if the CCSpriteBatchNode has many children. All the children will be drawn in a single batch.
|
48
|
+
*
|
49
|
+
* - Limitations
|
50
|
+
* - Camera is not supported yet (eg: CCOrbitCamera action doesn't work)
|
51
|
+
* - GridBase actions are not supported (eg: CCLens, CCRipple, CCTwirl)
|
52
|
+
* - The Alias/Antialias property belongs to CCSpriteBatchNode, so you can't individually set the aliased property.
|
53
|
+
* - The Blending function property belongs to CCSpriteBatchNode, so you can't individually set the blending function property.
|
54
|
+
* - Parallax scroller is not supported, but can be simulated with a "proxy" sprite.
|
55
|
+
*
|
56
|
+
* If the parent is an standard CCNode, then CCSprite behaves like any other CCNode:
|
57
|
+
* - It supports blending functions
|
58
|
+
* - It supports aliasing / antialiasing
|
59
|
+
* - But the rendering will be slower: 1 draw per children.
|
60
|
+
*
|
61
|
+
* The default anchorPoint in CCSprite is (0.5, 0.5).
|
62
|
+
*/
|
63
|
+
@interface CCSprite : CCNodeRGBA <CCTextureProtocol>
|
64
|
+
{
|
65
|
+
|
66
|
+
//
|
67
|
+
// Data used when the sprite is rendered using a CCSpriteBatchNode
|
68
|
+
//
|
69
|
+
CCTextureAtlas *_textureAtlas; // Sprite Sheet texture atlas (weak reference)
|
70
|
+
NSUInteger _atlasIndex; // Absolute (real) Index on the batch node
|
71
|
+
CCSpriteBatchNode *_batchNode; // Used batch node (weak reference)
|
72
|
+
CGAffineTransform _transformToBatch; //
|
73
|
+
BOOL _dirty; // Sprite needs to be updated
|
74
|
+
BOOL _recursiveDirty; // Subchildren needs to be updated
|
75
|
+
BOOL _hasChildren; // optimization to check if it contain children
|
76
|
+
BOOL _shouldBeHidden; // should not be drawn because one of the ancestors is not visible
|
77
|
+
|
78
|
+
//
|
79
|
+
// Data used when the sprite is self-rendered
|
80
|
+
//
|
81
|
+
ccBlendFunc _blendFunc; // Needed for the texture protocol
|
82
|
+
CCTexture2D *_texture; // Texture used to render the sprite
|
83
|
+
|
84
|
+
//
|
85
|
+
// Shared data
|
86
|
+
//
|
87
|
+
|
88
|
+
// sprite rectangle
|
89
|
+
CGRect _rect;
|
90
|
+
|
91
|
+
// texture
|
92
|
+
BOOL _rectRotated;
|
93
|
+
|
94
|
+
// Offset Position (used by Zwoptex)
|
95
|
+
CGPoint _offsetPosition;
|
96
|
+
CGPoint _unflippedOffsetPositionFromCenter;
|
97
|
+
|
98
|
+
// vertex coords, texture coords and color info
|
99
|
+
ccV3F_C4B_T2F_Quad _quad;
|
100
|
+
|
101
|
+
// opacity and RGB protocol
|
102
|
+
BOOL _opacityModifyRGB;
|
103
|
+
|
104
|
+
// image is flipped
|
105
|
+
BOOL _flipX;
|
106
|
+
BOOL _flipY;
|
107
|
+
}
|
108
|
+
|
109
|
+
/** whether or not the Sprite needs to be updated in the Atlas */
|
110
|
+
@property (nonatomic,readwrite) BOOL dirty;
|
111
|
+
/** the quad (tex coords, vertex coords and color) information */
|
112
|
+
@property (nonatomic,readonly) ccV3F_C4B_T2F_Quad quad;
|
113
|
+
/** The index used on the TextureAtlas. Don't modify this value unless you know what you are doing */
|
114
|
+
@property (nonatomic,readwrite) NSUInteger atlasIndex;
|
115
|
+
/** returns the texture rect of the CCSprite in points */
|
116
|
+
@property (nonatomic,readonly) CGRect textureRect;
|
117
|
+
/** returns whether or not the texture rectangle is rotated */
|
118
|
+
@property (nonatomic,readonly) BOOL textureRectRotated;
|
119
|
+
/** whether or not the sprite is flipped horizontally.
|
120
|
+
It only flips the texture of the sprite, and not the texture of the sprite's children.
|
121
|
+
Also, flipping the texture doesn't alter the anchorPoint.
|
122
|
+
If you want to flip the anchorPoint too, and/or to flip the children too use:
|
123
|
+
|
124
|
+
sprite.scaleX *= -1;
|
125
|
+
*/
|
126
|
+
@property (nonatomic,readwrite) BOOL flipX;
|
127
|
+
/** whether or not the sprite is flipped vertically.
|
128
|
+
It only flips the texture of the sprite, and not the texture of the sprite's children.
|
129
|
+
Also, flipping the texture doesn't alter the anchorPoint.
|
130
|
+
If you want to flip the anchorPoint too, and/or to flip the children too use:
|
131
|
+
|
132
|
+
sprite.scaleY *= -1;
|
133
|
+
*/
|
134
|
+
@property (nonatomic,readwrite) BOOL flipY;
|
135
|
+
/** weak reference of the CCTextureAtlas used when the sprite is rendered using a CCSpriteBatchNode */
|
136
|
+
@property (nonatomic,readwrite,assign) CCTextureAtlas *textureAtlas;
|
137
|
+
/** weak reference to the CCSpriteBatchNode that renders the CCSprite */
|
138
|
+
@property (nonatomic,readwrite,assign) CCSpriteBatchNode *batchNode;
|
139
|
+
/** offset position in points of the sprite in points. Calculated automatically by editors like Zwoptex.
|
140
|
+
@since v0.99.0
|
141
|
+
*/
|
142
|
+
@property (nonatomic,readonly) CGPoint offsetPosition;
|
143
|
+
/** conforms to CCTextureProtocol protocol */
|
144
|
+
@property (nonatomic,readwrite) ccBlendFunc blendFunc;
|
145
|
+
|
146
|
+
#pragma mark CCSprite - Initializers
|
147
|
+
|
148
|
+
/** Creates an sprite with a texture.
|
149
|
+
The rect used will be the size of the texture.
|
150
|
+
The offset will be (0,0).
|
151
|
+
*/
|
152
|
+
+(id) spriteWithTexture:(CCTexture2D*)texture;
|
153
|
+
|
154
|
+
/** Creates an sprite with a texture and a rect.
|
155
|
+
The offset will be (0,0).
|
156
|
+
*/
|
157
|
+
+(id) spriteWithTexture:(CCTexture2D*)texture rect:(CGRect)rect;
|
158
|
+
|
159
|
+
/** Creates an sprite with an sprite frame.
|
160
|
+
*/
|
161
|
+
+(id) spriteWithSpriteFrame:(CCSpriteFrame*)spriteFrame;
|
162
|
+
|
163
|
+
/** Creates an sprite with an sprite frame name.
|
164
|
+
An CCSpriteFrame will be fetched from the CCSpriteFrameCache by name.
|
165
|
+
If the CCSpriteFrame doesn't exist it will raise an exception.
|
166
|
+
@since v0.9
|
167
|
+
*/
|
168
|
+
+(id) spriteWithSpriteFrameName:(NSString*)spriteFrameName;
|
169
|
+
|
170
|
+
/** Creates an sprite with an image filename.
|
171
|
+
The rect used will be the size of the image.
|
172
|
+
The offset will be (0,0).
|
173
|
+
*/
|
174
|
+
+(id) spriteWithFile:(NSString*)filename;
|
175
|
+
|
176
|
+
/** Creates an sprite with an image filename and a rect.
|
177
|
+
The offset will be (0,0).
|
178
|
+
*/
|
179
|
+
+(id) spriteWithFile:(NSString*)filename rect:(CGRect)rect;
|
180
|
+
|
181
|
+
/** Creates an sprite with a CGImageRef and a key.
|
182
|
+
The key is used by the CCTextureCache to know if a texture was already created with this CGImage.
|
183
|
+
For example, a valid key is: @"_spriteframe_01".
|
184
|
+
If key is nil, then a new texture will be created each time by the CCTextureCache.
|
185
|
+
@since v0.99.0
|
186
|
+
*/
|
187
|
+
+(id) spriteWithCGImage: (CGImageRef)image key:(NSString*)key;
|
188
|
+
|
189
|
+
/** Initializes an sprite with a texture.
|
190
|
+
The rect used will be the size of the texture.
|
191
|
+
The offset will be (0,0).
|
192
|
+
*/
|
193
|
+
-(id) initWithTexture:(CCTexture2D*)texture;
|
194
|
+
|
195
|
+
/** Initializes an sprite with a texture and a rect in points (unrotated)
|
196
|
+
The offset will be (0,0).
|
197
|
+
*/
|
198
|
+
-(id) initWithTexture:(CCTexture2D*)texture rect:(CGRect)rect;
|
199
|
+
|
200
|
+
/** Initializes an sprite with a texture and a rect in points, optionally rotated.
|
201
|
+
The offset will be (0,0).
|
202
|
+
IMPORTANT: This is the designated initializer.
|
203
|
+
*/
|
204
|
+
- (id)initWithTexture:(CCTexture2D *)texture rect:(CGRect)rect rotated:(BOOL)rotated;
|
205
|
+
|
206
|
+
|
207
|
+
/** Initializes an sprite with an sprite frame.
|
208
|
+
*/
|
209
|
+
-(id) initWithSpriteFrame:(CCSpriteFrame*)spriteFrame;
|
210
|
+
|
211
|
+
/** Initializes an sprite with an sprite frame name.
|
212
|
+
An CCSpriteFrame will be fetched from the CCSpriteFrameCache by name.
|
213
|
+
If the CCSpriteFrame doesn't exist it will raise an exception.
|
214
|
+
@since v0.9
|
215
|
+
*/
|
216
|
+
-(id) initWithSpriteFrameName:(NSString*)spriteFrameName;
|
217
|
+
|
218
|
+
/** Initializes an sprite with an image filename.
|
219
|
+
The rect used will be the size of the image.
|
220
|
+
The offset will be (0,0).
|
221
|
+
*/
|
222
|
+
-(id) initWithFile:(NSString*)filename;
|
223
|
+
|
224
|
+
/** Initializes an sprite with an image filename, and a rect.
|
225
|
+
The offset will be (0,0).
|
226
|
+
*/
|
227
|
+
-(id) initWithFile:(NSString*)filename rect:(CGRect)rect;
|
228
|
+
|
229
|
+
/** Initializes an sprite with a CGImageRef and a key
|
230
|
+
The key is used by the CCTextureCache to know if a texture was already created with this CGImage.
|
231
|
+
For example, a valid key is: @"_spriteframe_01".
|
232
|
+
If key is nil, then a new texture will be created each time by the CCTextureCache.
|
233
|
+
@since v0.99.0
|
234
|
+
*/
|
235
|
+
-(id) initWithCGImage:(CGImageRef)image key:(NSString*)key;
|
236
|
+
|
237
|
+
#pragma mark CCSprite - BatchNode methods
|
238
|
+
|
239
|
+
/** updates the quad according the the rotation, position, scale values.
|
240
|
+
*/
|
241
|
+
-(void)updateTransform;
|
242
|
+
|
243
|
+
#pragma mark CCSprite - Texture methods
|
244
|
+
|
245
|
+
/** set the texture rect of the CCSprite in points.
|
246
|
+
It will call setTextureRect:rotated:untrimmedSize with rotated = NO, and utrimmedSize = rect.size.
|
247
|
+
*/
|
248
|
+
-(void) setTextureRect:(CGRect) rect;
|
249
|
+
|
250
|
+
/** set the texture rect, rectRotated and untrimmed size of the CCSprite in points.
|
251
|
+
It will update the texture coordinates and the vertex rectangle.
|
252
|
+
*/
|
253
|
+
-(void) setTextureRect:(CGRect)rect rotated:(BOOL)rotated untrimmedSize:(CGSize)size;
|
254
|
+
|
255
|
+
/** set the vertex rect.
|
256
|
+
It will be called internally by setTextureRect. Useful if you want to create 2x images from SD images in Retina Display.
|
257
|
+
Do not call it manually. Use setTextureRect instead.
|
258
|
+
*/
|
259
|
+
-(void)setVertexRect:(CGRect)rect;
|
260
|
+
|
261
|
+
|
262
|
+
#pragma mark CCSprite - Frames
|
263
|
+
|
264
|
+
/** sets a new display frame to the CCSprite. */
|
265
|
+
-(void) setDisplayFrame:(CCSpriteFrame*)newFrame;
|
266
|
+
|
267
|
+
/** returns whether or not a CCSpriteFrame is being displayed */
|
268
|
+
-(BOOL) isFrameDisplayed:(CCSpriteFrame*)frame;
|
269
|
+
|
270
|
+
/** returns the current displayed frame. */
|
271
|
+
-(CCSpriteFrame*) displayFrame;
|
272
|
+
|
273
|
+
#pragma mark CCSprite - Animation
|
274
|
+
|
275
|
+
/** changes the display frame with animation name and index.
|
276
|
+
The animation name will be get from the CCAnimationCache
|
277
|
+
@since v0.99.5
|
278
|
+
*/
|
279
|
+
-(void) setDisplayFrameWithAnimationName:(NSString*)animationName index:(int) frameIndex;
|
280
|
+
|
281
|
+
@end
|