natiny.particles.set_material

Lua
natiny.particles.set_material(particles [, material])

Sets the material the particles are drawn with. The material must be instanced.

Parameters

Name Type Default Description
particles number Particle system handle from natiny.particles.create
material number nil Instanced material; nil or 0 returns to the default material

Example

Lua
local material = natiny.material.create(glow_shader)
natiny.material.set_instanced(material, true)
natiny.material.add_tag(material, "fx")
natiny.particles.set_material(sparks, material)