Phaser API Documentation

  Version: 
setSortProperty([property], [ascending])

Description:

Set the property by which active particles are sorted prior to be rendered.

It allows you to control the rendering order of the particles.

This can be any valid property of the Particle class, such as y, alpha or lifeT.

The 'alive' particles array is sorted in place each game frame. Setting a sort property will override the particleBringToTop setting.

If you wish to use your own sorting function, see setSortCallback instead.

Parameters:

name type arguments Default description
property string <optional>

The property on the Particle class to sort by.

ascending boolean <optional> true

Should the particles be sorted in ascending or descending order?

Returns:
Description:

This Particle Emitter.

Since: 3.60.0