Type Function Object ParticleSystem Library physics.* Return value none Revision Release 2024.3703 Keywords createGroup, physics, LiquidFun See also physics.newParticleSystem() object:destroyParticles() object:createParticle() particleCollision
This function is used to create multiple particles simultaneously by filling a region.
ParticleSystem:createGroup( params )
Table. A table that specifies the particle group properties (flags) — see the next section for valid entries.
When implementing particle collisions via the particleCollision event, you must set the "fixtureContactListener"
flag for the particle group. 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"
String or Table. One of the following strings or a table containing a
"solid"
"rigid"
"canBeEmpty"
"willBeDestroyed"
"needsUpdateDepth"
"internalMask"
Number. The starting x position of the generated group, in content space.
Number. The starting y position of the generated group, in content space.
Number. The starting angle (rotation) of the generated group.
Number. The x velocity of the generated group.
Number. The y velocity of the generated group.
Number. The angular velocity of the generated group.
Table. Table of RGB+A color settings for the particles in the group.
color = { 0, 0.3, 1, 1 }
Number. The cohesion of a group of particles in the range of 0.0
(least cohesive) to 1.0
(most cohesive). Default value is 1.0
.
Number. The interval of particles in the group.
Number. Lifetime of the generated group, in seconds.
Number. Half the width of the desired rectangular particle group.
Number. Half the height of the desired rectangular particle group.
Number. Radius of the desired circular particle group.
Array. Array of up to eight x and y coordinates to generate an arbitrary convex shape group.
Table. Shape table returned by graphics.newOutline().
ParticleSystem:createGroup( { flags = { "water", "colorMixing" }, x = 0, y = 0, color = { 0, 0, 1, 1 }, halfWidth = 64, halfHeight = 32 } )
ParticleSystem:createGroup( { flags = "elastic", x = 0, y = 0, color = { 1, 0, 1, 1 }, radius = 32 } )
ParticleSystem:createGroup( { flags = { "elastic", "colorMixing" }, x = 0, y = 0, color = { 0, 1, 0, 1 }, shape = { 0,0, 64,64, 0,64 } } )
local imageOutline = graphics.newOutline( 2, "outline.png" ) ParticleSystem:createGroup( { flags = "water", x = 0, y = 0, color = { 1, 1, 0, 1 }, outline = imageOutline } )