natiny_particles_set_sort

C
void natiny_particles_set_sort(NatinyParticles particles, uint32_t sort);

Sets the order particles within one system are drawn in.

Parameters

Name Type Description
particles NatinyParticles Particle system handle from natiny_particles_create
sort uint32_t One of the sort constants below

Constants

Constant Value Draw order
NATINY_PARTICLES_SORT_NONE 0 Storage order, which changes as particles die - the default
NATINY_PARTICLES_SORT_BACK_TO_FRONT 1 Farthest from the camera first
NATINY_PARTICLES_SORT_OLDEST_FIRST 2 Oldest first, so the newest are drawn on top
NATINY_PARTICLES_SORT_NEWEST_FIRST 3 Newest first, so the oldest are drawn on top

Example

C
natiny_particles_set_sort(smoke, NATINY_PARTICLES_SORT_BACK_TO_FRONT);