Skip to main content

Particle

The particle interface

Functions

spray

Particle.spray(
xnumber,--

horizontal coordinate

ynumber,--

vertical coordinate

optionstable--

settings

) → ()

Sprays particles at a position into a direction

Options

Name Type Default Description
amount number 0 amount to spawn
color table white start color
color_fade table - end color
alpha number 1 start transparency
alpha_fade number - end transparency
speed number 8 speed of movement
speed_dist number 0 variance in speed
ttl number 1 time to live
ttl_dist number 0 variance in time to live
collision bool true world collision
overwrite bool false special render setting
overlay bool false foreground particles
angle number 0 spray angle in [0, 1]
angle_dist number 0 variance in spray angle
x_dist number 0 horizontal variance
y_dist number 0 vertical variance

circle

Particle.circle(
xnumber,--

horizontal coordinate

ynumber,--

vertical coordinate

optionstable--

settings

) → ()

Creates particles in a circle at a position moving outside

Options

Name Type Default Description
amount number 0 amount to spawn
radius number 8 circle radius
color table white start color
color_fade table - end color
alpha number 1 start transparency
alpha_fade number - end transparency
speed number 8 speed of movement
speed_dist number 0 variance in speed
ttl number 1 time to live
ttl_dist number 0 variance in time to live
collision bool true world collision
overwrite bool false special render setting
overlay bool false foreground particles
x_dist number 0 horizontal variance
y_dist number 0 vertical variance
Show raw api
{
    "functions": [
        {
            "name": "spray",
            "desc": "Sprays particles at a position into a direction\n\n### Options\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| amount          | number      |       0 | amount to spawn                |\n| color           | table       |   white | start color                    |\n| color_fade      | table       |       - | end color                      |\n| alpha           | number      |       1 | start transparency             |\n| alpha_fade      | number      |       - | end transparency               |\n| speed           | number      |       8 | speed of movement              |\n| speed_dist      | number      |       0 | variance in speed              |\n| ttl             | number      |       1 | time to live                   |\n| ttl_dist        | number      |       0 | variance in time to live       |\n| collision       | bool        |    true | world collision                |\n| overwrite       | bool        |   false | special render setting         |\n| overlay         | bool        |   false | foreground particles           |\n| angle           | number      |       0 | spray angle in [0, 1]          |\n| angle_dist      | number      |       0 | variance in spray angle        |\n| x_dist          | number      |       0 | horizontal variance            |\n| y_dist          | number      |       0 | vertical variance              |",
            "params": [
                {
                    "name": "x",
                    "desc": "horizontal coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "y",
                    "desc": "vertical coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 34,
                "path": "../../res/data/script/lib/system/particle.lua"
            }
        },
        {
            "name": "circle",
            "desc": "Creates particles in a circle at a position moving outside\n\n### Options\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| amount          | number      |       0 | amount to spawn                |\n| radius          | number      |       8 | circle radius                  |\n| color           | table       |   white | start color                    |\n| color_fade      | table       |       - | end color                      |\n| alpha           | number      |       1 | start transparency             |\n| alpha_fade      | number      |       - | end transparency               |\n| speed           | number      |       8 | speed of movement              |\n| speed_dist      | number      |       0 | variance in speed              |\n| ttl             | number      |       1 | time to live                   |\n| ttl_dist        | number      |       0 | variance in time to live       |\n| collision       | bool        |    true | world collision                |\n| overwrite       | bool        |   false | special render setting         |\n| overlay         | bool        |   false | foreground particles           |\n| x_dist          | number      |       0 | horizontal variance            |\n| y_dist          | number      |       0 | vertical variance              |",
            "params": [
                {
                    "name": "x",
                    "desc": "horizontal coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "y",
                    "desc": "vertical coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 63,
                "path": "../../res/data/script/lib/system/particle.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Particle",
    "desc": "The particle interface",
    "source": {
        "line": 5,
        "path": "../../res/data/script/lib/system/particle.lua"
    }
}