Particles.Arcade.Emitter#emitParticle()

emitParticle(x, y, key, frame) → {boolean}

This function is used internally to emit the next particle in the queue.

However it can also be called externally to emit a particle.

When called externally you can use the arguments to override any defaults the Emitter has set.

Parameters
Name Type Argument Description
x number <optional>

The x coordinate to emit the particle from. If null or undefined it will use Emitter.emitX or if the Emitter has a width > 1 a random value between Emitter.left and Emitter.right.

y number <optional>

The y coordinate to emit the particle from. If null or undefined it will use Emitter.emitY or if the Emitter has a height > 1 a random value between Emitter.top and Emitter.bottom.

key string | Phaser.RenderTexture | Phaser.BitmapData | Phaser.Video | PIXI.Texture <optional>

This is the image or texture used by the Particle during rendering. It can be a string which is a reference to the Cache Image entry, or an instance of a RenderTexture, BitmapData, Video or PIXI.Texture.

frame string | number <optional>

If this Particle is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.

Returns
boolean -

True if a particle was emitted, otherwise false.

Source code: particles/arcade/Emitter.js (Line 553)
doc_phaser
2017-02-14 10:57:12
Comments
Leave a Comment

Please login to continue.