Namespace: Particles

Phaser.Types.GameObjects. Particles

Type Definitions


DeathZoneSource

Type:
  • object
Properties:
Name Type Description
contains Phaser.Types.GameObjects.Particles.DeathZoneSourceCallback
Since: 3.0.0
Source: src/gameobjects/particles/typedefs/DeathZoneSource.js (Line 1)
See:

DeathZoneSourceCallback(x, y)

Parameters:
Name Type Description
x number

The x coordinate of the particle to check against this source area.

y number

The y coordinate of the particle to check against this source area.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/DeathZoneSourceCallback.js (Line 1)
Returns:
  • True if the coordinates are within the source area.
Type
boolean

EdgeZoneSource

Type:
  • object
Properties:
Name Type Description
getPoints Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback

A function placing points on the sources edge or edges.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/EdgeZoneSource.js (Line 1)
See:

EdgeZoneSourceCallback(quantity [, stepRate])

Parameters:
Name Type Argument Description
quantity integer

The number of particles to place on the source edge. If 0, stepRate should be used instead.

stepRate number <optional>

The distance between each particle. When set, quantity is implied and should be set to 0.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/EdgeZoneSourceCallback.js (Line 1)
Returns:
  • The points placed on the source edge.
Type
Array.<Phaser.Geom.Point>

EmitterOpCustomEmitConfig

Type:
  • object
Properties:
Name Type Description
onEmit Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback

A callback that is invoked each time the emitter emits a particle.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/EmitterOpCustomEmitConfig.js (Line 1)

EmitterOpCustomUpdateConfig

Type:
  • object
Properties:
Name Type Argument Description
onEmit Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback <optional>

A callback that is invoked each time the emitter emits a particle.

onUpdate Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateCallback

A callback that is invoked each time the emitter updates.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/EmitterOpCustomUpdateConfig.js (Line 1)

EmitterOpEaseConfig

Defines an operation yielding a value incremented continuously across a range.

Type:
  • object
Properties:
Name Type Argument Default Description
start number

The starting value.

end number

The ending value.

ease string <optional>
'Linear'

The name of the easing function.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/EmitterOpEaseConfig.js (Line 1)

EmitterOpOnEmitCallback(particle, key, value)

The returned value sets what the property will be at the START of the particle's life, on emit.

Parameters:
Name Type Description
particle Phaser.GameObjects.Particles.Particle

The particle.

key string

The name of the property.

value number

The current value of the property.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/EmitterOpOnEmitCallback.js (Line 1)
Returns:

The new value of the property.

Type
number

EmitterOpOnEmitType

Type:
Since: 3.18.0
Source: src/gameobjects/particles/typedefs/EmitterOpOnEmitType.js (Line 1)

EmitterOpOnUpdateCallback(particle, key, t, value)

The returned value updates the property for the duration of the particle's life.

Parameters:
Name Type Description
particle Phaser.GameObjects.Particles.Particle

The particle.

key string

The name of the property.

t number

The normalized lifetime of the particle, between 0 (start) and 1 (end).

value number

The current value of the property.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/EmitterOpOnUpdateCallback.js (Line 1)
Returns:

The new value of the property.

Type
number

EmitterOpOnUpdateType

Type:
Since: 3.18.0
Source: src/gameobjects/particles/typedefs/EmitterOpOnUpdateType.js (Line 1)

EmitterOpRandomConfig

Defines an operation yielding a random value within a range.

Type:
  • object
Properties:
Name Type Description
random Array.<number>

The minimum and maximum values, as [min, max].

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/EmitterOpRandomConfig.js (Line 1)

EmitterOpRandomMinMaxConfig

Defines an operation yielding a random value within a range.

Type:
  • object
Properties:
Name Type Description
min number

The minimum value.

max number

The maximum value.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/EmitterOpRandomMinMaxConfig.js (Line 1)

EmitterOpRandomStartEndConfig

Defines an operation yielding a random value within a range.

Type:
  • object
Properties:
Name Type Description
start number

The starting value.

end number

The ending value.

random boolean

If false, this becomes EmitterOpEaseConfig.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/EmitterOpRandomStartEndConfig.js (Line 1)

EmitterOpSteppedConfig

Defines an operation yielding a value incremented by steps across a range.

Type:
  • object
Properties:
Name Type Description
start number

The starting value.

end number

The ending value.

steps number

The number of steps between start and end.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/EmitterOpSteppedConfig.js (Line 1)

GravityWellConfig

Type:
  • object
Properties:
Name Type Argument Default Description
x number <optional>
0

The x coordinate of the Gravity Well, in world space.

y number <optional>
0

The y coordinate of the Gravity Well, in world space.

power number <optional>
0

The strength of the gravity force - larger numbers produce a stronger force.

epsilon number <optional>
100

The minimum distance for which the gravity force is calculated.

gravity number <optional>
50

The gravitational force of this Gravity Well.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/GravityWellConfig.js (Line 1)

ParticleDeathCallback(particle)

Parameters:
Name Type Description
particle Phaser.GameObjects.Particles.Particle

The particle that died.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/ParticleDeathCallback.js (Line 1)

ParticleEmitterBounds

Type:
  • object
Properties:
Name Type Description
x number

The left edge of the rectangle.

y number

The top edge of the rectangle.

width number

The width of the rectangle.

height number

The height of the rectangle.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/ParticleEmitterBounds.js (Line 1)
See:

ParticleEmitterBoundsAlt

Type:
  • object
Properties:
Name Type Description
x number

The left edge of the rectangle.

y number

The top edge of the rectangle.

w number

The width of the rectangle.

h number

The height of the rectangle.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/ParticleEmitterBoundsAlt.js (Line 1)
See:

