Class: ParticleEmitter

me. ParticleEmitter

new ParticleEmitter(x, y, settings)

Particle Emitter Object.
Parameters:
Name Type Description
x Number x-position of the particle emitter
y Number y-position of the particle emitter
settings object An object containing the settings for the particle emitter. See me.ParticleEmitterSettings
Source:
emitter.js, line 329
Example
// Create a basic emitter at position 100, 100
var emitter = new me.ParticleEmitter(100, 100);

// Adjust the emitter properties
emitter.totalParticles = 200;
emitter.minLife = 1000;
emitter.maxLife = 3000;
emitter.z = 10;

// Add the emitter to the game world
me.game.world.addChild(emitter);

// Launch all particles one time and stop, like a explosion
emitter.burstParticles();

// Launch constantly the particles, like a fountain
emitter.streamParticles();

// At the end, remove emitter from the game world
// call this in onDestroyEvent function
me.game.world.removeChild(emitter);

Extends

  • Rect

Members

<static> floating :Boolean

Floating property for particles, value is forwarded to the particle container
Type:
  • Boolean
Source:
emitter.js, line 385

Methods

<static> burstParticles(total)

Launch all particles from emitter and stop
Particles example: Explosions
Parameters:
Name Type Description
total Number [optional] number of particles to launch
Source:
emitter.js, line 525

<static> getRandomPointX() → {Number}

returns a random point inside the bounds x axis of this emitter
Source:
emitter.js, line 435
Returns:
Type
Number

<static> getRandomPointY() → {Number}

returns a random point inside the bounds y axis of this emitter
Source:
emitter.js, line 446
Returns:
Type
Number

<static> isRunning() → {Boolean}

Emitter is of type stream and is launching particles
Source:
emitter.js, line 489
Returns:
Emitter is Stream and is launching particles
Type
Boolean

<static> reset(settings)

Reset the emitter with default values.
Parameters:
Name Type Description
settings Object [optional] object with emitter settings. See me.ParticleEmitterSettings
Source:
emitter.js, line 457

<static> stopStream()

Stop the emitter from generating new particles (used only if emitter is Stream)
Source:
emitter.js, line 515

<static> streamParticles(duration)

Launch particles from emitter constantly
Particles example: Fountains
Parameters:
Name Type Description
duration Number [optional] time that the emitter releases particles in ms
Source:
emitter.js, line 500
Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:41+08:00 using the DocStrap template modified by codename-.