A Particle Emitter property.
Facilitates changing Particle properties as they are emitted and throughout their lifetime.
new EmitterOp(config, key, defaultValue, [emitOnly])
name | type | arguments | Default | description |
---|---|---|---|---|
config | Phaser.Types.GameObjects.Particles.ParticleEmitterConfig |
Settings for the Particle Emitter that owns this property. |
||
key | string |
The name of the property. |
||
defaultValue | number |
The default value of the property. |
||
emitOnly | boolean | <optional> | false |
Whether the property can only be modified when a Particle is emitted. |
The step counter for stepped easing, per emit.
The default value of this property.
The easing function to use for updating this property.
Whether this property can only be modified when a Particle is emitted.
Set to true
to allow only Phaser.GameObjects.Particles.EmitterOp#onEmit callbacks to be set and
affect this property.
Set to false
to allow both Phaser.GameObjects.Particles.EmitterOp#onEmit and
Phaser.GameObjects.Particles.EmitterOp#onUpdate callbacks to be set and affect this property.
The end value for this property to ease between.
The callback to run for Particles when they are emitted from the Particle Emitter.
The callback to run for Particles when they are updated.
The name of this property.
The value of this property.
The start value for this property to ease between.
The number of steps for stepped easing between Phaser.GameObjects.Particles.EmitterOp#start and Phaser.GameObjects.Particles.EmitterOp#end values, per emit.
The returned value sets what the property will be at the START of the particles life, on emit.
name | type | arguments | description |
---|---|---|---|
particle | Phaser.GameObjects.Particles.Particle |
The particle. |
|
key | string |
The name of the property. |
|
value | number | <optional> |
The current value of the property. |
The new value of the property.
The returned value updates the property for the duration of the particles life.
name | type | description |
---|---|---|
particle | Phaser.GameObjects.Particles.Particle |
The particle. |
key | string |
The name of the property. |
t | number |
The T value (between 0 and 1) |
value | number |
The current value of the property. |
The new value of the property.
An onUpdate
callback that returns an eased value between the
Phaser.GameObjects.Particles.EmitterOp#start and Phaser.GameObjects.Particles.EmitterOp#end
range.
name | type | description |
---|---|---|
particle | Phaser.GameObjects.Particles.Particle |
The particle. |
key | string |
The name of the property. |
t | number |
The T value (between 0 and 1) |
The new value of the property.
An onEmit
callback for an eased property.
It prepares the particle for easing by Phaser.GameObjects.Particles.EmitterOp#easeValueUpdate.
name | type | description |
---|---|---|
particle | Phaser.GameObjects.Particles.Particle |
The particle. |
key | string |
The name of the property. |
{@link Phaser.GameObjects.Particles.EmitterOp#start}, as the new value of the property.
Check whether an object has the given property.
name | type | description |
---|---|---|
object | object |
The object to check. |
key | string |
The key of the property to look for in the object. |
true
if the property exists in the object, false
otherwise.
Check whether an object has both of the given properties.
name | type | description |
---|---|---|
object | object |
The object to check. |
key1 | string |
The key of the first property to check the object for. |
key2 | string |
The key of the second property to check the object for. |
true
if both properties exist in the object, false
otherwise.
Check whether an object has at least one of the given properties.
name | type | description |
---|---|---|
object | object |
The object to check. |
key1 | string |
The key of the first property to check the object for. |
key2 | string |
The key of the second property to check the object for. |
true
if at least one of the properties exists in the object, false
if neither exist.
Load the property from a Particle Emitter configuration object.
Optionally accepts a new property key to use, replacing the current one.
name | type | arguments | description |
---|---|---|---|
config | Phaser.Types.GameObjects.Particles.ParticleEmitterConfig | <optional> |
Settings for the Particle Emitter that owns this property. |
newKey | string | <optional> |
The new key to use for this property, if any. |
Change the current value of the property and update its callback methods.
name | type | description |
---|---|---|
value | number |
The value of the property. |
This Emitter Op object.
An onEmit
callback that returns a value between the Phaser.GameObjects.Particles.EmitterOp#start and
Phaser.GameObjects.Particles.EmitterOp#end range.
name | type | description |
---|---|---|
particle | Phaser.GameObjects.Particles.Particle |
The particle. |
key | string |
The key of the property. |
The new value of the property.
An onEmit
callback that returns a random value from the current value array.
The new value of the property.
Update the Phaser.GameObjects.Particles.EmitterOp#onEmit and Phaser.GameObjects.Particles.EmitterOp#onUpdate callbacks based on the type of the current Phaser.GameObjects.Particles.EmitterOp#propertyValue.
This Emitter Op object.
An onEmit
callback that returns the current value of the property.
The current value of the property.
An onUpdate
callback that returns the current value of the property.
The current value of the property.
An onEmit
callback that returns a stepped value between the
Phaser.GameObjects.Particles.EmitterOp#start and Phaser.GameObjects.Particles.EmitterOp#end
range.
The new value of the property.
Build a JSON representation of this Particle Emitter property.
A JSON representation of this Particle Emitter property.