Particle Emitter
The Particle Emitter object is responsible for managing and handling all 2D particles.
Properties
rate
The number of particles to be emitted per second.
Default: 5
onSpawn
A callback function called when a particle is spawned.
Passed Values: particle
onUpdate
A callback function called when a particle is updated.
Passed Values: particle, delta
Global Functions
ParticleEmitter.new(hook, particle)
Creates a new ParticleEmitter instance
hook This is a UI Element (like a frame) which the emitter will use as a host for its operations. Generated particles will be parented to the hook and any operation on an individual particle is relative to the hook element. For example, if a particles position is set upon it spawning, the location in which the particle will appear will be relative to the location of the hook element.
particle This is any singular UI Element (like a frame) which the emitter will use as the particle to be emitted. These particles can contain scripts and other elements.
Object Functions
:Destroy()
Destroys the ParticleEmitter instance
:Emit(count)
Emits a particle
count This is the number of particles to be emitted.
Note: This feature is not currently available in the current release. If you'd like to use it, please download the lastest code from the repository and use that instead.