Particle
Represents a particle that can be spawned and modified
Obtained by indexing the ParticleAPI
Exists as an object-oriented alternative to particles:addParticle()
For the examples on this page assume:
myParticle = particles["explosion"]
spawn()
Spawns the particle with its current properties (set with the other functions)
Example:
myParticle:spawn()
setPos(Vector3)
Sets the position of the particle
Example:
myParticle:setPos(player:getPos())
getPos()
Gets the position of the particle
Example:
myParticle:getPos()
setColor(Vector3 or Vector4)
Sets the particle color, most particles don't support it. The alpha value can be excluded
Example:
myParticle:setColor(0, 0, 1)
getColor()
Gets the color as set by setcolor
Example:
myParticle:getColor()
setScale(Vector3)
Sets the scale of the particle
Example:
myParticle:setScale(2, 2, 2)
getScale()
Gets the scale of the particle
Example:
myParticle:getScale()
setVelocity(Vector3)
Sets the velocity of the particle
Example:
myParticle:setVelocity(2, 2, 2)