Particles

.GameObjects. Particles

Type Definitions

DeathZoneSource

Since:
  • 3.0.0
See:
Properties:
Name Type Description
contains Phaser.Types.GameObjects.Particles.DeathZoneSourceCallback
Type:
  • object

DeathZoneSourceCallback(x, y) → {boolean}

Since:
  • 3.0.0
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.
Returns:
- True if the coordinates are within the source area.
Type
boolean

EdgeZoneSource

Since:
  • 3.0.0
See:
Properties:
Name Type Description
getPoints Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback 将点放在源边上的函数.
Type:
  • object

EdgeZoneSourceCallback(quantity, stepRateopt) → {Array.<Phaser.Geom.Point>}

Since:
  • 3.0.0
Parameters:
Name Type Attributes Description
quantity number The number of particles to place on the source edge. If 0, `stepRate` should be used 相反.
stepRate number <optional>
The distance between each particle. When set, `quantity` is implied and should be set to `0`.
Returns:
- 放置在源边上的点.
Type
Array.<Phaser.Geom.Point>

EmitterOpCustomEmitConfig

Since:
  • 3.0.0
Properties:
Name Type Description
onEmit Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback 每次发射器发射粒子时调用的回调.
Type:
  • object

EmitterOpCustomUpdateConfig

Since:
  • 3.0.0
Properties:
Name Type Attributes Description
onEmit Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback <optional>
每次发射器发射粒子时调用的回调.
onUpdate Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateCallback 每次发射器更新时调用的回调.
Type:
  • object

EmitterOpEaseConfig

Since:
  • 3.0.0
Properties:
Name Type Attributes Default Description
start number 起始值.
end number 结束值.
ease string | function <optional>
'Linear' 容易找到.这可以是来自EaseMap的字符串,也可以是自定义函数.
easeParams Array.<number> <optional>
一组可选的轻松参数.
定义一个操作,该操作产生一个在一个范围内连续递增的值.
Type:
  • object

EmitterOpOnEmitCallback(particle, key, value) → {number}

Since:
  • 3.0.0
返回值设置在粒子生命开始时,发射时的属性.
Parameters:
Name Type Description
particle Phaser.GameObjects.Particles.Particle 粒子.
key string 属性的名称.
value number 属性的当前值.
Returns:
属性的新值.
Type
number

EmitterOpOnEmitType

Since:
  • 3.18.0
Type:

EmitterOpOnUpdateCallback(particle, key, t, value) → {number}

Since:
  • 3.0.0
返回值在粒子生命周期内更新属性.
Parameters:
Name Type Description
particle Phaser.GameObjects.Particles.Particle 粒子.
key string 属性的名称.
t number The normalized lifetime of the particle, between 0 (start) and 1 (end).
value number 属性的当前值.
Returns:
属性的新值.
Type
number

EmitterOpOnUpdateType

Since:
  • 3.18.0
Type:

EmitterOpRandomConfig

Since:
  • 3.0.0
Properties:
Name Type Description
random Array.<number> 最小值和最大值,如[最小值,最大值].
定义在一个范围内产生随机值的操作.
Type:
  • object

EmitterOpRandomMinMaxConfig

Since:
  • 3.0.0
Properties:
Name Type Description
min number 最小值.
max number 最大值.
定义在一个范围内产生随机值的操作.
Type:
  • object

EmitterOpRandomStartEndConfig

Since:
  • 3.0.0
Properties:
Name Type Description
start number 起始值.
end number 结束值.
random boolean 如果为false,这将变成EmitterOpEaseConfig.
定义在一个范围内产生随机值的操作.
Type:
  • object

EmitterOpSteppedConfig

Since:
  • 3.0.0
Properties:
Name Type Description
start number 起始值.
end number 结束值.
steps number 开始和结束之间的步数.
定义一个操作,该操作产生的值在一个范围内按步长递增.
Type:
  • object

GravityWellConfig

Since:
  • 3.0.0
Properties:
Name Type Attributes Default Description
x number <optional>
0 世界空间中重力井的x坐标.
y number <optional>
0 世界空间中重力井的y坐标.
power number <optional>
0 重力的强度——数字越大产生的力越大.
epsilon number <optional>
100 计算重力的最小距离.
gravity number <optional>
50 这个重力井的重力.
Type:
  • object

ParticleDeathCallback(particle)

Since:
  • 3.0.0
Parameters:
Name Type Description
particle Phaser.GameObjects.Particles.Particle The particle that died.

ParticleEmitterBounds

Since:
  • 3.0.0
See:
Properties:
Name Type Description
x number 矩形的左边缘.
y number 矩形的上边缘.
width number 矩形的宽度.
height number 矩形的高度.
Type:
  • object

ParticleEmitterBoundsAlt

Since:
  • 3.0.0
See:
Properties:
Name Type Description
x number 矩形的左边缘.
y number 矩形的上边缘.
w number 矩形的宽度.
h number 矩形的高度.
Type:
  • object

ParticleEmitterCallback(particle, emitter)

Since:
  • 3.0.0
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.

ParticleEmitterConfig

Since:
  • 3.0.0
Properties:
Name Type Attributes 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>