pixi.plugins.particles.cloudkid.Emitter

type
class
metadata
:native
"cloudkid.Emitter"

Constructor

new(parent : pixi.display.DisplayObjectContainer, ?particleImages : Array<pixi.textures.Texture>, ?config : Dynamic)
parameters
{pixi.display.DisplayObjectContainer} particleParent The display object to add the particles to.
{Array<pixi.textures.Texture>} [particleImages] A texture or array of textures to use for the particles.
{Dynamic} [config] A configuration object containing settings for the emitter.
A particle emitter.

Instance Variables

_posChanged : Bool

If either ownerPos or spawnPos has changed since the previous update.

acceleration : pixi.geom.Point

Acceleration to apply to particles. Using this disables any interpolation of particle speed. If the particles do not have a rotation speed, then they will be rotated to match the direction of travel.

addAtBack : Bool

If particles should be added at the back of the display list instead of the front.

angleStart : Float

Angle at which to start spawning particles in a burst.

customEase : Void -> Void

An easing function for nonlinear interpolation of values. Accepts a single parameter of time as a value from 0-1, inclusive. Expected outputs are values from 0-1, inclusive.

emit : Bool

emitterLife : Float

The amount of time in seconds to emit for before setting emit to false. A value of -1 is an unlimited amount of time.

endAlpha : Float

The ending alpha of all particles.

endColor : Array<Int>

The ending color of all particles, as red, green, and blue uints from 0-255.

endScale : Float

The ending scale of all particles.

endSpeed : Float

The ending speed of all particles.

extraData : Dynamic

Extra data for use in custom particles. The emitter doesn't look inside, but passes it on to the particle to use in init().

frequency : Float

Time between particle spawns in seconds.

maxLifetime : Float

The maximum lifetime for a particle, in seconds.

maxParticles : Int

Maximum number of particles to keep alive at a time. If this limit is reached, no more particles will spawn until some have died.

maxRotationSpeed : Float

The maximum start rotation for a particle, in degrees. This value is ignored if the spawn type is "burst" or "arc".

maxStartRotation : Float

The maximum rotation speed for a particle, in degrees per second. This only visually spins the particle, it does not change direction of movement.

minLifetime : Float

The minimum lifetime for a particle, in seconds.

minRotationSpeed : Float

The minimum rotation speed for a particle, in degrees per second. This only visually spins the particle, it does not change direction of movement.

minimumScaleMultiplier : Float

A minimum multiplier for the scale of a particle at both start and end. A value between minimumScaleMultiplier and 1 is randomly generated and multiplied with startScale and endScale to provide the actual startScale and endScale for each particle.

ownerPos : pixi.geom.Point

The world position of the emitter's owner, to add spawnPos to when spawning particles. To change this, use updateSpawnOrigin().
The display object to add particles to.

particleBlendMode : Int

The blend mode for all particles, as named by PIXI.blendModes.

particleImage : Array<pixi.textures.Texture>

An array of PIXI Texture objects.

particlePerWave : Int

Float of particles to spawn each wave in a burst.

particleSpacing : Float

Spacing between particles in a burst. 0 gives a random angle for each particle.

rotation : Float

Rotation of the emitter or emitter's owner in degrees. This is added to the calculated spawn angle. To change this, use rotate().

spawnCircle : pixi.geom.Circle

A circle relative to spawnPos to spawn particles inside if the spawn type is "circle".

spawnPos : pixi.geom.Point

Position at which to spawn particles, relative to the emitter's owner's origin. For example, the flames of a rocket travelling right might have a spawnPos of {x:-50, y:0}. to spawn at the rear of the rocket. To change this, use updateSpawnPos().

spawnRect : pixi.geom.Rectangle

A rectangle relative to spawnPos to spawn particles inside if the spawn type is "rect".

spawnType : String

How the particles will be spawned. Valid types are "point", "rectangle", "circle", "burst".

startAlpha : Float

The starting alpha of all particles.

startColor : Array<Int>

startScale : Float

The starting scale of all particles.

startSpeed : Float

The starting speed of all particles.

Instance Methods

cleanup() : Void

Kills all active particles immediately.

destroy() : Void

Destroys the emitter and all of its particles.

init(particleImages : Array<pixi.textures.Texture>, config : Dynamic) : Void

parameters
{Array<pixi.textures.Texture>} particleImages A texture or array of textures to use for the particles.
{Dynamic} config A configuration object containing settings for the emitter.
Sets up the emitter based on the config settings.

recycle(particle : Particle) : Void

parameters
{Particle} particle The particle to recycle.
Recycles an individual particle.

resetPositionTracking() : Void

Prevents emitter position interpolation in the next update. This should be used if you made a major position change of your emitter's owner that was not normal movement.

rotate(newRot : Float) : Void

parameters
{Float} newRot The new rotation, in degrees.
Sets the rotation of the emitter to a new value.

update(delta : Float) : Void

parameters
{Float} delta Time elapsed since the previous frame, in __seconds__.
Updates all particles spawned by this emitter and emits new ones.

updateOwnerPos(x : Float, y : Float) : Void

parameters
{Float} x The new x value of the emitter's owner.
{Float} y The new y value of the emitter's owner.
Changes the position of the emitter's owner. You should call this if you are adding particles to the world display object that your emitter's owner is moving around in.

updateSpawnPos(x : Float, y : Float) : Void

parameters
{Float} x The new x value of the spawn position for the emitter.
{Float} y The new y value of the spawn position for the emitter.
Changes the spawn position of the emitter.