Phaser API Documentation

  Version: 
Filter

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.

Constructor:

new ParticleProcessor([x], [y], [active])

Parameters:

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.

Since: 3.60.0

Members

active: boolean
Focus
Focus

Description:

The active state of the Particle Processor.

An inactive Particle Processor will be skipped for processing by its parent Emitter.

Type:
boolean
Since: 3.60.0
Focus
Focus

Description:

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.

Type:
Since: 3.60.0
Focus
Focus
x: number
Focus
Focus

Description:

The x coordinate of the Particle Processor, in world space.

Type:
number
Since: 3.60.0
Focus
Focus
y: number
Focus
Focus

Description:

The y coordinate of the Particle Processor, in world space.

Type:
number
Since: 3.60.0
Focus
Focus

Methods

destroy()
Focus
Focus

Description:

Destroys this Particle Processor by removing all external references.

This is called automatically when the owning Particle Emitter is destroyed.

Since: 3.60.0
Focus
Focus
update(particle, delta, step, t)
Focus
Focus

Description:

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.

Parameters:

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).

Since: 3.60.0
Focus
Focus