API Docs for: 2.2.1
Show:

Particle Class

Constructor

Particle

(
  • emitter
)

Parameters:

  • emitter Emitter

    The emitter that controls this particle.

Methods

applyArt

(
  • art
)

Sets the texture for the particle. This can be overridden to allow for an animated particle.

Parameters:

  • art pixi.textures.Texture

    The texture to set.

destroy

()

Destroys the particle, removing references and preventing future use.

init

()

Initializes the particle for use, based on the properties that have to have been set already on the particle.

kill

()

Kills the particle, removing it from the display list and telling the emitter to recycle it.

update

(
  • delta
)
Float

Updates the particle.

Parameters:

  • delta Float

    Time elapsed since the previous frame, in seconds.

Returns:

Float:

The standard interpolation multiplier (0-1) used for all relevant particle properties. A value of -1 means the particle died of old age instead.

Properties

acceleration

pixi.geom.Point

Acceleration to apply to the particle.

age

Float

The current age of the particle, in seconds.

ease

Void->Void

A simple easing function to be applied to all properties that are being interpolated.

emitter

Emitter

The emitter that controls this particle.

endAlpha

Float

The alpha of the particle at the end of its life.

endScale

Float

The scale of the particle at the start of its life.

endSpeed

Number

The speed of the particle at the end of its life.

extraData

Dynamic

Extra data that the emitter passes along for custom particles.

maxLife

Float

The maximum lifetime of this particle, in seconds.

startAlpha

Float

The alpha of the particle at the start of its life.

startColor

Array

The tint of the particle at the start of its life.

startScale

Float

The scale of the particle at the start of its life.

startSpeed

Float

The speed of the particle at the start of its life.

velocity

pixi.geom.Point

The velocity of the particle. Speed may change, but the angle also contained in velocity is constant.