new Particle()
Creates a new Particle object.
- 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 propsObject A map of object properties. - Source:
Returns:
A string representing cssText.- Type
- string
-
afterStep()
-
Applies additional forces.
- Source:
-
init(world, opt_options=)
-
Initializes Particle.
Parameters:
Name Type Argument Default Description worldObject An instance of World. opt_options=Object <optional>
A map of initial properties. opt_options.widthnumber <optional>
20 Width opt_options.heightnumber <optional>
20 Height [opt_options.colorArray = [200, 200, 200]] Color. opt_options.borderWidthnumber <optional>
this.width / 4 Border width. opt_options.borderRadiusnumber <optional>
100 The particle's border radius. opt_options.boxShadowSpreadnumber <optional>
this.width / 4 Box-shadow spread. opt_options.lifespannumber <optional>
50 The max life of the object. Set to -1 for infinite life. opt_options.lifenumber <optional>
0 The current life value. If greater than this.lifespan, object is destroyed. {opt_options.fadeboolean = true} If true, opacity decreases proportionally with life. {opt_options.shrinkboolean = true} If true, width and height decrease proportionally with life. opt_options.checkWorldEdgesboolean <optional>
false Set to true to check the object's location against the world's bounds. opt_options.maxSpeednumber <optional>
4 Maximum speed. opt_options.zIndexnumber <optional>
1 The object's zIndex. - Source: