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,99 @@
|
|
1
|
+
/*
|
2
|
+
* cocos2d for iPhone: http://www.cocos2d-iphone.org
|
3
|
+
*
|
4
|
+
* Copyright (C) 2009 Matt Oswald
|
5
|
+
*
|
6
|
+
* Copyright (c) 2009-2010 Ricardo Quesada
|
7
|
+
* Copyright (c) 2011 Zynga Inc.
|
8
|
+
*
|
9
|
+
* Copyright (c) 2011 Marco Tillemans
|
10
|
+
*
|
11
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
12
|
+
* of this software and associated documentation files (the "Software"), to deal
|
13
|
+
* in the Software without restriction, including without limitation the rights
|
14
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
15
|
+
* copies of the Software, and to permit persons to whom the Software is
|
16
|
+
* furnished to do so, subject to the following conditions:
|
17
|
+
*
|
18
|
+
* The above copyright notice and this permission notice shall be included in
|
19
|
+
* all copies or substantial portions of the Software.
|
20
|
+
*
|
21
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
26
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
27
|
+
* THE SOFTWARE.
|
28
|
+
*
|
29
|
+
*/
|
30
|
+
|
31
|
+
#import "CCNode.h"
|
32
|
+
@class CCTextureAtlas;
|
33
|
+
@class CCParticleSystem;
|
34
|
+
|
35
|
+
//don't use lazy sorting for particle systems
|
36
|
+
@interface CCNode (extension)
|
37
|
+
-(void) setZOrder:(NSUInteger) z;
|
38
|
+
@end
|
39
|
+
|
40
|
+
/** CCParticleBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call
|
41
|
+
* (often known as "batch draw").
|
42
|
+
*
|
43
|
+
* A CCParticleBatchNode can reference one and only one texture (one image file, one texture atlas).
|
44
|
+
* Only the CCParticleSystems that are contained in that texture can be added to the CCSpriteBatchNode.
|
45
|
+
* All CCParticleSystems added to a CCSpriteBatchNode are drawn in one OpenGL ES draw call.
|
46
|
+
* If the CCParticleSystems are not added to a CCParticleBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient.
|
47
|
+
*
|
48
|
+
*
|
49
|
+
* Limitations:
|
50
|
+
* - At the moment only CCParticleSystemQuad is supported
|
51
|
+
* - All systems need to be drawn with the same parameters, blend function, aliasing, texture
|
52
|
+
*
|
53
|
+
* Most efficient usage
|
54
|
+
* - Initialize the ParticleBatchNode with the texture and enough capacity for all the particle systems
|
55
|
+
* - Initialize all particle systems and add them as child to the batch node
|
56
|
+
* @since v1.1
|
57
|
+
*/
|
58
|
+
|
59
|
+
@interface CCParticleBatchNode : CCNode <CCTextureProtocol> {
|
60
|
+
|
61
|
+
CCTextureAtlas *_textureAtlas;
|
62
|
+
ccBlendFunc _blendFunc;
|
63
|
+
}
|
64
|
+
|
65
|
+
/** the texture atlas used for drawing the quads */
|
66
|
+
@property (nonatomic, retain) CCTextureAtlas* textureAtlas;
|
67
|
+
/** the blend function used for drawing the quads */
|
68
|
+
@property (nonatomic, readwrite) ccBlendFunc blendFunc;
|
69
|
+
|
70
|
+
/** initializes the particle system with CCTexture2D, a default capacity of 500 */
|
71
|
+
+(id)batchNodeWithTexture:(CCTexture2D *)tex;
|
72
|
+
|
73
|
+
/** initializes the particle system with the name of a file on disk (for a list of supported formats look at the CCTexture2D class), a default capacity of 500 particles */
|
74
|
+
+(id)batchNodeWithFile:(NSString*) imageFile;
|
75
|
+
|
76
|
+
/** initializes the particle system with CCTexture2D, a capacity of particles, which particle system to use */
|
77
|
+
+(id)batchNodeWithTexture:(CCTexture2D *)tex capacity:(NSUInteger) capacity;
|
78
|
+
|
79
|
+
/** initializes the particle system with the name of a file on disk (for a list of supported formats look at the CCTexture2D class), a capacity of particles */
|
80
|
+
+(id)batchNodeWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity;
|
81
|
+
|
82
|
+
/** initializes the particle system with CCTexture2D, a capacity of particles */
|
83
|
+
-(id)initWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity;
|
84
|
+
|
85
|
+
/** initializes the particle system with the name of a file on disk (for a list of supported formats look at the CCTexture2D class), a capacity of particles */
|
86
|
+
-(id)initWithFile:(NSString *)fileImage capacity:(NSUInteger)capacity;
|
87
|
+
|
88
|
+
/** Add a child into the CCParticleBatchNode */
|
89
|
+
-(void) addChild:(CCParticleSystem*)child z:(NSInteger)z tag:(NSInteger) aTag;
|
90
|
+
|
91
|
+
/** Inserts a child into the CCParticleBatchNode */
|
92
|
+
-(void) insertChild:(CCParticleSystem*) pSystem inAtlasAtIndex:(NSUInteger)index;
|
93
|
+
|
94
|
+
/** remove child from the CCParticleBatchNode */
|
95
|
+
-(void) removeChild:(CCParticleSystem*) pSystem cleanup:(BOOL)doCleanUp;
|
96
|
+
|
97
|
+
/** disables a particle by inserting a 0'd quad into the texture atlas */
|
98
|
+
-(void) disableParticle:(NSUInteger) particleIndex;
|
99
|
+
@end
|
@@ -0,0 +1,117 @@
|
|
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 "ccMacros.h"
|
29
|
+
#import "CCParticleSystemQuad.h"
|
30
|
+
|
31
|
+
//! A fire particle system
|
32
|
+
@interface CCParticleFire: CCParticleSystemQuad
|
33
|
+
{
|
34
|
+
}
|
35
|
+
// needed for BridgeSupport
|
36
|
+
-(id) init;
|
37
|
+
@end
|
38
|
+
|
39
|
+
//! A fireworks particle system
|
40
|
+
@interface CCParticleFireworks : CCParticleSystemQuad
|
41
|
+
{
|
42
|
+
}
|
43
|
+
// needed for BridgeSupport
|
44
|
+
-(id) init;
|
45
|
+
@end
|
46
|
+
|
47
|
+
//! A sun particle system
|
48
|
+
@interface CCParticleSun : CCParticleSystemQuad
|
49
|
+
{
|
50
|
+
}
|
51
|
+
// needed for BridgeSupport
|
52
|
+
-(id) init;
|
53
|
+
@end
|
54
|
+
|
55
|
+
//! A galaxy particle system
|
56
|
+
@interface CCParticleGalaxy : CCParticleSystemQuad
|
57
|
+
{
|
58
|
+
}
|
59
|
+
// needed for BridgeSupport
|
60
|
+
-(id) init;
|
61
|
+
@end
|
62
|
+
|
63
|
+
//! A flower particle system
|
64
|
+
@interface CCParticleFlower : CCParticleSystemQuad
|
65
|
+
{
|
66
|
+
}
|
67
|
+
// needed for BridgeSupport
|
68
|
+
-(id) init;
|
69
|
+
@end
|
70
|
+
|
71
|
+
//! A meteor particle system
|
72
|
+
@interface CCParticleMeteor : CCParticleSystemQuad
|
73
|
+
{
|
74
|
+
}
|
75
|
+
// needed for BridgeSupport
|
76
|
+
-(id) init;
|
77
|
+
@end
|
78
|
+
|
79
|
+
//! An spiral particle system
|
80
|
+
@interface CCParticleSpiral : CCParticleSystemQuad
|
81
|
+
{
|
82
|
+
}
|
83
|
+
// needed for BridgeSupport
|
84
|
+
-(id) init;
|
85
|
+
@end
|
86
|
+
|
87
|
+
//! An explosion particle system
|
88
|
+
@interface CCParticleExplosion : CCParticleSystemQuad
|
89
|
+
{
|
90
|
+
}
|
91
|
+
// needed for BridgeSupport
|
92
|
+
-(id) init;
|
93
|
+
@end
|
94
|
+
|
95
|
+
//! An smoke particle system
|
96
|
+
@interface CCParticleSmoke : CCParticleSystemQuad
|
97
|
+
{
|
98
|
+
}
|
99
|
+
// needed for BridgeSupport
|
100
|
+
-(id) init;
|
101
|
+
@end
|
102
|
+
|
103
|
+
//! An snow particle system
|
104
|
+
@interface CCParticleSnow : CCParticleSystemQuad
|
105
|
+
{
|
106
|
+
}
|
107
|
+
// needed for BridgeSupport
|
108
|
+
-(id) init;
|
109
|
+
@end
|
110
|
+
|
111
|
+
//! A rain particle system
|
112
|
+
@interface CCParticleRain : CCParticleSystemQuad
|
113
|
+
{
|
114
|
+
}
|
115
|
+
// needed for BridgeSupport
|
116
|
+
-(id) init;
|
117
|
+
@end
|
@@ -0,0 +1,464 @@
|
|
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 "CCProtocols.h"
|
29
|
+
#import "CCNode.h"
|
30
|
+
#import "ccTypes.h"
|
31
|
+
#import "ccConfig.h"
|
32
|
+
|
33
|
+
@class CCParticleBatchNode;
|
34
|
+
|
35
|
+
//* @enum
|
36
|
+
enum {
|
37
|
+
/** The Particle emitter lives forever */
|
38
|
+
kCCParticleDurationInfinity = -1,
|
39
|
+
|
40
|
+
/** The starting size of the particle is equal to the ending size */
|
41
|
+
kCCParticleStartSizeEqualToEndSize = -1,
|
42
|
+
|
43
|
+
/** The starting radius of the particle is equal to the ending radius */
|
44
|
+
kCCParticleStartRadiusEqualToEndRadius = -1,
|
45
|
+
|
46
|
+
// backward compatible
|
47
|
+
kParticleStartSizeEqualToEndSize = kCCParticleStartSizeEqualToEndSize,
|
48
|
+
kParticleDurationInfinity = kCCParticleDurationInfinity,
|
49
|
+
};
|
50
|
+
|
51
|
+
//* @enum
|
52
|
+
enum {
|
53
|
+
/** Gravity mode (A mode) */
|
54
|
+
kCCParticleModeGravity,
|
55
|
+
|
56
|
+
/** Radius mode (B mode) */
|
57
|
+
kCCParticleModeRadius,
|
58
|
+
};
|
59
|
+
|
60
|
+
|
61
|
+
/** @typedef tCCPositionType
|
62
|
+
possible types of particle positions
|
63
|
+
*/
|
64
|
+
typedef enum {
|
65
|
+
/** Living particles are attached to the world and are unaffected by emitter repositioning. */
|
66
|
+
kCCPositionTypeFree,
|
67
|
+
|
68
|
+
/** Living particles are attached to the world but will follow the emitter repositioning.
|
69
|
+
Use case: Attach an emitter to an sprite, and you want that the emitter follows the sprite.
|
70
|
+
*/
|
71
|
+
kCCPositionTypeRelative,
|
72
|
+
|
73
|
+
/** Living particles are attached to the emitter and are translated along with it. */
|
74
|
+
kCCPositionTypeGrouped,
|
75
|
+
}tCCPositionType;
|
76
|
+
|
77
|
+
// backward compatible
|
78
|
+
enum {
|
79
|
+
kPositionTypeFree = kCCPositionTypeFree,
|
80
|
+
kPositionTypeGrouped = kCCPositionTypeGrouped,
|
81
|
+
};
|
82
|
+
|
83
|
+
/** @struct tCCParticle
|
84
|
+
Structure that contains the values of each particle
|
85
|
+
*/
|
86
|
+
typedef struct sCCParticle {
|
87
|
+
CGPoint pos;
|
88
|
+
CGPoint startPos;
|
89
|
+
|
90
|
+
ccColor4F color;
|
91
|
+
ccColor4F deltaColor;
|
92
|
+
|
93
|
+
float size;
|
94
|
+
float deltaSize;
|
95
|
+
|
96
|
+
float rotation;
|
97
|
+
float deltaRotation;
|
98
|
+
|
99
|
+
ccTime timeToLive;
|
100
|
+
|
101
|
+
NSUInteger atlasIndex;
|
102
|
+
|
103
|
+
union {
|
104
|
+
// Mode A: gravity, direction, radial accel, tangential accel
|
105
|
+
struct {
|
106
|
+
CGPoint dir;
|
107
|
+
float radialAccel;
|
108
|
+
float tangentialAccel;
|
109
|
+
} A;
|
110
|
+
|
111
|
+
// Mode B: radius mode
|
112
|
+
struct {
|
113
|
+
float angle;
|
114
|
+
float degreesPerSecond;
|
115
|
+
float radius;
|
116
|
+
float deltaRadius;
|
117
|
+
} B;
|
118
|
+
} mode;
|
119
|
+
|
120
|
+
}tCCParticle;
|
121
|
+
|
122
|
+
typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tCCParticle*, CGPoint);
|
123
|
+
|
124
|
+
@class CCTexture2D;
|
125
|
+
|
126
|
+
/** Particle System base class
|
127
|
+
Attributes of a Particle System:
|
128
|
+
- emmision rate of the particles
|
129
|
+
- Gravity Mode (Mode A):
|
130
|
+
- gravity
|
131
|
+
- direction
|
132
|
+
- speed +- variance
|
133
|
+
- tangential acceleration +- variance
|
134
|
+
- radial acceleration +- variance
|
135
|
+
- Radius Mode (Mode B):
|
136
|
+
- startRadius +- variance
|
137
|
+
- endRadius +- variance
|
138
|
+
- rotate +- variance
|
139
|
+
- Properties common to all modes:
|
140
|
+
- life +- life variance
|
141
|
+
- start spin +- variance
|
142
|
+
- end spin +- variance
|
143
|
+
- start size +- variance
|
144
|
+
- end size +- variance
|
145
|
+
- start color +- variance
|
146
|
+
- end color +- variance
|
147
|
+
- life +- variance
|
148
|
+
- blending function
|
149
|
+
- texture
|
150
|
+
|
151
|
+
cocos2d also supports particles generated by Particle Designer (http://particledesigner.71squared.com/).
|
152
|
+
'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guarateed in cocos2d,
|
153
|
+
cocos2d uses a another approach, but the results are almost identical.
|
154
|
+
|
155
|
+
cocos2d supports all the variables used by Particle Designer plus a bit more:
|
156
|
+
- spinning particles (supported when using CCParticleSystemQuad)
|
157
|
+
- tangential acceleration (Gravity mode)
|
158
|
+
- radial acceleration (Gravity mode)
|
159
|
+
- radius direction (Radius mode) (Particle Designer supports outwards to inwards direction only)
|
160
|
+
|
161
|
+
It is possible to customize any of the above mentioned properties in runtime. Example:
|
162
|
+
|
163
|
+
@code
|
164
|
+
emitter.radialAccel = 15;
|
165
|
+
emitter.startSpin = 0;
|
166
|
+
@endcode
|
167
|
+
|
168
|
+
*/
|
169
|
+
@interface CCParticleSystem : CCNode <CCTextureProtocol>
|
170
|
+
{
|
171
|
+
// is the particle system active ?
|
172
|
+
BOOL _active;
|
173
|
+
// duration in seconds of the system. -1 is infinity
|
174
|
+
float _duration;
|
175
|
+
// time elapsed since the start of the system (in seconds)
|
176
|
+
float _elapsed;
|
177
|
+
|
178
|
+
// position is from "superclass" CocosNode
|
179
|
+
CGPoint _sourcePosition;
|
180
|
+
// Position variance
|
181
|
+
CGPoint _posVar;
|
182
|
+
|
183
|
+
// The angle (direction) of the particles measured in degrees
|
184
|
+
float _angle;
|
185
|
+
// Angle variance measured in degrees;
|
186
|
+
float _angleVar;
|
187
|
+
|
188
|
+
// Different modes
|
189
|
+
|
190
|
+
NSInteger _emitterMode;
|
191
|
+
union {
|
192
|
+
// Mode A:Gravity + Tangential Accel + Radial Accel
|
193
|
+
struct {
|
194
|
+
// gravity of the particles
|
195
|
+
CGPoint gravity;
|
196
|
+
|
197
|
+
// The speed the particles will have.
|
198
|
+
float speed;
|
199
|
+
// The speed variance
|
200
|
+
float speedVar;
|
201
|
+
|
202
|
+
// Tangential acceleration
|
203
|
+
float tangentialAccel;
|
204
|
+
// Tangential acceleration variance
|
205
|
+
float tangentialAccelVar;
|
206
|
+
|
207
|
+
// Radial acceleration
|
208
|
+
float radialAccel;
|
209
|
+
// Radial acceleration variance
|
210
|
+
float radialAccelVar;
|
211
|
+
} A;
|
212
|
+
|
213
|
+
// Mode B: circular movement (gravity, radial accel and tangential accel don't are not used in this mode)
|
214
|
+
struct {
|
215
|
+
|
216
|
+
// The starting radius of the particles
|
217
|
+
float startRadius;
|
218
|
+
// The starting radius variance of the particles
|
219
|
+
float startRadiusVar;
|
220
|
+
// The ending radius of the particles
|
221
|
+
float endRadius;
|
222
|
+
// The ending radius variance of the particles
|
223
|
+
float endRadiusVar;
|
224
|
+
// Number of degress to rotate a particle around the source pos per second
|
225
|
+
float rotatePerSecond;
|
226
|
+
// Variance in degrees for rotatePerSecond
|
227
|
+
float rotatePerSecondVar;
|
228
|
+
} B;
|
229
|
+
} _mode;
|
230
|
+
|
231
|
+
// start ize of the particles
|
232
|
+
float _startSize;
|
233
|
+
// start Size variance
|
234
|
+
float _startSizeVar;
|
235
|
+
// End size of the particle
|
236
|
+
float _endSize;
|
237
|
+
// end size of variance
|
238
|
+
float _endSizeVar;
|
239
|
+
|
240
|
+
// How many seconds will the particle live
|
241
|
+
float _life;
|
242
|
+
// Life variance
|
243
|
+
float _lifeVar;
|
244
|
+
|
245
|
+
// Start color of the particles
|
246
|
+
ccColor4F _startColor;
|
247
|
+
// Start color variance
|
248
|
+
ccColor4F _startColorVar;
|
249
|
+
// End color of the particles
|
250
|
+
ccColor4F _endColor;
|
251
|
+
// End color variance
|
252
|
+
ccColor4F _endColorVar;
|
253
|
+
|
254
|
+
// start angle of the particles
|
255
|
+
float _startSpin;
|
256
|
+
// start angle variance
|
257
|
+
float _startSpinVar;
|
258
|
+
// End angle of the particle
|
259
|
+
float _endSpin;
|
260
|
+
// end angle ariance
|
261
|
+
float _endSpinVar;
|
262
|
+
|
263
|
+
// Array of particles
|
264
|
+
tCCParticle *_particles;
|
265
|
+
// Maximum particles
|
266
|
+
NSUInteger _totalParticles;
|
267
|
+
// Count of active particles
|
268
|
+
NSUInteger _particleCount;
|
269
|
+
// Number of allocated particles
|
270
|
+
NSUInteger _allocatedParticles;
|
271
|
+
|
272
|
+
// How many particles can be emitted per second
|
273
|
+
float _emissionRate;
|
274
|
+
float _emitCounter;
|
275
|
+
|
276
|
+
// Texture of the particles
|
277
|
+
CCTexture2D *_texture;
|
278
|
+
// blend function
|
279
|
+
ccBlendFunc _blendFunc;
|
280
|
+
// Texture alpha behavior
|
281
|
+
BOOL _opacityModifyRGB;
|
282
|
+
|
283
|
+
// movment type: free or grouped
|
284
|
+
tCCPositionType _positionType;
|
285
|
+
|
286
|
+
// Whether or not the node will be auto-removed when there are not particles
|
287
|
+
BOOL _autoRemoveOnFinish;
|
288
|
+
|
289
|
+
// particle idx
|
290
|
+
NSUInteger _particleIdx;
|
291
|
+
|
292
|
+
// Optimization
|
293
|
+
CC_UPDATE_PARTICLE_IMP _updateParticleImp;
|
294
|
+
SEL _updateParticleSel;
|
295
|
+
|
296
|
+
// for batching. If nil, then it won't be batched
|
297
|
+
CCParticleBatchNode *_batchNode;
|
298
|
+
|
299
|
+
// index of system in batch node array
|
300
|
+
NSUInteger _atlasIndex;
|
301
|
+
|
302
|
+
//YES if scaled or rotated
|
303
|
+
BOOL _transformSystemDirty;
|
304
|
+
}
|
305
|
+
|
306
|
+
/** Is the emitter active */
|
307
|
+
@property (nonatomic,readonly) BOOL active;
|
308
|
+
/** Quantity of particles that are being simulated at the moment */
|
309
|
+
@property (nonatomic,readonly) NSUInteger particleCount;
|
310
|
+
/** How many seconds the emitter wil run. -1 means 'forever' */
|
311
|
+
@property (nonatomic,readwrite,assign) float duration;
|
312
|
+
/** sourcePosition of the emitter */
|
313
|
+
@property (nonatomic,readwrite,assign) CGPoint sourcePosition;
|
314
|
+
/** Position variance of the emitter */
|
315
|
+
@property (nonatomic,readwrite,assign) CGPoint posVar;
|
316
|
+
/** life, and life variation of each particle */
|
317
|
+
@property (nonatomic,readwrite,assign) float life;
|
318
|
+
/** life variance of each particle */
|
319
|
+
@property (nonatomic,readwrite,assign) float lifeVar;
|
320
|
+
/** angle and angle variation of each particle */
|
321
|
+
@property (nonatomic,readwrite,assign) float angle;
|
322
|
+
/** angle variance of each particle */
|
323
|
+
@property (nonatomic,readwrite,assign) float angleVar;
|
324
|
+
|
325
|
+
/** Gravity value. Only available in 'Gravity' mode. */
|
326
|
+
@property (nonatomic,readwrite,assign) CGPoint gravity;
|
327
|
+
/** speed of each particle. Only available in 'Gravity' mode. */
|
328
|
+
@property (nonatomic,readwrite,assign) float speed;
|
329
|
+
/** speed variance of each particle. Only available in 'Gravity' mode. */
|
330
|
+
@property (nonatomic,readwrite,assign) float speedVar;
|
331
|
+
/** tangential acceleration of each particle. Only available in 'Gravity' mode. */
|
332
|
+
@property (nonatomic,readwrite,assign) float tangentialAccel;
|
333
|
+
/** tangential acceleration variance of each particle. Only available in 'Gravity' mode. */
|
334
|
+
@property (nonatomic,readwrite,assign) float tangentialAccelVar;
|
335
|
+
/** radial acceleration of each particle. Only available in 'Gravity' mode. */
|
336
|
+
@property (nonatomic,readwrite,assign) float radialAccel;
|
337
|
+
/** radial acceleration variance of each particle. Only available in 'Gravity' mode. */
|
338
|
+
@property (nonatomic,readwrite,assign) float radialAccelVar;
|
339
|
+
|
340
|
+
/** The starting radius of the particles. Only available in 'Radius' mode. */
|
341
|
+
@property (nonatomic,readwrite,assign) float startRadius;
|
342
|
+
/** The starting radius variance of the particles. Only available in 'Radius' mode. */
|
343
|
+
@property (nonatomic,readwrite,assign) float startRadiusVar;
|
344
|
+
/** The ending radius of the particles. Only available in 'Radius' mode. */
|
345
|
+
@property (nonatomic,readwrite,assign) float endRadius;
|
346
|
+
/** The ending radius variance of the particles. Only available in 'Radius' mode. */
|
347
|
+
@property (nonatomic,readwrite,assign) float endRadiusVar;
|
348
|
+
/** Number of degress to rotate a particle around the source pos per second. Only available in 'Radius' mode. */
|
349
|
+
@property (nonatomic,readwrite,assign) float rotatePerSecond;
|
350
|
+
/** Variance in degrees for rotatePerSecond. Only available in 'Radius' mode. */
|
351
|
+
@property (nonatomic,readwrite,assign) float rotatePerSecondVar;
|
352
|
+
|
353
|
+
/** start size in pixels of each particle */
|
354
|
+
@property (nonatomic,readwrite,assign) float startSize;
|
355
|
+
/** size variance in pixels of each particle */
|
356
|
+
@property (nonatomic,readwrite,assign) float startSizeVar;
|
357
|
+
/** end size in pixels of each particle */
|
358
|
+
@property (nonatomic,readwrite,assign) float endSize;
|
359
|
+
/** end size variance in pixels of each particle */
|
360
|
+
@property (nonatomic,readwrite,assign) float endSizeVar;
|
361
|
+
/** start color of each particle */
|
362
|
+
@property (nonatomic,readwrite,assign) ccColor4F startColor;
|
363
|
+
/** start color variance of each particle */
|
364
|
+
@property (nonatomic,readwrite,assign) ccColor4F startColorVar;
|
365
|
+
/** end color and end color variation of each particle */
|
366
|
+
@property (nonatomic,readwrite,assign) ccColor4F endColor;
|
367
|
+
/** end color variance of each particle */
|
368
|
+
@property (nonatomic,readwrite,assign) ccColor4F endColorVar;
|
369
|
+
//* initial angle of each particle
|
370
|
+
@property (nonatomic,readwrite,assign) float startSpin;
|
371
|
+
//* initial angle of each particle
|
372
|
+
@property (nonatomic,readwrite,assign) float startSpinVar;
|
373
|
+
//* initial angle of each particle
|
374
|
+
@property (nonatomic,readwrite,assign) float endSpin;
|
375
|
+
//* initial angle of each particle
|
376
|
+
@property (nonatomic,readwrite,assign) float endSpinVar;
|
377
|
+
/** emission rate of the particles */
|
378
|
+
@property (nonatomic,readwrite,assign) float emissionRate;
|
379
|
+
/** maximum particles of the system */
|
380
|
+
@property (nonatomic,readwrite,assign) NSUInteger totalParticles;
|
381
|
+
/** conforms to CocosNodeTexture protocol */
|
382
|
+
@property (nonatomic,readwrite, retain) CCTexture2D * texture;
|
383
|
+
/** conforms to CocosNodeTexture protocol */
|
384
|
+
@property (nonatomic,readwrite) ccBlendFunc blendFunc;
|
385
|
+
/** does the alpha value modify color */
|
386
|
+
@property (nonatomic, readwrite, getter=doesOpacityModifyRGB, assign) BOOL opacityModifyRGB;
|
387
|
+
/** whether or not the particles are using blend additive.
|
388
|
+
If enabled, the following blending function will be used.
|
389
|
+
@code
|
390
|
+
source blend function = GL_SRC_ALPHA;
|
391
|
+
dest blend function = GL_ONE;
|
392
|
+
@endcode
|
393
|
+
*/
|
394
|
+
@property (nonatomic,readwrite) BOOL blendAdditive;
|
395
|
+
/** particles movement type: Free or Grouped
|
396
|
+
@since v0.8
|
397
|
+
*/
|
398
|
+
@property (nonatomic,readwrite) tCCPositionType positionType;
|
399
|
+
/** whether or not the node will be auto-removed when it has no particles left.
|
400
|
+
By default it is NO.
|
401
|
+
@since v0.8
|
402
|
+
*/
|
403
|
+
@property (nonatomic,readwrite) BOOL autoRemoveOnFinish;
|
404
|
+
/** Switch between different kind of emitter modes:
|
405
|
+
- kCCParticleModeGravity: uses gravity, speed, radial and tangential acceleration
|
406
|
+
- kCCParticleModeRadius: uses radius movement + rotation
|
407
|
+
*/
|
408
|
+
@property (nonatomic,readwrite) NSInteger emitterMode;
|
409
|
+
|
410
|
+
/** weak reference to the CCSpriteBatchNode that renders the CCSprite */
|
411
|
+
@property (nonatomic,readwrite,assign) CCParticleBatchNode *batchNode;
|
412
|
+
|
413
|
+
@property (nonatomic,readwrite) NSUInteger atlasIndex;
|
414
|
+
|
415
|
+
/** creates an initializes a CCParticleSystem from a plist file.
|
416
|
+
This plist files can be creted manually or with Particle Designer:
|
417
|
+
http://particledesigner.71squared.com/
|
418
|
+
@since v0.99.3
|
419
|
+
*/
|
420
|
+
+(id) particleWithFile:(NSString*)plistFile;
|
421
|
+
|
422
|
+
/* creates an void particle emitter with a maximun number of particles.
|
423
|
+
@since v2.1
|
424
|
+
*/
|
425
|
+
+(id) particleWithTotalParticles:(NSUInteger) numberOfParticles;
|
426
|
+
|
427
|
+
|
428
|
+
/** initializes a CCParticleSystem from a plist file.
|
429
|
+
This plist files can be creted manually or with Particle Designer:
|
430
|
+
http://particledesigner.71squared.com/
|
431
|
+
@since v0.99.3
|
432
|
+
*/
|
433
|
+
-(id) initWithFile:(NSString*) plistFile;
|
434
|
+
|
435
|
+
/** initializes a particle system from a NSDictionary.
|
436
|
+
@since v0.99.3
|
437
|
+
*/
|
438
|
+
-(id) initWithDictionary:(NSDictionary*)dictionary;
|
439
|
+
|
440
|
+
/** initializes a particle system from a NSDictionary and the path from where to load the png
|
441
|
+
@since v2.1
|
442
|
+
*/
|
443
|
+
-(id) initWithDictionary:(NSDictionary *)dictionary path:(NSString*)dirname;
|
444
|
+
|
445
|
+
//! Initializes a system with a fixed number of particles
|
446
|
+
-(id) initWithTotalParticles:(NSUInteger) numberOfParticles;
|
447
|
+
//! stop emitting particles. Running particles will continue to run until they die
|
448
|
+
-(void) stopSystem;
|
449
|
+
//! Kill all living particles.
|
450
|
+
-(void) resetSystem;
|
451
|
+
//! whether or not the system is full
|
452
|
+
-(BOOL) isFull;
|
453
|
+
|
454
|
+
//! should be overriden by subclasses
|
455
|
+
-(void) updateQuadWithParticle:(tCCParticle*)particle newPosition:(CGPoint)pos;
|
456
|
+
//! should be overriden by subclasses
|
457
|
+
-(void) postStep;
|
458
|
+
|
459
|
+
//! called in every loop.
|
460
|
+
-(void) update: (ccTime) dt;
|
461
|
+
|
462
|
+
-(void) updateWithNoTime;
|
463
|
+
|
464
|
+
@end
|