Class: EdgeZone

Phaser.GameObjects.Particles.Zones. EdgeZone

A zone that places particles on a shape's edges.


new EdgeZone(source, quantity, stepRate [, yoyo] [, seamless])

Parameters:
Name Type Argument Default Description
source Phaser.Types.GameObjects.Particles.EdgeZoneSource

An object instance with a getPoints(quantity, stepRate) method returning an array of points.

quantity number

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

stepRate number

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/zones/EdgeZone.js (Line 9)

Members


counter :number

The counter used for iterating the EdgeZone's points.

Type:
  • number
Since: 3.0.0
Default Value:
  • -1
Source: src/gameobjects/particles/zones/EdgeZone.js (Line 79)

points :Array.<Phaser.Geom.Point>

The points placed on the source edge.

Type:
Since: 3.0.0
Default Value:
  • []
Source: src/gameobjects/particles/zones/EdgeZone.js (Line 42)

quantity :number

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

Type:
  • number
Since: 3.0.0
Source: src/gameobjects/particles/zones/EdgeZone.js (Line 52)

seamless :boolean

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

Type:
  • boolean
Since: 3.0.0
Source: src/gameobjects/particles/zones/EdgeZone.js (Line 89)

source :Phaser.Types.GameObjects.Particles.EdgeZoneSource|Phaser.Types.GameObjects.Particles.RandomZoneSource

An object instance with a getPoints(quantity, stepRate) method returning an array of points.

Type:
Since: 3.0.0
Source: src/gameobjects/particles/zones/EdgeZone.js (Line 33)

stepRate :number

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

Type:
  • number
Since: 3.0.0
Source: src/gameobjects/particles/zones/EdgeZone.js (Line 61)

yoyo :boolean

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

Type:
  • boolean
Since: 3.0.0
Source: src/gameobjects/particles/zones/EdgeZone.js (Line 70)

Methods


changeSource(source)

Change the source of the EdgeZone.

Parameters:
Name Type Description
source Phaser.Types.GameObjects.Particles.EdgeZoneSource

An object instance with a getPoints(quantity, stepRate) method returning an array of points.

Since: 3.0.0
Source: src/gameobjects/particles/zones/EdgeZone.js (Line 165)
Returns:

This Edge Zone.

Type
Phaser.GameObjects.Particles.Zones.EdgeZone

getPoint(particle)

Get the next point in the Zone and set its coordinates on the given Particle.

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

The Particle.

Since: 3.0.0
Source: src/gameobjects/particles/zones/EdgeZone.js (Line 182)

updateSource()

Update the Phaser.GameObjects.Particles.Zones.EdgeZone#points from the EdgeZone's Phaser.GameObjects.Particles.Zones.EdgeZone#source.

Also updates internal properties.

Since: 3.0.0
Source: src/gameobjects/particles/zones/EdgeZone.js (Line 125)
Returns:

This Edge Zone.

Type
Phaser.GameObjects.Particles.Zones.EdgeZone