Class Index | File Index

Classes


Class R.particles.AbstractParticle


Extends R.engine.PooledObject.
Base particle class. A particle only needs to implement the draw() method. The remainder of the functionality is handled by this abstract class.
Defined in: abstractparticle.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Create a particle
Method Summary
Method Attributes Method Name and Description
 
Destroy the particle
 
draw(renderContext, time, dt)
[ABSTRACT] Draw the particle
 
Get the time at which the particle was created
 
Get the class name of this object
 
Get the current position of the particle
 
Get the time-to-live for the particle (when it will expire)
 
Release the particle back into the pool.
 
Set the X and Y world coordinates of the particle
 
update(renderContext, time, dt)
Update the particle in the render context, calling its draw method.
Methods borrowed from class R.engine.PooledObject:
clearObjectDataModel, getId, getName, getObjectDataModel, getProperties, isDestroyed, setName, setObjectDataModel, toString, toXML
Class Detail
R.particles.AbstractParticle(lifetime)
Create a particle
Parameters:
lifetime
{Number} The life of the particle, in milliseconds
Method Detail
destroy()
Destroy the particle

draw(renderContext, time, dt)
[ABSTRACT] Draw the particle
Parameters:
renderContext
{R.rendercontexts.AbstractRenderContext} The context to render the particle to
time
{Number} The world time, in milliseconds
dt
{Number} The delta between the world time and the last time the world was updated in milliseconds.

{Number} getBirth()
Get the time at which the particle was created
Returns:
{Number} milliseconds

{String} getClassName()
Get the class name of this object
Returns:
{String} "R.particles.AbstractParticle"

{R.math.Point2D} getPosition()
Get the current position of the particle
Returns:
{R.math.Point2D}

{Number} getTTL()
Get the time-to-live for the particle (when it will expire)
Returns:
{Number} milliseconds

release()
Release the particle back into the pool.

setPosition(x, y)
Set the X and Y world coordinates of the particle
Parameters:
x
{R.math.Point2D|Number} A R.math.Point2D, or the X world coordinate
y
{Number} Y world coordinate

update(renderContext, time, dt)
Update the particle in the render context, calling its draw method.
Parameters:
renderContext
{R.rendercontexts.AbstractRenderContext} The context where the particle is drawn
time
{Number} The world time, in milliseconds
dt
{Number} The delta between the world time and the last time the world was updated in milliseconds.

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 16:09:19 GMT-0400 (EDT)