Phaser API Documentation

  Version: 
stopAfter: number

Description:

If set, either via the Emitter config, or by directly setting this property, the Particle Emitter will stop emitting particles once this total has been reached. It will then enter a 'stopped' state, firing the STOP event. Note that entering a stopped state doesn't mean all the particles have finished, just that it's not emitting any further ones.

To know when the final particle expires, listen for the COMPLETE event.

Use this if you wish to launch an exact number of particles and then stop your emitter afterwards.

The counter is reset each time the ParticleEmitter.start method is called.

0 means the emitter will not stop based on total emitted particles.

Type:
number
Default: 0
Since: 3.60.0