class flixel.effects.particles.FlxTypedEmitterExt<T> extends FlxTypedEmitter<T>

Available on all platforms

Extended FlxEmitter that emits particles in a circle (instead of a square). * It also provides a new function setMotion to control particle behavior even more. * This was inspired by the way Chevy Ray Johnston implemented his particle emitter in Flashpunk. * @author Dirk Bunk

Instance Fields

var angle:Float

Launch Direction.

var angleRange:Float

Random amount to add to the particle's direction.

var distance:Float

Distance to travel.

var distanceRange:Float

Random amount to add to the particle's distance.

function new(?X:Float = 0, ?Y:Float = 0, ?Size:Float = 0):Void

Creates a new FlxTypedEmitterExt object at a specific position. * Does NOT automatically generate or attach particles! * *

X

The X position of the emitter. *

Y

The Y position of the emitter. *

Size

Optional, specifies a maximum capacity for this emitter.

function emitParticle():Void

This function can be used both internally and externally to emit the next particle.

function setMotion(Angle:Float, Distance:Float, Lifespan:Float, ?AngleRange:Float = 0, ?DistanceRange:Float = 0, ?LifespanRange:Float = 0):Void

Defines the motion range for this emitter. * *

Angle

Launch Direction. *

Distance

Distance to travel. *

Lifespan

Particle duration. *

AngleRange

Random amount to add to the particle's direction. *

DistanceRange

Random amount to add to the particle's distance. *

LifespanRange

Random amount to add to the particle's duration.

function start(?Explode:Bool = true, ?Lifespan:Float = 0, ?Frequency:Float = 0.1f, ?Quantity:Int = 0, ?LifespanRange:Float = 0):Void

Call this function to start emitting particles. * *

Explode

Whether the particles should all burst out at once. *

Lifespan

Unused parameter due to class override. Use setMotion to set things like a particle's lifespan. *

Frequency

Ignored if Explode is set to true. Frequency is how often to emit a particle. 0 = never emit, 0.1 = 1 particle every 0.1 seconds, 5 = 1 particle every 5 seconds. *

Quantity

How many particles to launch. 0 = "all of the particles". *

LifespanRange

Max amount to add to the particle's lifespan. Leave it to default (zero), if you want to make particle "live" forever (plus you should set Lifespan parameter to zero too).