Moai SDK  1.5 revision 1 (MoaiEdition)
MOAIParticleSystem Class Reference
Inheritance diagram for MOAIParticleSystem:
MOAIProp MOAIAction MOAITransform MOAIColor MOAIRenderable MOAITransform MOAIColor MOAIRenderable MOAIInstanceEventSource MOAITransformBase MOAINode MOAITransformBase MOAINode MOAIEventSource MOAINode MOAIInstanceEventSource MOAINode MOAIInstanceEventSource MOAIInstanceEventSource MOAIEventSource MOAIInstanceEventSource MOAIEventSource MOAIEventSource MOAIEventSource

List of all members.

Function List

  capParticles
  capSprites
  clearSprites
  isIdle
  getState
  pushParticle
  pushSprite
  reserveParticles
  reserveSprites
  reserveStates
  setComputeBounds
  setSpriteColor
  setSpriteDeckIdx
  setState
  surge

Function Documentation

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 ] )
Parameters:
self ( MOAIParticleSystem )
cap ( boolean ) Optional. Default value is true.
Returns:
nil

Controls capping vs. wrapping of sprites.


function capSprites ( MOAIParticleSystem self [, boolean cap ] )
Parameters:
self ( MOAIParticleSystem )
cap ( boolean ) Optional. Default value is true.
Returns:
nil

Flushes any existing sprites in system.


function clearSprites ( MOAIParticleSystem self )
Parameters:
self ( MOAIParticleSystem )
Returns:
nil

Returns a particle state for an index or nil if none exists.


function getState ( MOAIParticleSystem self, number index )
Parameters:
self ( MOAIParticleSystem )
index ( number )
Returns:
state ( MOAIParticleState )

Returns true if the current system is not currently processing any particles.


function isIdle ( MOAIParticleSystem self )
Parameters:
self ( MOAIParticleSystem )
Returns:
isIdle ( boolean )

Adds a particle to the system.


function pushParticle ( MOAIParticleSystem self [, number x, number y, number dx, number dy ] )
Parameters:
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.
Returns:
result ( boolean )

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 ] )
Parameters:
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.
Returns:
result ( boolean )

Reserve particle capacity of system.


function reserveParticles ( MOAIParticleSystem self, number nParticles, number particleSize )
Parameters:
self ( MOAIParticleSystem )
nParticles ( number ) Total number of particle records.
particleSize ( number ) Number of parameters reserved for the particle.
Returns:
nil

Reserve sprite capacity of system.


function reserveSprites ( MOAIParticleSystem self, number nSprites )
Parameters:
self ( MOAIParticleSystem )
nSprites ( number )
Returns:
nil

Reserve total number of states for system.


function reserveStates ( MOAIParticleSystem self, number nStates )
Parameters:
self ( MOAIParticleSystem )
nStates ( number )
Returns:
nil

Set the a flag controlling whether the particle system re-computes its bounds every frame.


function setComputeBounds ( MOAIParticleSystem self [, boolean computBounds ] )
Parameters:
self ( MOAIParticleSystem )
computBounds ( boolean ) Optional. Default value is false.
Returns:
nil

Set the color of the most recently added sprite.


function setSpriteColor ( MOAIParticleSystem self, number r, number g, number b, number a )
Parameters:
self ( MOAIParticleSystem )
r ( number )
g ( number )
b ( number )
a ( number )
Returns:
nil

Set the sprite's deck index.


function setSpriteDeckIdx ( MOAIParticleSystem self, number index )
Parameters:
self ( MOAIParticleSystem )
index ( number )
Returns:
nil

Set a particle state.


function setState ( MOAIParticleSystem self, number index, MOAIParticleState state )
Parameters:
self ( MOAIParticleSystem )
index ( number )
state ( MOAIParticleState )
Returns:
nil

Release a batch emission or particles into the system.


function surge ( MOAIParticleSystem self [, number total, number x, number y, number dx, number dy ] )
Parameters:
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.
Returns:
nil