ParticleEmitterCallback(particle, emitter)

Parameters:
Name Type Description
particle Phaser.GameObjects.Particles.Particle

The particle associated with the call.

emitter Phaser.GameObjects.Particles.ParticleEmitter

This particle emitter associated with the call.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/ParticleEmitterCallback.js (Line 1)

ParticleEmitterConfig

Type:
  • object
Properties:
Name Type Argument Description
active boolean <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#active.

blendMode Phaser.BlendModes | string <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#blendMode.

callbackScope * <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#deathCallbackScope and Phaser.GameObjects.Particles.ParticleEmitter#emitCallbackScope.

collideBottom boolean <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#collideBottom.

collideLeft boolean <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#collideLeft.

collideRight boolean <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#collideRight.

collideTop boolean <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#collideTop.

deathCallback boolean <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#deathCallback.

deathCallbackScope * <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#deathCallbackScope.

emitCallback function <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#emitCallback.

emitCallbackScope * <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#emitCallbackScope.

follow Phaser.GameObjects.GameObject <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#follow.

frequency number <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#frequency.

gravityX number <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#gravityX.

gravityY number <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#gravityY.

maxParticles integer <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#maxParticles.

name string <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#name.

on boolean <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#on.

particleBringToTop boolean <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#particleBringToTop.

particleClass Phaser.GameObjects.Particles.Particle <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#particleClass.

radial boolean <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#radial.

timeScale number <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#timeScale.

trackVisible boolean <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#trackVisible.

visible boolean <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#visible.

accelerationX Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#accelerationX (emit only).

accelerationY Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#accelerationY (emit only).

alpha Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#alpha.

angle Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#angle (emit only).

bounce Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#bounce (emit only).

delay Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#delay (emit only).

lifespan Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#lifespan (emit only).

maxVelocityX Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#maxVelocityX (emit only).

maxVelocityY Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#maxVelocityY (emit only).

moveToX Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#moveToX (emit only).

moveToY Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#moveToY (emit only).

quantity Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#quantity (emit only).

rotate Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#rotate.

scale Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType <optional>

As Phaser.GameObjects.Particles.ParticleEmitter#setScale.

scaleX Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#scaleX.

scaleY Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#scaleY.

speed Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

As Phaser.GameObjects.Particles.ParticleEmitter#setSpeed (emit only).

speedX Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#speedX (emit only).

speedY Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#speedY (emit only).

tint Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#tint.

x Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#x (emit only).

y Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#y (emit only).

emitZone object <optional>

As Phaser.GameObjects.Particles.ParticleEmitter#setEmitZone.

bounds Phaser.Types.GameObjects.Particles.ParticleEmitterBounds | Phaser.Types.GameObjects.Particles.ParticleEmitterBoundsAlt <optional>

As Phaser.GameObjects.Particles.ParticleEmitter#setBounds.

followOffset object <optional>

Assigns to Phaser.GameObjects.Particles.ParticleEmitter#followOffset.

Properties
Name Type Argument Description
x number <optional>

x-coordinate of the offset.

y number <optional>

y-coordinate of the offset.

frame number | Array.<number> | string | Array.<string> | Phaser.Textures.Frame | Array.<Phaser.Textures.Frame> | Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig <optional>

Sets Phaser.GameObjects.Particles.ParticleEmitter#frames.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/ParticleEmitterConfig.js (Line 1)

ParticleEmitterDeathZoneConfig

Type:
  • object
Properties:
Name Type Argument Default Description
source Phaser.Types.GameObjects.Particles.DeathZoneSource

A shape representing the zone. See Phaser.GameObjects.Particles.Zones.DeathZone#source.

type string <optional>
'onEnter'

'onEnter' or 'onLeave'.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/ParticleEmitterDeathZoneConfig.js (Line 1)

ParticleEmitterEdgeZoneConfig

Type:
  • object
Properties:
Name Type Argument Default Description
source Phaser.Types.GameObjects.Particles.EdgeZoneSource

A shape representing the zone. See Phaser.GameObjects.Particles.Zones.EdgeZone#source.

type string

'edge'.

quantity integer

The number of particles to place on the source edge. Set to 0 to use stepRate instead.

stepRate number <optional>

The distance between each particle. When set, quantity is implied and should be set to 0.

yoyo boolean <optional>
false

Whether particles are placed from start to end and then end to start.

seamless boolean <optional>
true

Whether one endpoint will be removed if it's identical to the other.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/ParticleEmitterEdgeZoneConfig.js (Line 1)

ParticleEmitterFrameConfig

Type:
  • object
Properties:
Name Type Argument Description
frames number | Array.<number> | string | Array.<string> | Phaser.Textures.Frame | Array.<Phaser.Textures.Frame> <optional>

One or more texture frames.

cycle boolean <optional>

Whether texture frames will be assigned consecutively (true) or at random (false).

quantity integer <optional>

The number of consecutive particles receiving each texture frame, when cycle is true.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/ParticleEmitterFrameConfig.js (Line 1)

ParticleEmitterRandomZoneConfig

Type:
  • object
Properties:
Name Type Argument Description
source Phaser.Types.GameObjects.Particles.RandomZoneSource

A shape representing the zone. See Phaser.GameObjects.Particles.Zones.RandomZone#source.

type string <optional>

'random'.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/ParticleEmitterRandomZoneConfig.js (Line 1)

RandomZoneSource

Type:
  • object
Properties:
Name Type Description
getRandomPoint Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback

A function modifying its point argument.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/RandomZoneSource.js (Line 1)
See:

RandomZoneSourceCallback(point)

Parameters:
Name Type Description
point Phaser.Math.Vector2

A point to modify.

Since: 3.0.0
Source: src/gameobjects/particles/typedefs/RandomZoneSourceCallback.js (Line 1)