Methods
-
addemitter(x, y, maxparticles)
-
Creates a particle emitter at the given location, with a total number of max particles.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description xNumber the x location of the emitter
yNumber the y location of the emitter
maxparticlesNumber the total number of particles in the emitter
Code Equivalent:
game.add.emitter(x, y, maxparticles) -
Blockly.JavaScript['emitters_set_alpha'](block)
-
Parameters:
Name Type Description blockCode Equivalent:
undefined -
Blockly.JavaScript['emitters_set_speed'](block)
-
Parameters:
Name Type Description blockCode Equivalent:
undefined -
emitters_make_particles(emitter, keys, frames, quantity, collide, collideWorldBounds)
-
Generates new particles to be used by the emitter.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description emitteremitter to make new particles for
keysString the sprite/texture to use for the particles
framesNumber the frames the sprites will use
quantityNumber the number of particles to generate
collideBoolean whether or not the particles should collide with physics bodies
collideWorldBoundsBoolean whether or not the particles should collide with the world bounds
Code Equivalent:
emitter.makeParticles('tag'); -
emitters_set_alpha(emitter, min, max, rate)
-
Sets the alpha constraints and variations for the particles on the emitter.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description emitteremitter to change the particles of
minNumber the minimum value the alpha of the particles can reach
maxNumber the maximum value the alpha of the particles can reach
rateNumber the rate the particles will change between min and max
Code Equivalent:
emitter.setAlpha(min, max, rate); -
emitters_set_gravity(emitter, particle_gravity)
-
Sets the gravity each particle has when launched from the emitter.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description emitteremitter to set the gravity of the particles for
particle_gravityNumber the gravity each particle will have
Code Equivalent:
emitter.gravity = gravity; -
emitters_set_scale(emitter, minx, maxx, miny, maxy, rate)
-
Sets the scale constraints and variations for the particles on the emitter.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description emitteremitter to change the particles of
minxNumber the minimum x value the scale the particles can reach
maxxNumber the maximum x value the scale the particles can reach
minyNumber the minimum y value the scale the particles can reach
maxyNumber the maximum y value the scale the particles can reach
rateNumber the rate the particles will change between min and max
Code Equivalent:
emitter.setScale(minx, maxx, miny, maxy, rate); -
emitters_set_speed(emitter, minx, maxx, miny, maxy)
-
Sets the maximum and minimum speeds of the particles released from the emitter.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description emitteremitter to set the speed of the particles for
minxNumber the minimum speed for the particles to move in the x direction
maxxNumber the maximum speed for the particles to move in the x direction
minyNumber the minimum speed for the particles to move in the y direction
maxyNumber the maximum speed for the particles to move in the y direction
Code Equivalent:
tMax; -
emitters_start(emitter, explode, lifespan, frequency, quantity)
-
Tell the emitter to start emitting particles.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description emitteremitter to start emitting particles from
explodeBoolean whether the particles should burst out at once (true), or at the frequency given (false)
lifespanNumber how long each particle lives once emitted
frequencyNumber the interval between the release of each particle
quantityNumber how many particles to emit before turning off
Code Equivalent:
emitter.start(explode, lifespan, frequency, quantity);