Type Function Object ParticleSystem Library physics.* Return value none Revision Release 2024.3703 Keywords createParticle, physics, LiquidFun See also physics.newParticleSystem() object:destroyParticles() object:createGroup() particleCollision
This function is used to create a single particle in a ParticleSystem.
ParticleSystem:createParticle( params )
Table. A table that specifies the particle properties (flags) — see the next section for valid entries.
When implementing particle collisions via the particleCollision event, you must set the "fixtureContactListener"
flag for each particle. If this flag is omitted, you will not receive particle collision responses.
To learn more about the parameters available for particles, please refer to the LiquidFun Programmer’s Guide.
String or Table. One of the following strings or a table containing a
"water"
"zombie"
"wall"
"spring"
"elastic"
"viscous"
"powder"
"tensile"
"colorMixing"
"destructionListener"
"barrier"
"staticPressure"
"reactive"
"repulsive"
"fixtureContactListener"
"fixtureContactFilter"
"particleContactFilter"
Number. The starting x position of the generated particles, in content space.
Number. The starting y position of the generated particles, in content space.
Number. The x velocity of the generated particles.
Number. The y velocity of the generated particles.
Table. Table of RGB+A color settings for the generated particles.
color = { 0, 0.3, 1, 1 }
Number. Lifetime of the generated particles, in seconds.
ParticleSystem:createParticle( { flags = { "water", "colorMixing" }, x = 0, y = 0, velocityX = 256, velocityY = 480, color = { 0, 0, 1, 1 }, lifetime = 32.0 } )