joybox 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,96 @@
|
|
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 "CCMenuItem.h"
|
29
|
+
#import "CCLayer.h"
|
30
|
+
|
31
|
+
typedef enum {
|
32
|
+
kCCMenuStateWaiting,
|
33
|
+
kCCMenuStateTrackingTouch
|
34
|
+
} tCCMenuState;
|
35
|
+
|
36
|
+
enum {
|
37
|
+
//* priority used by the menu for the event handler
|
38
|
+
kCCMenuHandlerPriority = -128,
|
39
|
+
};
|
40
|
+
|
41
|
+
/** A CCMenu
|
42
|
+
*
|
43
|
+
* Features and Limitation:
|
44
|
+
* - You can add MenuItem objects in runtime using addChild:
|
45
|
+
* - But the only accecpted children are MenuItem objects
|
46
|
+
*/
|
47
|
+
@interface CCMenu : CCLayerRGBA
|
48
|
+
{
|
49
|
+
tCCMenuState _state;
|
50
|
+
CCMenuItem *_selectedItem;
|
51
|
+
BOOL _enabled;
|
52
|
+
}
|
53
|
+
|
54
|
+
/** whether or not the menu will receive events */
|
55
|
+
@property (nonatomic, readwrite) BOOL enabled;
|
56
|
+
|
57
|
+
/** creates a CCMenu with CCMenuItem objects */
|
58
|
+
+ (id) menuWithItems: (CCMenuItem*) item, ... NS_REQUIRES_NIL_TERMINATION;
|
59
|
+
|
60
|
+
/** creates a CCMenu with CCMenuItem objects */
|
61
|
+
+ (id) menuWithItems: (CCMenuItem*) firstItem vaList: (va_list) args;
|
62
|
+
|
63
|
+
/** creates a CCMenu with a NSArray of CCMenuItem objects */
|
64
|
+
+ (id) menuWithArray:(NSArray*)arrayOfItems;
|
65
|
+
|
66
|
+
/** initializes a CCMenu with a NSArray of CCMenuItem objects */
|
67
|
+
- (id) initWithArray:(NSArray*)arrayOfItems;
|
68
|
+
|
69
|
+
/** align items vertically */
|
70
|
+
-(void) alignItemsVertically;
|
71
|
+
/** align items vertically with padding
|
72
|
+
@since v0.7.2
|
73
|
+
*/
|
74
|
+
-(void) alignItemsVerticallyWithPadding:(float) padding;
|
75
|
+
|
76
|
+
/** align items horizontally */
|
77
|
+
-(void) alignItemsHorizontally;
|
78
|
+
/** align items horizontally with padding
|
79
|
+
@since v0.7.2
|
80
|
+
*/
|
81
|
+
-(void) alignItemsHorizontallyWithPadding: (float) padding;
|
82
|
+
|
83
|
+
/** align items in rows of columns */
|
84
|
+
-(void) alignItemsInColumns: (NSNumber *) columns, ... NS_REQUIRES_NIL_TERMINATION;
|
85
|
+
-(void) alignItemsInColumns: (NSNumber *) columns vaList: (va_list) args;
|
86
|
+
-(void) alignItemsInColumnsWithArray:(NSArray*) arrayOfNumbers;
|
87
|
+
|
88
|
+
/** align items in columns of rows */
|
89
|
+
-(void) alignItemsInRows: (NSNumber *) rows, ... NS_REQUIRES_NIL_TERMINATION;
|
90
|
+
-(void) alignItemsInRows: (NSNumber *) rows vaList: (va_list) args;
|
91
|
+
-(void) alignItemsInRowsWithArray: (NSArray*) arrayOfNumbers;
|
92
|
+
|
93
|
+
/** set event handler priority. By default it is: kCCMenuTouchPriority */
|
94
|
+
-(void) setHandlerPriority:(NSInteger)newPriority;
|
95
|
+
|
96
|
+
@end
|
@@ -0,0 +1,428 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008-2011 Ricardo Quesada
|
5
|
+
* Copyright (c) 2011 Zynga Inc.
|
6
|
+
*
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
12
|
+
* furnished to do so, subject to the following conditions:
|
13
|
+
*
|
14
|
+
* The above copyright notice and this permission notice shall be included in
|
15
|
+
* all copies or substantial portions of the Software.
|
16
|
+
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
|
+
* THE SOFTWARE.
|
24
|
+
*
|
25
|
+
*/
|
26
|
+
|
27
|
+
#import "CCNode.h"
|
28
|
+
#import "CCProtocols.h"
|
29
|
+
|
30
|
+
@class CCSprite;
|
31
|
+
@class CCSpriteFrame;
|
32
|
+
|
33
|
+
#define kCCItemSize 32
|
34
|
+
|
35
|
+
#pragma mark -
|
36
|
+
#pragma mark CCMenuItem
|
37
|
+
/** CCMenuItem base class
|
38
|
+
*
|
39
|
+
* Subclass CCMenuItem (or any subclass) to create your custom CCMenuItem objects.
|
40
|
+
*/
|
41
|
+
@interface CCMenuItem : CCNodeRGBA
|
42
|
+
{
|
43
|
+
// used for menu items using a block
|
44
|
+
void (^_block)(id sender);
|
45
|
+
|
46
|
+
BOOL _isEnabled;
|
47
|
+
BOOL _isSelected;
|
48
|
+
|
49
|
+
BOOL _releaseBlockAtCleanup;
|
50
|
+
}
|
51
|
+
|
52
|
+
/** returns whether or not the item is selected
|
53
|
+
@since v0.8.2
|
54
|
+
*/
|
55
|
+
@property (nonatomic,readonly) BOOL isSelected;
|
56
|
+
|
57
|
+
/** If enabled, it releases the block at cleanup time.
|
58
|
+
@since v2.1
|
59
|
+
*/
|
60
|
+
@property (nonatomic) BOOL releaseBlockAtCleanup;
|
61
|
+
|
62
|
+
/** the active area (relative to the current position) */
|
63
|
+
@property (nonatomic,assign) CGRect activeArea;
|
64
|
+
|
65
|
+
/** Creates a CCMenuItem with a target/selector.
|
66
|
+
target/selector will be implemented using blocks.
|
67
|
+
"target" won't be retained.
|
68
|
+
*/
|
69
|
+
+(id) itemWithTarget:(id)target selector:(SEL)selector;
|
70
|
+
|
71
|
+
/** Creates a CCMenuItem with the specified block.
|
72
|
+
The block will be "copied".
|
73
|
+
*/
|
74
|
+
+(id) itemWithBlock:(void(^)(id sender))block;
|
75
|
+
|
76
|
+
/** Initializes a CCMenuItem with a target/selector */
|
77
|
+
-(id) initWithTarget:(id)target selector:(SEL)selector;
|
78
|
+
|
79
|
+
/** Initializes a CCMenuItem with the specified block.
|
80
|
+
The block will be "copied".
|
81
|
+
*/
|
82
|
+
-(id) initWithBlock:(void(^)(id sender))block;
|
83
|
+
|
84
|
+
/** Activate the item */
|
85
|
+
-(void) activate;
|
86
|
+
|
87
|
+
/** The item was selected (not activated), similar to "mouse-over" */
|
88
|
+
-(void) selected;
|
89
|
+
|
90
|
+
/** The item was unselected */
|
91
|
+
-(void) unselected;
|
92
|
+
|
93
|
+
/** Enable or disabled the CCMenuItem */
|
94
|
+
-(void) setIsEnabled:(BOOL)enabled;
|
95
|
+
|
96
|
+
/** Returns whether or not the CCMenuItem is enabled */
|
97
|
+
-(BOOL) isEnabled;
|
98
|
+
|
99
|
+
/** Sets the block that is called when the item is tapped.
|
100
|
+
The block will be "copied".
|
101
|
+
*/
|
102
|
+
-(void) setBlock:(void(^)(id sender))block;
|
103
|
+
|
104
|
+
/** Sets the target and selector that is called when the item is tapped.
|
105
|
+
target/selector will be implemented using blocks.
|
106
|
+
"target" won't be retained.
|
107
|
+
*/
|
108
|
+
-(void) setTarget:(id)target selector:(SEL)selector;
|
109
|
+
|
110
|
+
/** cleanup event. It will release the block and call [super cleanup] */
|
111
|
+
-(void) cleanup;
|
112
|
+
|
113
|
+
@end
|
114
|
+
|
115
|
+
#pragma mark -
|
116
|
+
#pragma mark CCMenuItemLabel
|
117
|
+
|
118
|
+
/** An abstract class for "label" CCMenuItemLabel items
|
119
|
+
Any CCNode that supports the CCLabelProtocol protocol can be added.
|
120
|
+
Supported nodes:
|
121
|
+
- CCLabelBMFont
|
122
|
+
- CCLabelAtlas
|
123
|
+
- CCLabelTTF
|
124
|
+
*/
|
125
|
+
@interface CCMenuItemLabel : CCMenuItem
|
126
|
+
{
|
127
|
+
CCNode<CCLabelProtocol, CCRGBAProtocol> *_label;
|
128
|
+
ccColor3B _colorBackup;
|
129
|
+
ccColor3B _disabledColor;
|
130
|
+
float _originalScale;
|
131
|
+
}
|
132
|
+
|
133
|
+
/** the color that will be used to disable the item */
|
134
|
+
@property (nonatomic,readwrite) ccColor3B disabledColor;
|
135
|
+
|
136
|
+
/** Label that is rendered. It can be any CCNode that implements the CCLabelProtocol */
|
137
|
+
@property (nonatomic,readwrite,assign) CCNode<CCLabelProtocol, CCRGBAProtocol>* label;
|
138
|
+
|
139
|
+
/** creates a CCMenuItemLabel with a Label. */
|
140
|
+
+(id) itemWithLabel:(CCNode<CCLabelProtocol,CCRGBAProtocol>*)label;
|
141
|
+
|
142
|
+
/** creates a CCMenuItemLabel with a Label, target and selector.
|
143
|
+
The "target" won't be retained.
|
144
|
+
*/
|
145
|
+
+(id) itemWithLabel:(CCNode<CCLabelProtocol,CCRGBAProtocol>*)label target:(id)target selector:(SEL)selector;
|
146
|
+
|
147
|
+
/** creates a CCMenuItemLabel with a Label and a block to execute.
|
148
|
+
The block will be "copied".
|
149
|
+
*/
|
150
|
+
+(id) itemWithLabel:(CCNode<CCLabelProtocol,CCRGBAProtocol>*)label block:(void(^)(id sender))block;
|
151
|
+
|
152
|
+
/** initializes a CCMenuItemLabel with a Label, target and selector.
|
153
|
+
Internally it will create a block that executes the target/selector.
|
154
|
+
The "target" won't be retained.
|
155
|
+
*/
|
156
|
+
-(id) initWithLabel:(CCNode<CCLabelProtocol,CCRGBAProtocol>*)label target:(id)target selector:(SEL)selector;
|
157
|
+
|
158
|
+
/** initializes a CCMenuItemLabel with a Label and a block to execute.
|
159
|
+
The block will be "copied".
|
160
|
+
This is the designated initializer.
|
161
|
+
*/
|
162
|
+
-(id) initWithLabel:(CCNode<CCLabelProtocol,CCRGBAProtocol>*)label block:(void(^)(id sender))block;
|
163
|
+
|
164
|
+
/** sets a new string to the inner label */
|
165
|
+
-(void) setString:(NSString*)label;
|
166
|
+
|
167
|
+
/** Enable or disabled the CCMenuItemFont
|
168
|
+
@warning setIsEnabled changes the RGB color of the font
|
169
|
+
*/
|
170
|
+
-(void) setIsEnabled: (BOOL)enabled;
|
171
|
+
@end
|
172
|
+
|
173
|
+
#pragma mark -
|
174
|
+
#pragma mark CCMenuItemAtlasFont
|
175
|
+
|
176
|
+
/** A CCMenuItemAtlasFont
|
177
|
+
Helper class that creates a CCMenuItemLabel class with a CCLabelAtlas
|
178
|
+
*/
|
179
|
+
@interface CCMenuItemAtlasFont : CCMenuItemLabel
|
180
|
+
{
|
181
|
+
}
|
182
|
+
|
183
|
+
/** creates a menu item from a string and atlas with a target/selector */
|
184
|
+
+(id) itemWithString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap;
|
185
|
+
|
186
|
+
/** creates a menu item from a string and atlas. Use it with CCMenuItemToggle.
|
187
|
+
The "target" won't be retained.
|
188
|
+
*/
|
189
|
+
+(id) itemWithString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap target:(id)target selector:(SEL)selector;
|
190
|
+
|
191
|
+
/** initializes a menu item from a string and atlas with a target/selector.
|
192
|
+
The "target" won't be retained.
|
193
|
+
*/
|
194
|
+
-(id) initWithString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap target:(id)target selector:(SEL)selector;
|
195
|
+
|
196
|
+
/** creates a menu item from a string and atlas. Use it with CCMenuItemToggle.
|
197
|
+
The block will be "copied".
|
198
|
+
*/
|
199
|
+
+(id) itemWithString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap block:(void(^)(id sender))block;
|
200
|
+
|
201
|
+
/** initializes a menu item from a string and atlas with a block.
|
202
|
+
The block will be "copied".
|
203
|
+
*/
|
204
|
+
-(id) initWithString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap block:(void(^)(id sender))block;
|
205
|
+
|
206
|
+
@end
|
207
|
+
|
208
|
+
#pragma mark -
|
209
|
+
#pragma mark CCMenuItemFont
|
210
|
+
|
211
|
+
/** A CCMenuItemFont
|
212
|
+
Helper class that creates a CCMenuItemLabel class with a Label
|
213
|
+
*/
|
214
|
+
@interface CCMenuItemFont : CCMenuItemLabel
|
215
|
+
{
|
216
|
+
NSUInteger _fontSize;
|
217
|
+
NSString *_fontName;
|
218
|
+
}
|
219
|
+
/** set default font size */
|
220
|
+
+(void) setFontSize: (NSUInteger) s;
|
221
|
+
|
222
|
+
/** get default font size */
|
223
|
+
+(NSUInteger) fontSize;
|
224
|
+
|
225
|
+
/** set default font name */
|
226
|
+
+(void) setFontName: (NSString*) n;
|
227
|
+
|
228
|
+
/** get default font name */
|
229
|
+
+(NSString*) fontName;
|
230
|
+
|
231
|
+
/** creates a menu item from a string without target/selector. To be used with CCMenuItemToggle */
|
232
|
+
+(id) itemWithString: (NSString*) value;
|
233
|
+
|
234
|
+
/** creates a menu item from a string with a target/selector.
|
235
|
+
The "target" won't be retained.
|
236
|
+
*/
|
237
|
+
+(id) itemWithString: (NSString*) value target:(id) r selector:(SEL) s;
|
238
|
+
|
239
|
+
/** creates a menu item from a string with the specified block.
|
240
|
+
The block will be "copied".
|
241
|
+
*/
|
242
|
+
+(id) itemWithString: (NSString*) value block:(void(^)(id sender))block;
|
243
|
+
|
244
|
+
/** initializes a menu item from a string with a target/selector
|
245
|
+
The "target" won't be retained.
|
246
|
+
*/
|
247
|
+
-(id) initWithString: (NSString*) value target:(id) r selector:(SEL) s;
|
248
|
+
|
249
|
+
/** set font size */
|
250
|
+
-(void) setFontSize: (NSUInteger) s;
|
251
|
+
|
252
|
+
/** get font size */
|
253
|
+
-(NSUInteger) fontSize;
|
254
|
+
|
255
|
+
/** set the font name */
|
256
|
+
-(void) setFontName: (NSString*) n;
|
257
|
+
|
258
|
+
/** get the font name */
|
259
|
+
-(NSString*) fontName;
|
260
|
+
|
261
|
+
/** initializes a menu item from a string with the specified block.
|
262
|
+
The block will be "copied".
|
263
|
+
*/
|
264
|
+
-(id) initWithString: (NSString*) value block:(void(^)(id sender))block;
|
265
|
+
|
266
|
+
@end
|
267
|
+
|
268
|
+
#pragma mark -
|
269
|
+
#pragma mark CCMenuItemSprite
|
270
|
+
|
271
|
+
/** CCMenuItemSprite accepts CCNode<CCRGBAProtocol> objects as items.
|
272
|
+
The images has 3 different states:
|
273
|
+
- unselected image
|
274
|
+
- selected image
|
275
|
+
- disabled image
|
276
|
+
|
277
|
+
@since v0.8.0
|
278
|
+
*/
|
279
|
+
@interface CCMenuItemSprite : CCMenuItem <CCRGBAProtocol>
|
280
|
+
{
|
281
|
+
CCNode<CCRGBAProtocol> *_normalImage, *_selectedImage, *_disabledImage;
|
282
|
+
}
|
283
|
+
|
284
|
+
// weak references
|
285
|
+
|
286
|
+
/** the image used when the item is not selected */
|
287
|
+
@property (nonatomic,readwrite,assign) CCNode<CCRGBAProtocol> *normalImage;
|
288
|
+
/** the image used when the item is selected */
|
289
|
+
@property (nonatomic,readwrite,assign) CCNode<CCRGBAProtocol> *selectedImage;
|
290
|
+
/** the image used when the item is disabled */
|
291
|
+
@property (nonatomic,readwrite,assign) CCNode<CCRGBAProtocol> *disabledImage;
|
292
|
+
|
293
|
+
/** creates a menu item with a normal and selected image*/
|
294
|
+
+(id) itemWithNormalSprite:(CCNode<CCRGBAProtocol>*)normalSprite selectedSprite:(CCNode<CCRGBAProtocol>*)selectedSprite;
|
295
|
+
/** creates a menu item with a normal and selected image with target/selector.
|
296
|
+
The "target" won't be retained.
|
297
|
+
*/
|
298
|
+
+(id) itemWithNormalSprite:(CCNode<CCRGBAProtocol>*)normalSprite selectedSprite:(CCNode<CCRGBAProtocol>*)selectedSprite target:(id)target selector:(SEL)selector;
|
299
|
+
|
300
|
+
/** creates a menu item with a normal, selected and disabled image with target/selector.
|
301
|
+
The "target" won't be retained.
|
302
|
+
*/
|
303
|
+
+(id) itemWithNormalSprite:(CCNode<CCRGBAProtocol>*)normalSprite selectedSprite:(CCNode<CCRGBAProtocol>*)selectedSprite disabledSprite:(CCNode<CCRGBAProtocol>*)disabledSprite target:(id)target selector:(SEL)selector;
|
304
|
+
|
305
|
+
/** creates a menu item with a normal and selected image with a block.
|
306
|
+
The block will be "copied".
|
307
|
+
*/
|
308
|
+
+(id) itemWithNormalSprite:(CCNode<CCRGBAProtocol>*)normalSprite selectedSprite:(CCNode<CCRGBAProtocol>*)selectedSprite block:(void(^)(id sender))block;
|
309
|
+
|
310
|
+
/** creates a menu item with a normal, selected and disabled image with a block.
|
311
|
+
The block will be "copied".
|
312
|
+
*/
|
313
|
+
+(id) itemWithNormalSprite:(CCNode<CCRGBAProtocol>*)normalSprite selectedSprite:(CCNode<CCRGBAProtocol>*)selectedSprite disabledSprite:(CCNode<CCRGBAProtocol>*)disabledSprite block:(void(^)(id sender))block;
|
314
|
+
|
315
|
+
/** initializes a menu item with a normal, selected and disabled image with target/selector.
|
316
|
+
The "target" won't be retained.
|
317
|
+
*/
|
318
|
+
-(id) initWithNormalSprite:(CCNode<CCRGBAProtocol>*)normalSprite selectedSprite:(CCNode<CCRGBAProtocol>*)selectedSprite disabledSprite:(CCNode<CCRGBAProtocol>*)disabledSprite target:(id)target selector:(SEL)selector;
|
319
|
+
|
320
|
+
/** initializes a menu item with a normal, selected and disabled image with a block.
|
321
|
+
The block will be "copied".
|
322
|
+
*/
|
323
|
+
-(id) initWithNormalSprite:(CCNode<CCRGBAProtocol>*)normalSprite selectedSprite:(CCNode<CCRGBAProtocol>*)selectedSprite disabledSprite:(CCNode<CCRGBAProtocol>*)disabledSprite block:(void(^)(id sender))block;
|
324
|
+
|
325
|
+
@end
|
326
|
+
|
327
|
+
#pragma mark -
|
328
|
+
#pragma mark CCMenuItemImage
|
329
|
+
|
330
|
+
/** CCMenuItemImage accepts images as items.
|
331
|
+
The images has 3 different states:
|
332
|
+
- unselected image
|
333
|
+
- selected image
|
334
|
+
- disabled image
|
335
|
+
|
336
|
+
For best results try that all images are of the same size
|
337
|
+
*/
|
338
|
+
@interface CCMenuItemImage : CCMenuItemSprite
|
339
|
+
{
|
340
|
+
}
|
341
|
+
|
342
|
+
/** creates a menu item with a normal and selected image*/
|
343
|
+
+(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2;
|
344
|
+
|
345
|
+
/** creates a menu item with a normal, selected and disabled image */
|
346
|
+
+(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage: (NSString*) value3;
|
347
|
+
|
348
|
+
/** creates a menu item with a normal and selected image with target/selector */
|
349
|
+
+(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 target:(id) r selector:(SEL) s;
|
350
|
+
|
351
|
+
/** creates a menu item with a normal, selected and disabled image with target/selector.
|
352
|
+
The "target" won't be retained.
|
353
|
+
*/
|
354
|
+
+(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 target:(id) r selector:(SEL) s;
|
355
|
+
|
356
|
+
/** creates a menu item with a normal and selected image with a block.
|
357
|
+
The block will be "copied".
|
358
|
+
*/
|
359
|
+
+(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 block:(void(^)(id sender))block;
|
360
|
+
|
361
|
+
/** creates a menu item with a normal, selected and disabled image with a block.
|
362
|
+
The block will be "copied".
|
363
|
+
*/
|
364
|
+
+(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block;
|
365
|
+
|
366
|
+
/** initializes a menu item with a normal, selected and disabled image with target/selector.
|
367
|
+
The "target" won't be retained.
|
368
|
+
*/
|
369
|
+
-(id) initWithNormalImage: (NSString*) value selectedImage:(NSString*)value2 disabledImage:(NSString*) value3 target:(id) r selector:(SEL) s;
|
370
|
+
|
371
|
+
/** initializes a menu item with a normal, selected and disabled image with a block.
|
372
|
+
The block will be "copied".
|
373
|
+
*/
|
374
|
+
-(id) initWithNormalImage: (NSString*) value selectedImage:(NSString*)value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block;
|
375
|
+
|
376
|
+
/** sets the sprite frame for the normal image */
|
377
|
+
- (void) setNormalSpriteFrame:(CCSpriteFrame*)frame;
|
378
|
+
|
379
|
+
/** sets the sprite frame for the selected image */
|
380
|
+
- (void) setSelectedSpriteFrame:(CCSpriteFrame*)frame;
|
381
|
+
|
382
|
+
/** sets the sprite frame for the disabled image */
|
383
|
+
- (void) setDisabledSpriteFrame:(CCSpriteFrame*)frame;
|
384
|
+
|
385
|
+
@end
|
386
|
+
|
387
|
+
#pragma mark -
|
388
|
+
#pragma mark CCMenuItemToggle
|
389
|
+
|
390
|
+
/** A CCMenuItemToggle
|
391
|
+
A simple container class that "toggles" its inner items
|
392
|
+
The inner itmes can be any MenuItem
|
393
|
+
*/
|
394
|
+
@interface CCMenuItemToggle : CCMenuItem <CCRGBAProtocol>
|
395
|
+
{
|
396
|
+
NSUInteger _selectedIndex;
|
397
|
+
NSMutableArray* _subItems;
|
398
|
+
CCMenuItem* _currentItem;
|
399
|
+
}
|
400
|
+
|
401
|
+
/** returns the selected item */
|
402
|
+
@property (nonatomic,readwrite) NSUInteger selectedIndex;
|
403
|
+
/** NSMutableArray that contains the subitems. You can add/remove items in runtime, and you can replace the array with a new one.
|
404
|
+
@since v0.7.2
|
405
|
+
*/
|
406
|
+
@property (nonatomic,readwrite,retain) NSMutableArray *subItems;
|
407
|
+
|
408
|
+
/** creates a menu item from a list of items with a target/selector */
|
409
|
+
+(id) itemWithTarget:(id)target selector:(SEL)selector items:(CCMenuItem*) item, ... NS_REQUIRES_NIL_TERMINATION;
|
410
|
+
+(id) itemWithTarget:(id)target selector:(SEL)selector items:(CCMenuItem*) item vaList:(va_list)args;
|
411
|
+
|
412
|
+
/** creates a menu item from a list of items. */
|
413
|
+
+(id) itemWithItems:(NSArray*)arrayOfItems;
|
414
|
+
|
415
|
+
/** creates a menu item from a list of items and executes the given block when the item is selected.
|
416
|
+
The block will be "copied".
|
417
|
+
*/
|
418
|
+
+(id) itemWithItems:(NSArray*)arrayOfItems block:(void(^)(id sender))block;
|
419
|
+
|
420
|
+
/** initializes a menu item from a list of items with a block.
|
421
|
+
The block will be "copied".
|
422
|
+
*/
|
423
|
+
-(id) initWithItems:(NSArray*)arrayOfItems block:(void (^)(id))block;
|
424
|
+
|
425
|
+
/** return the selected item */
|
426
|
+
-(CCMenuItem*) selectedItem;
|
427
|
+
@end
|
428
|
+
|
@@ -0,0 +1,86 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (c) 2011 ForzeField Studios S.L. http://forzefield.com
|
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
|
+
|
27
|
+
#import <Foundation/Foundation.h>
|
28
|
+
#import "CCTexture2D.h"
|
29
|
+
#import "ccTypes.h"
|
30
|
+
#import "CCNode.h"
|
31
|
+
|
32
|
+
/** MotionStreak.
|
33
|
+
Creates a trailing path.
|
34
|
+
*/
|
35
|
+
@interface CCMotionStreak : CCNodeRGBA <CCTextureProtocol>
|
36
|
+
{
|
37
|
+
CCTexture2D *_texture;
|
38
|
+
CGPoint _positionR;
|
39
|
+
ccBlendFunc _blendFunc;
|
40
|
+
float _stroke;
|
41
|
+
float _fadeDelta;
|
42
|
+
float _minSeg;
|
43
|
+
|
44
|
+
NSUInteger _maxPoints;
|
45
|
+
NSUInteger _nuPoints;
|
46
|
+
NSUInteger _previousNuPoints;
|
47
|
+
|
48
|
+
/** Pointers */
|
49
|
+
CGPoint *_pointVertexes;
|
50
|
+
float *_pointState;
|
51
|
+
|
52
|
+
// Opengl
|
53
|
+
ccVertex2F *_vertices;
|
54
|
+
unsigned char *_colorPointer;
|
55
|
+
ccTex2F *_texCoords;
|
56
|
+
|
57
|
+
BOOL _fastMode;
|
58
|
+
|
59
|
+
BOOL _startingPositionInitialized;
|
60
|
+
}
|
61
|
+
/** blending function */
|
62
|
+
@property (nonatomic, readwrite, assign) ccBlendFunc blendFunc;
|
63
|
+
|
64
|
+
/** When fast mode is enabled, new points are added faster but with lower precision */
|
65
|
+
@property (nonatomic, readwrite, assign, getter = isFastMode) BOOL fastMode;
|
66
|
+
|
67
|
+
/** texture used for the motion streak */
|
68
|
+
@property (nonatomic, retain) CCTexture2D *texture;
|
69
|
+
|
70
|
+
/** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename */
|
71
|
+
+ (id) streakWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color textureFilename:(NSString*)path;
|
72
|
+
/** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture */
|
73
|
+
+ (id) streakWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color texture:(CCTexture2D*)texture;
|
74
|
+
|
75
|
+
/** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture filename */
|
76
|
+
- (id) initWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color textureFilename:(NSString*)path;
|
77
|
+
/** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture */
|
78
|
+
- (id) initWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color texture:(CCTexture2D*)texture;
|
79
|
+
|
80
|
+
/** color used for the tint */
|
81
|
+
- (void) tintWithColor:(ccColor3B)colors;
|
82
|
+
|
83
|
+
/** Remove all living segments of the ribbon */
|
84
|
+
- (void) reset;
|
85
|
+
|
86
|
+
@end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (c) 2012 Zynga Inc.
|
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
|
+
#import "CCNode.h"
|
26
|
+
|
27
|
+
#ifdef DEBUG
|
28
|
+
|
29
|
+
/** Debugging extensions of CCNode.
|
30
|
+
They are available when the DEBUG macro is defined at compile time
|
31
|
+
*/
|
32
|
+
@interface CCNode (Debug)
|
33
|
+
|
34
|
+
/** prints on the debug console the scene graph */
|
35
|
+
-(void) walkSceneGraph:(NSUInteger)level;
|
36
|
+
|
37
|
+
@end
|
38
|
+
|
39
|
+
#endif // DEBUG
|