Moai SDK
1.5 revision 1 (MoaiEdition)
|
Controls capping vs. wrapping of particles in overflow situation. Capping will prevent emission of additional particles when system is full. Wrapping will overwrite the oldest particles with new particles.
function capParticles ( MOAIParticleSystem self [, boolean cap ] )
self | ( MOAIParticleSystem ) |
cap | ( boolean ) Optional. Default value is true. |
Controls capping vs. wrapping of sprites.
function capSprites ( MOAIParticleSystem self [, boolean cap ] )
self | ( MOAIParticleSystem ) |
cap | ( boolean ) Optional. Default value is true. |
Flushes any existing sprites in system.
function clearSprites ( MOAIParticleSystem self )
self | ( MOAIParticleSystem ) |
Returns a particle state for an index or nil if none exists.
function getState ( MOAIParticleSystem self, number index )
self | ( MOAIParticleSystem ) |
index | ( number ) |
Returns true if the current system is not currently processing any particles.
function isIdle ( MOAIParticleSystem self )
self | ( MOAIParticleSystem ) |
Adds a particle to the system.
function pushParticle ( MOAIParticleSystem self [, number x, number y, number dx, number dy ] )
self | ( MOAIParticleSystem ) |
x | ( number ) Optional. Default value is 0. |
y | ( number ) Optional. Default value is 0. |
dx | ( number ) Optional. Default value is 0. |
dy | ( number ) Optional. Default value is 0. |
Adds a sprite to the system. Sprite will persist until particle simulation is begun or 'clearSprites' is called.
function pushSprite ( MOAIParticleSystem self, number x, number y [, number rot, number xScale, number yScale ] )
self | ( MOAIParticleSystem ) |
x | ( number ) |
y | ( number ) |
rot | ( number ) Optional. Rotation in degrees. Default value is 0. |
xScale | ( number ) Optional. Default value is 1. |
yScale | ( number ) Optional. Default value is 1. |
Reserve particle capacity of system.
function reserveParticles ( MOAIParticleSystem self, number nParticles, number particleSize )
self | ( MOAIParticleSystem ) |
nParticles | ( number ) Total number of particle records. |
particleSize | ( number ) Number of parameters reserved for the particle. |
Reserve sprite capacity of system.
function reserveSprites ( MOAIParticleSystem self, number nSprites )
self | ( MOAIParticleSystem ) |
nSprites | ( number ) |
Reserve total number of states for system.
function reserveStates ( MOAIParticleSystem self, number nStates )
self | ( MOAIParticleSystem ) |
nStates | ( number ) |
Set the a flag controlling whether the particle system re-computes its bounds every frame.
function setComputeBounds ( MOAIParticleSystem self [, boolean computBounds ] )
self | ( MOAIParticleSystem ) |
computBounds | ( boolean ) Optional. Default value is false. |
Set the color of the most recently added sprite.
function setSpriteColor ( MOAIParticleSystem self, number r, number g, number b, number a )
self | ( MOAIParticleSystem ) |
r | ( number ) |
g | ( number ) |
b | ( number ) |
a | ( number ) |
Set the sprite's deck index.
function setSpriteDeckIdx ( MOAIParticleSystem self, number index )
self | ( MOAIParticleSystem ) |
index | ( number ) |
Set a particle state.
function setState ( MOAIParticleSystem self, number index, MOAIParticleState state )
self | ( MOAIParticleSystem ) |
index | ( number ) |
state | ( MOAIParticleState ) |
Release a batch emission or particles into the system.
function surge ( MOAIParticleSystem self [, number total, number x, number y, number dx, number dy ] )
self | ( MOAIParticleSystem ) |
total | ( number ) Optional. Default value is 1. |
x | ( number ) Optional. Default value is 0. |
y | ( number ) Optional. Default value is 0. |
dx | ( number ) Optional. Default value is 0. |
dy | ( number ) Optional. Default value is 0. |