Class: ParticleSystem

ParticleSystem

new ParticleSystem()

Creates a new ParticleSystem.
Source:

Extends

Methods

<static> draw()

Updates the corresponding DOM element's style property.
Source:

<static> getCSSText(props) → {string}

Concatenates a new cssText string.
Parameters:
Name Type Description
props Object A map of object properties.
Source:
Returns:
A string representing cssText.
Type
string

init(world, opt_options=)

Initializes Particle.
Parameters:
Name Type Argument Default Description
world Object An instance of World.
opt_options= Object <optional>
A map of initial properties.
opt_options.width number <optional>
0 Width
opt_options.height number <optional>
0 Height
[opt_options.color string | Array = [255, 255, 255]] Color.
opt_options.borderWidth number <optional>
0 Border width.
opt_options.borderStyle string <optional>
'none' Border style.
[opt_options.borderColor string | Array = [255, 255, 255]] Border color.
opt_options.borderRadius number <optional>
0 Border radius.
opt_options.isStatic boolean <optional>
true If set to true, particle system does not move.
opt_options.lifespan number <optional>
1000 The max life of the system. Set to -1 for infinite life.
opt_options.life number <optional>
0 The current life value. If greater than this.lifespan, system is destroyed.
opt_options.burst number <optional>
1 The number of particles to create per burst.
opt_options.burstRate number <optional>
1 The number of frames between bursts. Lower values = more particles.
opt_options.emitRadius number <optional>
3 The ParticleSystem adds this offset to the location of the Particles it creates.
[opt_options.startColor Array = [255, 255, 255]] The starting color of the particle's palette range.
[opt_options.endColor Array = [255, 0, 0]] The ending color of the particle's palette range.
opt_options.particleOptions Object <optional>
A map of options for particles created by system.
Source: