This class provides the structured required for all Particle Processors.
You should extend it and add the functionality required for your processor,
including tidying up any resources this may create in the destroy
method.
See the GravityWell for an example of a processor.
new ParticleProcessor([x], [y], [active])
name | type | arguments | Default | description |
---|---|---|---|---|
x | number | <optional> | 0 |
The x coordinate of the Particle Processor, in world space. |
y | number | <optional> | 0 |
The y coordinate of the Particle Processor, in world space. |
active | boolean | <optional> | true |
The active state of this Particle Processor. |
The active state of the Particle Processor.
An inactive Particle Processor will be skipped for processing by its parent Emitter.
A reference to the Particle Emitter that owns this Processor. This is set automatically when the Processor is added to an Emitter and nulled when removed or destroyed.
The x coordinate of the Particle Processor, in world space.
The y coordinate of the Particle Processor, in world space.
Destroys this Particle Processor by removing all external references.
This is called automatically when the owning Particle Emitter is destroyed.
The Particle Processor update method should be overriden by your own method and handle the processing of the particles, typically modifying their velocityX/Y values based on the criteria of this processor.
name | type | description |
---|---|---|
particle | Phaser.GameObjects.Particles.Particle |
The Particle to update. |
delta | number |
The delta time in ms. |
step | number |
The delta value divided by 1000. |
t | number |
The current normalized lifetime of the particle, between 0 (birth) and 1 (death). |