Moai SDK
1.5 revision 1 (MoaiEdition)
|
Inherits MOAILuaObject.
Function List | |
add | |
angleVec | |
cos | |
cycle | |
div | |
ease | |
easeDelta | |
mul | |
norm | |
packConst | |
packReg | |
rand | |
randVec | |
set | |
sin | |
sprite | |
sub | |
tan | |
time | |
vecAngle | |
wrap |
r0 = v0 + v1
function add ( MOAIParticleScript self, number r0, number v0, number v1 )
self | ( MOAIParticleScript ) |
r0 | ( number ) |
v0 | ( number ) |
v1 | ( number ) |
Load two registers with the X and Y components of a unit vector with a given angle.
function angleVec ( MOAIParticleScript self, number r0, number r1, number v0 )
self | ( MOAIParticleScript ) |
r0 | ( number ) Register to store result X. |
r1 | ( number ) Register to store result Y. |
v0 | ( number ) Angle of vector (in degrees). |
r0 = cos(v0)
function cos ( MOAIParticleScript self, number r0, number v0 )
self | ( MOAIParticleScript ) |
r0 | ( number ) |
v0 | ( number ) |
Cycle v0 between v1 and v2.
function cycle ( MOAIParticleScript self, number r0, number v0, number v1, number v2 )
self | ( MOAIParticleScript ) |
r0 | ( number ) |
v0 | ( number ) |
v1 | ( number ) |
v2 | ( number ) |
r0 = v0 / v1
function div ( MOAIParticleScript self, number r0, number v0, number v1 )
self | ( MOAIParticleScript ) |
r0 | ( number ) |
v0 | ( number ) |
v1 | ( number ) |
Load a register with a value interpolated between two numbers using an ease curve.
function ease ( MOAIParticleScript self, number r0, number v0, number v1, number easeType )
self | ( MOAIParticleScript ) |
r0 | ( number ) Register to store result. |
v0 | ( number ) Starting value of the ease. |
v1 | ( number ) Ending value of the ease. |
easeType | ( number ) See MOAIEaseType for a list of ease types. |
Load a register with a value interpolated between two numbers using an ease curve. Apply as a delta.
function easeDelta ( MOAIParticleScript self, number r0, number v0, number v1, number easeType )
self | ( MOAIParticleScript ) |
r0 | ( number ) Register to store result. |
v0 | ( number ) Starting value of the ease. |
v1 | ( number ) Ending value of the ease. |
easeType | ( number ) See MOAIEaseType for a list of ease types. |
r0 = v0 * v1
function mul ( MOAIParticleScript self, number r0, number v0, number v1 )
self | ( MOAIParticleScript ) |
r0 | ( number ) |
v0 | ( number ) |
v1 | ( number ) |
r0 = v0 / |v|
r1 = v1 / |v|
Where |v| == sqrt( v0^2 + v1^2)
function norm ( MOAIParticleScript self, number r0, number r1, number v0, number v1 )
self | ( MOAIParticleScript ) |
r0 | ( number ) |
r1 | ( number ) |
v0 | ( number ) |
v1 | ( number ) |
Pack a const value into a particle script param.
function packConst ( number const )
const | ( number ) Const value to pack. |
Pack a register index into a particle script param.
function packReg ( number regIdx )
regIdx | ( number ) Register index to pack. |
Load a register with a random number from a range.
function rand ( MOAIParticleScript self, number r0, number v0, number v1 )
self | ( MOAIParticleScript ) |
r0 | ( number ) Register to store result. |
v0 | ( number ) Range minimum. |
v1 | ( number ) Range maximum. |
Load two registers with the X and Y components of a vector with randomly chosen direction and length.
function randVec ( MOAIParticleScript self, number r0, number r1, number v0, number v1 )
self | ( MOAIParticleScript ) |
r0 | ( number ) Register to store result X. |
r1 | ( number ) Register to store result Y. |
v0 | ( number ) Minimum length of vector. |
v1 | ( number ) Maximum length of vector. |
Load a value into a register.
function set ( MOAIParticleScript self, number r0, number v0 )
self | ( MOAIParticleScript ) |
r0 | ( number ) Register to store result. |
v0 | ( number ) Value to load. |
r0 = sin(v0)
function sin ( MOAIParticleScript self, number r0, number v0 )
self | ( MOAIParticleScript ) |
r0 | ( number ) |
v0 | ( number ) |
Push a new sprite for rendering. To render a particle, first call 'sprite' to create a new sprite at the particle's location. Then modify the sprite's registers to create animated effects based on the age of the particle (normalized to its term).
function sprite ( MOAIParticleScript self )
self | ( MOAIParticleScript ) |
r0 = v0 - v1
function sub ( MOAIParticleScript self, number r0, number v0, number v1 )
self | ( MOAIParticleScript ) |
r0 | ( number ) |
v0 | ( number ) |
v1 | ( number ) |
r0 = tan(v0)
function tan ( MOAIParticleScript self, number r0, number v0 )
self | ( MOAIParticleScript ) |
r0 | ( number ) |
v0 | ( number ) |
Load the normalized age of the particle into a register.
function time ( MOAIParticleScript self, number r0 )
self | ( MOAIParticleScript ) |
r0 | ( number ) |
Compute angle (in degrees) between v0 and v1.
function vecAngle ( MOAIParticleScript self, number r0, number v0, number v1 )
self | ( MOAIParticleScript ) |
r0 | ( number ) |
v0 | ( number ) |
v1 | ( number ) |
Wrap v0 between v1 and v2.
function wrap ( MOAIParticleScript self, number r0, number v0, number v1, number v2 )
self | ( MOAIParticleScript ) |
r0 | ( number ) |
v0 | ( number ) |
v1 | ( number ) |
v2 | ( number ) |