- Particles 2 4 2 – Create Professional Cocos2d Particle Emitters Using
- Particles 2 4 2 – Create Professional Cocos2d Particle Emitters Download
- Particles 2 4 2 – Create Professional Cocos2d Particle Emitters Tutorial
Table of Contentsgenerated with DocToc
- Requirements
- How to run tests
- v3.5rc0
- Features in detail
- v3.5beta0
- Features in detail
- 3D Particles
- Features in detail
I'm here to introduce a custom particle emitter behaviour, so I made a tutorial just for you! I recorded a tutorial video (the first video), and exemples (second video). First Video that explain how I created the chimney smoke from my SP00KY HOUSE!! Particles gives you the power to create professional Cocos2D particle emitters in minutes for iOS and OS X.
- v3.0 Release Notes can be found here: v3.0 Release Notes
Runtime Requirements
- Android 2.3 or newer
- iOS 5.0 or newer
- OS X 10.7 or newer
- Windows 7 or newer
- Windows Phone 8 or newer
- Linux Ubuntu 14.04 or newer
Compiler Requirements
- Xcode 5.1 or newer for iOS or Mac
- gcc 4.9 or newer for Linux
- ndk-r10c for Android
- Visual Studio 2012 or newer for Windows (win32)
- Visual Studio 2012 or newer for Windows Phone 8
How to run tests
Mac OSX & iOS
- Enter
cocos2d-x/build
folder, opencocos2d_test.xcodeproj
- Select
iOS
orOS X
target in scheme toolbar - Click
run
button
Android
You can run the samples...
Using command line:
Then click item on Android device to run tests. Available value of -p
is the API level, cocos2d-x supports from level 10.
Using Eclipse:
Then
- Import cocos2d-x Android project into Eclipse, the path used to import is
cocos/2d/platform/android
- Import
cpp-empty-test
Android project into Eclipse, the path used to import istests/cpp-empty-test/proj.android
- Build
cpp-empty-test
Android project and run
Windows
- Enter
cocos2d-x/build
, and opencocos2d-win32.vs2012.sln
- Select
cpp-empty-test
as running target - Click run button
Linux
Then
Run
How to start a new game
Please refer to this document: ReadMe
There are only some minor changes and bug fixes in this verison.
- EditBox: Color4B font color is supported
- Fix memory leak in AutoReleasePool
- Fix FileUtils:getWritablePath() return wrong path on Mac&Windows
Highlights of v3.5rc0
- More features of Particle(PU) is supported
- Disable reverse of MoveTo
- CsLoader: add callback when loading a CSB file
- Fix transparent Billboard and Sprite3D rendering error
- Fix Motionstreak does not work with MoveTo and MoveBy
- More bugs fixed
Features in detail
More 3D particle features of (PU) supported
Observer: On Count Observer, On Emission Observer, On Expire Observer, On Position observer, On Clear Observer, On Time Observer, On Quota Observer, On Velocity Observer, On Collision Observer, On Event Flag Observer, On Random Observer.
Event Handler: Do Enable Component Event Handler, Do Expire Event Handler, Do Placement Particle Event Handler, Do Stop System Event Handler, Do Affector Event Handler, Do Freeze Event Handler, Do Scale Event Handler.
Behavior: Slave Behavior
Observer and Event Handler allow you to listen to the particle system and trigger some events. The Event handler can do something when the event happens. For example, there is a observer on the particle system, and it listens to the particle number when the number is greater than 100, it tirggers an event to stop the particle system. This allows you to create more complex particles. For more details, please refer to the Particle Universe User's Guide.
Particles 2 4 2 – Create Professional Cocos2d Particle Emitters Using
Highlights of v3.5beta0
Features in detail
3D Particles
Supported PU features
Render: Billboard Renderer, Box Renderer, Sphere Renderer, Entity Renderer, Ribbon Trail Renderer.
Emitter: Point Emitter, Box Emitter, Sphere Surface Emitter, Line Emitter, Circle Emitter, Position Emitter, Slave Emitter.
Affector: Gravity Affector, Linear Force Affector, Scale Affector, Sine Force Affector, Color Affector, Randomiser, Line Affector, Align Affector, Jet Affector, Vortex Affector, Geometry Rotator, Texture Rotator, Texture Animator, Particle Follower, Sphere Collider, Plane Collider, box Collider, Path Follower, Flock Centering Affector, Velocity Matching Affector.
Particle usage
It allows to import particles from Particle Universe (http://www.fxpression.com). The usage of particles is as follow,
Option 1, create 3D particle with particle (.pu) file and material file
- v3.0 Release Notes can be found here: v3.0 Release Notes
Runtime Requirements
- Android 2.3 or newer
- iOS 5.0 or newer
- OS X 10.7 or newer
- Windows 7 or newer
- Windows Phone 8 or newer
- Linux Ubuntu 14.04 or newer
Compiler Requirements
- Xcode 5.1 or newer for iOS or Mac
- gcc 4.9 or newer for Linux
- ndk-r10c for Android
- Visual Studio 2012 or newer for Windows (win32)
- Visual Studio 2012 or newer for Windows Phone 8
How to run tests
Mac OSX & iOS
- Enter
cocos2d-x/build
folder, opencocos2d_test.xcodeproj
- Select
iOS
orOS X
target in scheme toolbar - Click
run
button
Android
You can run the samples...
Using command line:
Then click item on Android device to run tests. Available value of -p
is the API level, cocos2d-x supports from level 10.
Using Eclipse:
Then
- Import cocos2d-x Android project into Eclipse, the path used to import is
cocos/2d/platform/android
- Import
cpp-empty-test
Android project into Eclipse, the path used to import istests/cpp-empty-test/proj.android
- Build
cpp-empty-test
Android project and run
Windows
- Enter
cocos2d-x/build
, and opencocos2d-win32.vs2012.sln
- Select
cpp-empty-test
as running target - Click run button
Linux
Then
Run
How to start a new game
Please refer to this document: ReadMe
There are only some minor changes and bug fixes in this verison.
- EditBox: Color4B font color is supported
- Fix memory leak in AutoReleasePool
- Fix FileUtils:getWritablePath() return wrong path on Mac&Windows
Highlights of v3.5rc0
- More features of Particle(PU) is supported
- Disable reverse of MoveTo
- CsLoader: add callback when loading a CSB file
- Fix transparent Billboard and Sprite3D rendering error
- Fix Motionstreak does not work with MoveTo and MoveBy
- More bugs fixed
Features in detail
More 3D particle features of (PU) supported
Observer: On Count Observer, On Emission Observer, On Expire Observer, On Position observer, On Clear Observer, On Time Observer, On Quota Observer, On Velocity Observer, On Collision Observer, On Event Flag Observer, On Random Observer.
Event Handler: Do Enable Component Event Handler, Do Expire Event Handler, Do Placement Particle Event Handler, Do Stop System Event Handler, Do Affector Event Handler, Do Freeze Event Handler, Do Scale Event Handler.
Behavior: Slave Behavior
Observer and Event Handler allow you to listen to the particle system and trigger some events. The Event handler can do something when the event happens. For example, there is a observer on the particle system, and it listens to the particle number when the number is greater than 100, it tirggers an event to stop the particle system. This allows you to create more complex particles. For more details, please refer to the Particle Universe User's Guide.
Particles 2 4 2 – Create Professional Cocos2d Particle Emitters Using
Highlights of v3.5beta0
Features in detail
3D Particles
Supported PU features
Render: Billboard Renderer, Box Renderer, Sphere Renderer, Entity Renderer, Ribbon Trail Renderer.
Emitter: Point Emitter, Box Emitter, Sphere Surface Emitter, Line Emitter, Circle Emitter, Position Emitter, Slave Emitter.
Affector: Gravity Affector, Linear Force Affector, Scale Affector, Sine Force Affector, Color Affector, Randomiser, Line Affector, Align Affector, Jet Affector, Vortex Affector, Geometry Rotator, Texture Rotator, Texture Animator, Particle Follower, Sphere Collider, Plane Collider, box Collider, Path Follower, Flock Centering Affector, Velocity Matching Affector.
Particle usage
It allows to import particles from Particle Universe (http://www.fxpression.com). The usage of particles is as follow,
Option 1, create 3D particle with particle (.pu) file and material file
Option 2, you can also create 3d particle with particle (.pu) file only, it will load all the material files in the material path
For more information, please refer to cpp-tests/Particle3DTest
A ParticleSystem can be used to create particle effects like fire or smoke.
The particle system has to be created using love.graphics.newParticleSystem. Just like any other Drawable it can be drawn to the screen using love.graphics.draw. You also have to update it in the update callback to see any changes in the particles emitted.
The particle system won't create any particles unless you call setParticleLifetime and setEmissionRate.
Constructors
love.graphics.newParticleSystem | Creates a new ParticleSystem. |
Functions
Object:release | Immediately destroys the object's Lua reference. | 11.0 | |
Object:type | Gets the type of the object as a string. | ||
Object:typeOf | Checks whether an object is of a certain type. | ||
ParticleSystem:clone | Creates an identical copy of the ParticleSystem in the stopped state. | 0.9.1 | |
ParticleSystem:count | Gets the amount of particles that are currently in the system. | 0.9.0 | |
ParticleSystem:emit | Emits a burst of particles from the particle emitter. | 0.9.0 | |
ParticleSystem:getAreaSpread | Gets the area-based spawn parameters for the particles. | 0.9.0 | 11.0 |
ParticleSystem:getBufferSize | Gets the maximum number of particles the ParticleSystem can have at once. | 0.9.0 | |
ParticleSystem:getColors | Gets the colors to apply to the particle sprite. | 0.9.0 | |
ParticleSystem:getCount | Gets the number of particles that are currently in the system. | 0.9.0 | |
ParticleSystem:getDirection | Gets the direction of the particle emitter (in radians). | ||
ParticleSystem:getEmissionArea | Gets the area-based spawn parameters for the particles. | 11.0 | |
ParticleSystem:getEmissionRate | Gets the amount of particles emitted per second. | 0.9.0 | |
ParticleSystem:getEmitterLifetime | Gets how long the particle system will emit particles | 0.9.0 | |
ParticleSystem:getImage | Gets the image used for the particles. | 0.9.0 | 0.10.0 |
ParticleSystem:getInsertMode | Gets the mode used when the ParticleSystem adds new particles. | 0.9.0 | |
ParticleSystem:getLinearAcceleration | Gets the linear acceleration (acceleration along the x and y axes) for particles. | 0.9.0 | |
ParticleSystem:getLinearDamping | Gets the amount of linear damping (constant deceleration) for particles. | 0.9.2 | |
ParticleSystem:getOffset | Gets the particle image's draw offset. | 0.9.0 | |
ParticleSystem:getOffsetX | Get the x coordinate of the particle rotation offset. | 0.9.0 | |
ParticleSystem:getOffsetY | Get the y coordinate of the particle rotation offset. | 0.9.0 | |
ParticleSystem:getParticleLifetime | Gets the lifetime of the particles. | 0.9.0 | |
ParticleSystem:getPosition | Gets the position of the emitter. | ||
ParticleSystem:getQuads | Gets a series of Quads used for the particle sprites. | 0.9.2 | |
ParticleSystem:getRadialAcceleration | Gets the radial acceleration (away from the emitter). | 0.9.0 | |
ParticleSystem:getRotation | Gets the rotation of the image upon particle creation (in radians). | 0.9.0 | |
ParticleSystem:getSizeVariation | Gets the amount of size variation. | 0.9.0 | |
ParticleSystem:getSizes | Gets the sizes of the particle over its lifetime. | 0.9.0 | |
ParticleSystem:getSpeed | Gets the speed of the particles. | 0.9.0 | |
ParticleSystem:getSpin | Gets the spin of the sprite. | 0.9.0 | |
ParticleSystem:getSpinVariation | Gets the amount of spin variation. | 0.9.0 | |
ParticleSystem:getSpread | Gets the amount of directional spread of the particle emitter (in radians). | ||
ParticleSystem:getTangentialAcceleration | Gets the tangential acceleration (acceleration perpendicular to the particle's direction). | 0.9.0 | |
ParticleSystem:getTexture | Gets the texture (Image or Canvas) used for the particles. | 0.9.1 | |
ParticleSystem:getX | Gets the x-coordinate of the particle emitter's position. | 0.9.0 | |
ParticleSystem:getY | Gets the y-coordinate of the particle emitter's position. | 0.9.0 | |
ParticleSystem:hasRelativeRotation | Gets whether particle angles and rotations are relative to their velocities. | 0.9.1 | |
ParticleSystem:isActive | Checks whether the particle system is actively emitting particles. | ||
ParticleSystem:isEmpty | Checks whether the particle system is empty of particles. | 0.9.0 | |
ParticleSystem:isFull | Checks whether the particle system is full of particles. | 0.9.0 | |
ParticleSystem:isPaused | Checks whether the particle system is paused. | 0.9.0 | |
ParticleSystem:isStopped | Checks whether the particle system is stopped. | 0.9.0 | |
ParticleSystem:moveTo | Moves the position of the emitter. | 0.9.1 | |
ParticleSystem:pause | Pauses the particle emitter. | ||
ParticleSystem:reset | Resets the particle emitter, removing existing particles and resetting the lifetime counter. | ||
ParticleSystem:setAreaSpread | Sets area-based spawn parameters for the particles. | 0.9.0 | 11.0 |
ParticleSystem:setBufferSize | Sets the size of the buffer (the max allowed amount of particles in the system). | ||
ParticleSystem:setColor | Sets the color of the image. | 0.8.0 | |
ParticleSystem:setColors | Sets the colors to apply to the particle sprite. | 0.8.0 | |
ParticleSystem:setDirection | Sets the direction the particles will be emitted in. | ||
ParticleSystem:setEmissionArea | Sets area-based spawn parameters for the particles. | 11.0 | |
ParticleSystem:setEmissionRate | Sets the amount of particles emitted per second. | ||
ParticleSystem:setEmitterLifetime | Sets how long the particle system should emit particles | 0.9.0 | |
ParticleSystem:setGravity | Sets the gravity affecting the particles (acceleration along the y-axis). | 0.9.0 | |
ParticleSystem:setImage | Sets the image to be used for the particles. | 0.9.0 | 0.10.0 |
ParticleSystem:setInsertMode | Sets the mode to use when the ParticleSystem adds new particles. | 0.9.0 | |
ParticleSystem:setLifetime | Sets how long the particle system should emit particles (if -1 then it emits particles forever). | 0.9.0 | |
ParticleSystem:setLinearAcceleration | Sets the linear acceleration (acceleration along the x and y axes) for particles. | 0.9.0 | |
ParticleSystem:setLinearDamping | Sets the amount of linear damping (constant deceleration) for particles. | 0.9.2 | |
ParticleSystem:setOffset | Set the offset position which the particle sprite is rotated around. | ||
ParticleSystem:setParticleLife | Sets the life of the particles. | 0.9.0 | |
ParticleSystem:setParticleLifetime | Sets the lifetime of the particles. | 0.9.0 | |
ParticleSystem:setPosition | Sets the position of the emitter. | ||
ParticleSystem:setQuads | Sets a series of Quads to use for the particle sprites. | 0.9.2 | |
ParticleSystem:setRadialAcceleration | Set the radial acceleration (away from the emitter). | ||
ParticleSystem:setRelativeRotation | Sets whether particle angles and rotations are relative to their velocities. | 0.9.1 | |
ParticleSystem:setRotation | Sets the rotation of the image upon particle creation (in radians). | ||
ParticleSystem:setSize | Sets the size of the particle (1.0 being normal size). | 0.8.0 | |
ParticleSystem:setSizeVariation | Sets the amount of size variation. | ||
ParticleSystem:setSizes | Sets the sizes of the particle over its lifetime. | 0.8.0 | |
ParticleSystem:setSpeed | Sets the speed of the particles. | ||
ParticleSystem:setSpin | Sets the spin of the sprite. | ||
ParticleSystem:setSpinVariation | Sets the amount of spin variation. | ||
ParticleSystem:setSpread | Sets the amount of spread for the system. | ||
ParticleSystem:setSprite | Sets the image which is to be emitted. | 0.9.0 | |
ParticleSystem:setTangentialAcceleration | Sets the tangential acceleration (acceleration perpendicular to the particle's direction). | ||
ParticleSystem:setTexture | Sets the texture (Image or Canvas) to be used for the particles. | 0.9.1 | |
ParticleSystem:start | Starts the particle emitter. | ||
ParticleSystem:stop | Stops the particle emitter, resetting the lifetime counter. | ||
ParticleSystem:update | Updates the particle system; moving, creating and killing particles. |
Enums
AreaSpreadDistribution | Types of particle area spread distribution. | 0.9.0 |
ParticleInsertMode | How newly created particles are added to the ParticleSystem. | 0.9.0 |
Supertypes
See Also
Particle editors:
Particles 2 4 2 – Create Professional Cocos2d Particle Emitters Download
Other Languages
Dansk –Deutsch –English – Español –Français –Indonesia –Italiano –Lietuviškai –Magyar –Nederlands –Polski –Português –Română –Slovenský –Suomi –Svenska –Türkçe –Česky –Ελληνικά –Български –Русский –Српски –Українська –עברית –ไทย –日本語 –正體中文 –简体中文 –Tiếng Việt –한국어
More info