An emitter of a single particle group. Part of Particles
simulation system.
Constructor
Variables
animationRepeat:Float = 1
The amount of times the animations will loop during lifetime. Settings it to 0 will stop the animation playback and each particle will have a random frame assigned at emission time.
emitDelay:Float = 0
Fixed delay before particle appears after being emitted.
Usage note for non-relative mode: Particle will use configuration that was happened at time of emission, not when delay timer runs out.
emitDirectionAsAngle:Bool = false
When enabled, particle rotation will match the particle movement direction angle.
emitLoop:Bool = true
If enabled, group will emit new particles indefinitely maintaining number of particles at ParticleGroup.nparts
.
emitMode:PartEmitMode = Point
The pattern in which particles are emitted. See individual PartEmitMode
values for more details.
emitSync:Float = 0
Randomized synchronization delay before particle appears after being emitted.
Usage note for non-relative mode: Particle will use configuration that was happened at time of emission, not when delay timer runs out.
fadeOut:Float = 0.8
The time in seconds at which particle will start to fade out before dying. Fade out time can be calculated with lifetime - fadeOut
.
frameCount:Int = 0
Total count of frames used by the group.
When 0, amount of frames in a group calculated by frameDivisionX * frameDivisionY
.
Otherwise it's min(frameDivisionX * frameDivisionY, frameCount)
.
isRelative:Bool = true
When enabled, causes particles to always render relative to the emitter position, moving along with it. Otherwise, once emitted, particles won't follow the emitter, and will render relative to the scene origin.
Non-relative mode is useful for simulating something like a smoke coming from a moving object, while relative mode things like jet flame that have to stick to its emission source.
rebuildOnChange:Bool = true
Should group rebuild on parameters change.
Note that some parameters take immediate effect on the existing particles, and some would force rebuild regardless of this setting.
Parameters that take immediate effect:
speedIncr
, gravity
, gravityAngle
, fadeIn
, fadeOut
, fadePower
, rotAuto
, rotInit
, incrX
, incrY
, emitLoop
and blendMode
Parameters that will always force rebuild:
enable
, sortMode
, isRelative
, texture
, frameCount
, frameDivisionX
, frameDivisionY
and nparts
Parameters that newer cause rebuild:
blendMode
, colorGradient
and animationRepeat
rotAuto:Bool = false
If enabled, particles will be automatically rotated in the direction of particle velocity.
Methods
load(version:Int, o:Dynamic):Void
Loads the particle group configuration from a given object.
Parameters:
version | The version of Particles that were used to save the configuration. |
---|---|
o | The previously saved configuration data to load. |