-
<protected> createParticles()
-
Create particles. Up to the maximum number of particles of the
emitter.
- Source:
-
getParticleLife() → {number}
-
Gets the particle life of the created particles.
- Source:
Returns:
Particle life.
-
Type
-
number
-
getParticleLifeVariation() → {number}
-
Gets the particle life variation of the created particles,
relative to the particle life.
- Source:
Returns:
Particle life variation.
-
Type
-
number
-
-
Gets the particles associated with this emitter, they can be
either dead or alive.
- Source:
Returns:
Particles.
-
Type
-
!Array.<!Grape2D.Particle>
-
-
Gets the particle system associated with this emitter.
- Source:
Returns:
Particle system.
-
Type
-
Grape2D.ParticleSystem
-
-
Gets the position of the emitter.
- Source:
Returns:
Position of the emitter.
-
Type
-
Grape2D.Vector
-
getRate() → {number}
-
Gets the rate that the emitter emits particles.
- Source:
Returns:
Emission rate.
-
Type
-
number
-
getRenderedParticles() → {number}
-
Gets the number of particles rendered in the last call to the
Grape2D.Emitter.render method.
- Source:
Returns:
Number of particles rendered.
-
Type
-
number
-
getSpeedVariation() → {number}
-
Gets the speed variation of the created particles.
- Source:
Returns:
Speed variation.
-
Type
-
number
-
getSpread() → {number}
-
Gets the spread of the created particles, relative to the
velocity vector angle.
- Source:
Returns:
Spread of the created particles.
-
Type
-
number
-
-
Gets the velocity of the emitter.
- Source:
Returns:
Velocity of the emitter.
-
Type
-
Grape2D.Vector
-
render(renderer, camera)
-
Renders the particles into a renderer.
Parameters:
- Source:
-
<protected> reviveParticle(particle)
-
Revives a particle according to the emitter properties.
Parameters:
- Source:
-
setParticleLife(particleLife)
-
Sets the particle life of the created particles.
Parameters:
Name |
Type |
Description |
particleLife |
number
|
Particle life. |
- Source:
-
setParticleLifeVariation(particleLifeVariation)
-
Sets the particle life variation of the created particles,
relative to the particle life.
Parameters:
Name |
Type |
Description |
particleLifeVariation |
number
|
Particle life variation. |
- Source:
-
setParticleSystem(ps)
-
Sets the particle system associated with this emitter.
Parameters:
- Source:
-
setPosition(position)
-
Sets the position of the emitter.
Parameters:
Name |
Type |
Description |
position |
Grape2D.Vector
|
Position of the emitter. |
- Source:
-
setRate(rate)
-
Sets the rate that the emitter emits particles.
Parameters:
Name |
Type |
Description |
rate |
number
|
Emission rate. |
- Source:
-
setSpeedVariation(speedVariation)
-
Sets the speed variation of the created particles.
Parameters:
Name |
Type |
Description |
speedVariation |
number
|
Speed variation. |
- Source:
-
setSpread(spread)
-
Sets the spread of the created particles, relative to the
velocity vector angle.
Parameters:
Name |
Type |
Description |
spread |
number
|
Spread of the created particles. |
- Source:
-
setVelocity(velocity)
-
Sets the velocity of the emitter.
Parameters:
Name |
Type |
Description |
velocity |
Grape2D.Vector
|
Velocity of the emitter. |
- Source:
-
update(dt, scene)
-
Updates an emitter. If there are particles dead, it revives them
according to the rate specified.
The emitter should have a particle system associated, if this
method is to be called, it could be done through
emitter.setParticleSystem(particleSystem);
Parameters:
Name |
Type |
Description |
dt |
number
|
Time elapsed since the last update. |
scene |
Grape2D.Scene
|
Scene of the emitter. |
- Source: