natiny.particles.set_sort

Lua
natiny.particles.set_sort(particles, sort)

Sets the order particles within one system are drawn in.

Parameters

Name Type Description
particles number Particle system handle from natiny.particles.create
sort integer One of the sort constants below

Constants

Constant Draw order
natiny.particles.SORT_NONE Storage order, which changes as particles die - the default
natiny.particles.SORT_BACK_TO_FRONT Farthest from the camera first
natiny.particles.SORT_OLDEST_FIRST Oldest first, so the newest are drawn on top
natiny.particles.SORT_NEWEST_FIRST Newest first, so the oldest are drawn on top

Example

Lua
natiny.particles.set_sort(smoke, natiny.particles.SORT_BACK_TO_FRONT)