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

    A Particle is a simple object owned and controlled by a Particle Emitter.

    It encapsulates all of the properties required to move and update according to the Emitters operations.

    Index

    Constructors

    Properties

    accelerationX: number

    The x acceleration of this Particle.

    accelerationY: number

    The y acceleration of this Particle.

    alpha: number

    The alpha value of this Particle.

    angle: number

    The angle of this Particle in degrees.

    The Animation State component of this Particle.

    This component provides features to apply animations to this Particle. It is responsible for playing, loading, queuing animations for later playback, mixing between animations and setting the current animation frame to this Particle.

    It is created only if the Particle's Emitter has at least one Animation.

    bounce: number

    The bounciness, or restitution, of this Particle.

    bounds: Geom.Rectangle

    A rectangle that holds the bounds of this Particle after a call to the Particle.getBounds method has been made.

    The data used by the ease equation.

    delayCurrent: number

    The delay applied to this Particle upon emission, in ms.

    The Emitter to which this Particle belongs.

    A Particle can only belong to a single Emitter and is created, updated and destroyed by it.

    frame: Frame

    The texture frame used by this Particle when it renders.

    holdCurrent: number

    The hold applied to this Particle before it expires, in ms.

    life: number

    The lifespan of this Particle in ms.

    lifeCurrent: number

    The current life of this Particle in ms.

    lifeT: number

    The normalized lifespan T value, where 0 is the start and 1 is the end.

    maxVelocityX: number

    The maximum horizontal velocity this Particle can travel at.

    maxVelocityY: number

    The maximum vertical velocity this Particle can travel at.

    rotation: number

    The angle of this Particle in radians.

    scaleX: number

    The horizontal scale of this Particle.

    scaleY: number

    The vertical scale of this Particle.

    scene: Scene

    A reference to the Scene to which this Game Object belongs.

    Game Objects can only belong to one Scene.

    You should consider this property as being read-only. You cannot move a Game Object to another Scene by simply changing it.

    texture: Textures.Texture

    The texture used by this Particle when it renders.

    tint: number

    The tint applied to this Particle.

    velocityX: number

    The x velocity of this Particle.

    velocityY: number

    The y velocity of this Particle.

    worldPosition: Math.Vector2

    The coordinates of this Particle in world space.

    Updated as part of computeVelocity.

    x: number

    The x coordinate of this Particle.

    y: number

    The y coordinate of this Particle.

    Methods

    • An internal method that calculates the velocity of the Particle and its world position. It also runs it against any active Processors that are set on the Emitter.

      Parameters

      • emitter: ParticleEmitter

        The Emitter that is updating this Particle.

      • delta: number

        The delta time in ms.

      • step: number

        The delta value divided by 1000.

      • processors: ParticleProcessor[]

        An array of all active Particle Processors.

      • t: number

        The current normalized lifetime of the particle, between 0 (birth) and 1 (death).

      Returns void

    • The Event Emitter proxy.

      Passes on all parameters to the ParticleEmitter to emit directly.

      Parameters

      • event: string | Symbol

        The event name.

      • Optionala1: any

        Optional argument 1.

      • Optionala2: any

        Optional argument 2.

      • Optionala3: any

        Optional argument 3.

      • Optionala4: any

        Optional argument 4.

      • Optionala5: any

        Optional argument 5.

      Returns boolean

    • Starts this Particle from the given coordinates.

      Parameters

      • Optionalx: number

        The x coordinate to launch this Particle from.

      • Optionaly: number

        The y coordinate to launch this Particle from.

      Returns boolean

    • Gets the bounds of this particle as a Geometry Rectangle, factoring in any transforms of the parent emitter and anything else above it in the display list.

      Once calculated the bounds can be accessed via the Particle.bounds property.

      Parameters

      • Optionalmatrix: TransformMatrix

        Optional transform matrix to apply to this particle.

      Returns Geom.Rectangle

    • Checks to see if this Particle is alive and updating.

      Returns boolean

    • Kills this particle. This sets the lifeCurrent value to 0, which forces the Particle to be removed the next time its parent Emitter runs an update.

      Returns void

    • Sets the position of this particle to the given x/y coordinates.

      If the parameters are left undefined, it resets the particle back to 0x0.

      Parameters

      • Optionalx: number

        The x coordinate to set this Particle to. Default 0.

      • Optionaly: number

        The y coordinate to set this Particle to. Default 0.

      Returns void

    • This is a NOOP method and does nothing when called.

      Returns void

    • The main update method for this Particle.

      Updates its life values, computes the velocity and repositions the Particle.

      Parameters

      • delta: number

        The delta time in ms.

      • step: number

        The delta value divided by 1000.

      • processors: ParticleProcessor[]

        An array of all active Particle Processors.

      Returns boolean