The Particle Bounds Processor.
Defines a rectangular region, in world space, within which particle movement is restrained.
Use the properties collideLeft
, collideRight
, collideTop
and
collideBottom
to control if a particle will rebound off the sides
of this boundary, or not.
This happens when the particles worldPosition x/y coordinate hits the boundary.
The strength of the rebound is determined by the Particle.bounce
property.
new ParticleBounds(x, y, width, height, [collideLeft], [collideRight], [collideTop], [collideBottom])
name | type | arguments | Default | description |
---|---|---|---|---|
x | number |
The x position (top-left) of the bounds, in world space. |
||
y | number |
The y position (top-left) of the bounds, in world space. |
||
width | number |
The width of the bounds. |
||
height | number |
The height of the bounds. |
||
collideLeft | boolean | <optional> | true |
Whether particles interact with the left edge of the bounds. |
collideRight | boolean | <optional> | true |
Whether particles interact with the right edge of the bounds. |
collideTop | boolean | <optional> | true |
Whether particles interact with the top edge of the bounds. |
collideBottom | boolean | <optional> | true |
Whether particles interact with the bottom edge of the bounds. |
The active state of the Particle Processor.
An inactive Particle Processor will be skipped for processing by its parent Emitter.
A rectangular boundary constraining particle movement. Use the Emitter properties collideLeft
,
collideRight
, collideTop
and collideBottom
to control if a particle will rebound off
the sides of this boundary, or not. This happens when the particles x/y coordinate hits
the boundary.
Whether particles interact with the bottom edge of the emitter Phaser.GameObjects.Particles.ParticleBounds#bounds.
Whether particles interact with the left edge of the emitter Phaser.GameObjects.Particles.ParticleEmitter#bounds.
Whether particles interact with the right edge of the emitter Phaser.GameObjects.Particles.ParticleBounds#bounds.
Whether particles interact with the top edge of the emitter Phaser.GameObjects.Particles.ParticleBounds#bounds.
A reference to the Particle Emitter that owns this Processor. This is set automatically when the Processor is added to an Emitter and nulled when removed or destroyed.
The x coordinate of the Particle Processor, in world space.
The y coordinate of the Particle Processor, in world space.
Destroys this Particle Processor by removing all external references.
This is called automatically when the owning Particle Emitter is destroyed.
Takes a Particle and updates it against the bounds.
name | type | description |
---|---|---|
particle | Phaser.GameObjects.Particles.Particle |
The Particle to update. |