Kind: global class
This Particle class is used along with ParticleModel and Emitter class.
import { Particle } from 'ad-particles'
Updates the properties of the particle
Kind: static method of Particle
Update the animated style of a particle
Kind: static method of Particle
Renders the particle onto the canvas context.
Kind: static method of Particle
Applies force to the particle.
Kind: static method of Particle
Returns a boolean of is the particle is dead depending on two situations:
- if it has reaches its lifespan, or
- if it is out of the canvas and if EmitterData.killIfOutOfCanvas is set to true
Kind: static method of Particle
Remains the particle in the defined world boundaries by its body size and bounces it when it hits the boundaries.
Kind: static method of Particle
Param | Type | Description |
---|---|---|
w | array |
an array that contains left X, right X, top Y, bottom Y as values for the boundary |
Check it the particle location reaches the border, if ture, it bounces to it.
Kind: static method of Particle
Param | Type | Description |
---|---|---|
axis | string |
String 'x' or 'y' |
val | number |
the location of the border on the X or Y axis |