Skip to main content

particles

render · 9 properties · Rendering

A purely visual 2D emitter at the node: rate, lifetime, speed, cone and gravity. The live particles and the randomness scattering them are backend state the simulation never sees.

In a scene, particles is the node key that applies it. A script reaches the same properties through node.particles.get() and node.particles.set(table).

Properties

propertytypedefaultdescription
anglefloat90Emission direction in degrees; 90 is straight up
colorcolor[0.8,0.8,0.8,1]Tint, as channel floats or #rrggbb / #rrggbbaa
emittingbooltrueWhether new particles are born; live ones finish either way
gravityvec2[0,-3]Acceleration applied over a particle's life
lifetimefloat1Seconds a particle lives At least 0.05.
ratefloat20Particles born per second At least 0.
sizefloat4Particle size in logical pixels At least 0.5.
speedfloat2Initial speed in world units per second At least 0.
spreadfloat30Half-angle of the emission cone in degrees At least 0.

Script functions

Methods of node.particles, the handle a node carrying this component exposes. Each is also a free function on its module, taking the node as its first argument. Every handle also has get(), set(table), has() and remove().

From render:

methodwhat it does
set_color(float, float, float, float?)Tint whatever the node draws, as r, g, b channel floats and an optional alpha, one meaning opaque.