phaser - v4.0.0-rc.4
    Preparing search index...

    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.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Parameters

      • Optionalx: number

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

      • Optionaly: number

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

      • Optionalactive: boolean

        The active state of this Particle Processor. Default true.

      Returns ParticleProcessor

    Properties

    active: boolean

    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.

    x: number

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

    y: number

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

    Methods

    • Destroys this Particle Processor by removing all external references.

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

      Returns void

    • 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

      • particle: 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).

      Returns void