Sets a callback to be used to sort the particles before rendering each frame.
This allows you to define your own logic and behavior in the callback.
The callback will be sent two parameters: the two Particles being compared,
and must adhere to the criteria of the compareFn
in Array.sort
:
Call this method with no parameters to reset the sort callback.
Setting your own callback will override both the particleBringToTop
and
sortProperty
settings of this Emitter.
name | type | arguments | description |
---|---|---|---|
callback | Phaser.Types.GameObjects.Particles.ParticleSortCallback | <optional> |
The callback to invoke when the particles are sorted. Leave undefined to reset to the default. |
This Particle Emitter.