Type Definitions
-
DeathZoneSource
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/DeathZoneSource.js (Line 1)
- See:
Properties:
Name Type Description contains
Phaser.Types.GameObjects.Particles.DeathZoneSourceCallback -
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
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/EdgeZoneSource.js (Line 1)
- See:
Properties:
Name Type Description getPoints
Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback A function placing points on the sources edge or edges.
-
EdgeZoneSourceCallback(quantity [, stepRate])
-
Parameters:
Name Type Argument Description quantity
number 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 to0
.- 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
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/EmitterOpCustomEmitConfig.js (Line 1)
Properties:
Name Type Description onEmit
Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback A callback that is invoked each time the emitter emits a particle.
-
EmitterOpCustomUpdateConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/EmitterOpCustomUpdateConfig.js (Line 1)
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.
-
EmitterOpEaseConfig
-
Defines an operation yielding a value incremented continuously across a range.
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/EmitterOpEaseConfig.js (Line 1)
Properties:
Name Type Argument Default Description start
number The starting value.
end
number The ending value.
ease
string | function <optional>
'Linear' The ease to find. This can be either a string from the EaseMap, or a custom function.
easeParams
Array.<number> <optional>
An optional array of ease parameters to go with the ease.
-
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:
- number | Array.<number> | Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback | Phaser.Types.GameObjects.Particles.EmitterOpRandomConfig | Phaser.Types.GameObjects.Particles.EmitterOpRandomMinMaxConfig | Phaser.Types.GameObjects.Particles.EmitterOpRandomStartEndConfig | Phaser.Types.GameObjects.Particles.EmitterOpSteppedConfig | Phaser.Types.GameObjects.Particles.EmitterOpCustomEmitConfig
- 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:
- Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateCallback | Phaser.Types.GameObjects.Particles.EmitterOpEaseConfig | Phaser.Types.GameObjects.Particles.EmitterOpCustomUpdateConfig
- 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
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/EmitterOpRandomConfig.js (Line 1)
Properties:
Name Type Description random
Array.<number> The minimum and maximum values, as [min, max].
-
EmitterOpRandomMinMaxConfig
-
Defines an operation yielding a random value within a range.
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/EmitterOpRandomMinMaxConfig.js (Line 1)
Properties:
Name Type Description min
number The minimum value.
max
number The maximum value.
-
EmitterOpRandomStartEndConfig
-
Defines an operation yielding a random value within a range.
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/EmitterOpRandomStartEndConfig.js (Line 1)
Properties:
Name Type Description start
number The starting value.
end
number The ending value.
random
boolean If false, this becomes EmitterOpEaseConfig.
-
EmitterOpSteppedConfig
-
Defines an operation yielding a value incremented by steps across a range.
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/EmitterOpSteppedConfig.js (Line 1)
Properties:
Name Type Description start
number The starting value.
end
number The ending value.
steps
number The number of steps between start and end.
-
GravityWellConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/GravityWellConfig.js (Line 1)
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.
-
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
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/ParticleEmitterBounds.js (Line 1)
- See:
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.
-
ParticleEmitterBoundsAlt
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/ParticleEmitterBoundsAlt.js (Line 1)
- See:
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.
-
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
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/ParticleEmitterConfig.js (Line 1)
Properties:
-
ParticleEmitterDeathZoneConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/ParticleEmitterDeathZoneConfig.js (Line 1)
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'.
-
ParticleEmitterEdgeZoneConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/ParticleEmitterEdgeZoneConfig.js (Line 1)
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
number 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.
-
ParticleEmitterFrameConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/ParticleEmitterFrameConfig.js (Line 1)
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
number <optional>
The number of consecutive particles receiving each texture frame, when
cycle
is true. -
ParticleEmitterRandomZoneConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/ParticleEmitterRandomZoneConfig.js (Line 1)
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'.
-
RandomZoneSource
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/RandomZoneSource.js (Line 1)
- See:
Properties:
Name Type Description getRandomPoint
Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback A function modifying its point argument.
-
RandomZoneSourceCallback(point)
-
Parameters:
Name Type Description point
Phaser.Types.Math.Vector2Like A point to modify.
- Since: 3.0.0
- Source: src/gameobjects/particles/typedefs/RandomZoneSourceCallback.js (Line 1)