natiny.particles.set_shape
Lua
natiny.particles.set_shape(particles, shape [, x [, y [, z]]])
Sets where particles are born and which way they start moving, in the emitter's own space.
Parameters
| Name |
Type |
Default |
Description |
particles |
number |
|
Particle system handle from natiny.particles.create |
shape |
integer |
|
One of the shape constants below |
x |
number |
0 |
First size; meaning depends on the shape |
y |
number |
x |
Second size |
z |
number |
y |
Third size |
Constants
| Constant |
x, y, z |
Particles start |
natiny.particles.SHAPE_POINT |
unused |
At the emitter, heading within spread of +Y |
natiny.particles.SHAPE_SPHERE |
x radius |
Inside a sphere, heading straight out |
natiny.particles.SHAPE_SHELL |
x radius |
On the surface of a sphere, heading straight out |
natiny.particles.SHAPE_HEMISPHERE |
x radius |
Inside the upper half of a sphere, heading out |
natiny.particles.SHAPE_CONE |
x angle in degrees, y base radius |
On a disc in the XZ plane, heading within x degrees of +Y |
natiny.particles.SHAPE_BOX |
full width, height, depth |
Inside a box, heading within spread of +Y |
natiny.particles.SHAPE_CIRCLE |
x radius |
Inside a disc in the XY plane, heading straight out |
natiny.particles.SHAPE_EDGE |
x length |
On a line along X, heading within spread of +Y |
Example
Lua
natiny.particles.set_shape(snow, natiny.particles.SHAPE_BOX, 20, 0.1, 20)