The container to add the particles to.
A configuration object containing settings for the emitter.
The particles that are active and on the display list. This is the first particle in a linked list.
The particles that are active and on the display list. This is the last particle in a linked list.
If the update function is called automatically from the shared ticker. Setting this to false requires calling the update function manually.
A callback for when all particles have died out. This is set by playOnceAndDestroy() or playOnce();
If the emitter should destroy itself when all particles have died out. This is set by playOnceAndDestroy();
If particles should be emitted during update() calls. Setting this to false stops new particles from being created, but allows existing ones to die out.
The life of the emitter in seconds.
Time between particle spawns in seconds.
The original config object that this emitter was initialized with.
The container to add particles to.
The particles that are not currently being used. This is the first particle in a linked list.
If either ownerPos or spawnPos has changed since the previous update.
The origin + spawnPos in the previous update, so that the spawn position can be interpolated to space out particles better.
If _prevEmitterPos is valid, to prevent interpolation on the first update
The timer for when to spawn particles in seconds, where numbers less than 0 mean that particles should be spawned.
If particles should be added at the back of the display list instead of the front.
An easing function for nonlinear interpolation of values. Accepts a single parameter of time as a value from 0-1, inclusive. Expected outputs are values from 0-1, inclusive.
The amount of time in seconds to emit for before setting emit to false. A value of -1 is an unlimited amount of time.
Active initialization behaviors for this emitter.
The maximum lifetime for a particle, in seconds.
Maximum number of particles to keep alive at a time. If this limit is reached, no more particles will spawn until some have died.
The minimum lifetime for a particle, in seconds.
The world position of the emitter's owner, to add spawnPos to when spawning particles. To change this, use updateOwnerPos().
The current number of active particles.
Number of particles to spawn time that the frequency allows for particles to spawn.
Active recycle behaviors for this emitter.
Rotation of the emitter or emitter's owner in degrees. This is added to the calculated spawn angle. To change this, use rotate().
Chance that a particle will be spawned on each opportunity to spawn one. 0 is 0%, 1 is 100%.
Position at which to spawn particles, relative to the emitter's owner's origin. For example, the flames of a rocket travelling right might have a spawnPos of {x:-50, y:0}. to spawn at the rear of the rocket. To change this, use updateSpawnPos().
Active update behaviors for this emitter.
If the update function is called automatically from the shared ticker. Setting this to false requires calling the update function manually.
If the update function is called automatically from the shared ticker. Setting this to false requires calling the update function manually.
If this emitter has been destroyed. Note that a destroyed emitter can still be reused, after having a new parent set and being reinitialized.
If particles should be emitted during update() calls. Setting this to false stops new particles from being created, but allows existing ones to die out.
If particles should be emitted during update() calls. Setting this to false stops new particles from being created, but allows existing ones to die out.
Time between particle spawns in seconds. If this value is not a number greater than 0, it will be set to 1 (particle per second) to prevent infinite loops.
Time between particle spawns in seconds. If this value is not a number greater than 0, it will be set to 1 (particle per second) to prevent infinite loops.
The container to add particles to. Settings this will dump any active particles.
The container to add particles to. Settings this will dump any active particles.
Kills all active particles immediately.
Destroys the emitter and all of its particles.
Emits a single wave of particles, using standard spawnChance & particlesPerWave settings. Does not affect regular spawning through the frequency, and ignores the emit property. The max particle count is respected, however, so if there are already too many particles then nothing will happen.
Fills the pool with the specified number of particles, so that they don't have to be instantiated later.
The number of particles to create.
Gets the instantiated behavior of the specified type, if it is present on this emitter.
The behavior type to find.
Sets up the emitter based on the config settings.
A configuration object containing settings for the emitter.
Starts emitting particles and optionally calls a callback when particle emission is complete.
Callback for when emission is complete (all particles have died off)
Starts emitting particles, sets autoUpdate to true, and sets up the Emitter to destroy itself when particle emission is complete.
Callback for when emission is complete (all particles have died off)
Recycles an individual particle. For internal use only.
The particle to recycle.
If this is being called to manually clean up all particles.
Prevents emitter position interpolation in the next update. This should be used if you made a major position change of your emitter's owner that was not normal movement.
Sets the rotation of the emitter to a new value. This rotates the spawn position in addition to particle direction.
The new rotation, in degrees.
Updates all particles spawned by this emitter and emits new ones.
Time elapsed since the previous frame, in seconds.
Changes the position of the emitter's owner. You should call this if you are adding particles to the world container that your emitter's owner is moving around in.
The new x value of the emitter's owner.
The new y value of the emitter's owner.
Changes the spawn position of the emitter.
The new x value of the spawn position for the emitter.
The new y value of the spawn position for the emitter.
Registers a new behavior, so that it will be recognized when initializing emitters. Behaviors registered later with duplicate types will override older ones, although there is no limit on the allowed types.
The behavior class to register.
Generated using TypeDoc
A particle emitter.