Class Index | File Index

Classes


Class R.components.logic.Host


Extends R.components.Logic.
A component that can execute game objects. Allows embedding of multiple objects into one object. This is logically a method to embed further {@link R.engine.GameObject GameObjects} within an existing R.engine.GameObject.
Defined in: host.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
R.components.logic.Host(name, priority)
Creates a R.components.Host which can contain {@link R.engine.GameObject GameObjects}.
Fields borrowed from class R.components.Base:
TYPE_COLLIDER, TYPE_INPUT, TYPE_LOGIC, TYPE_RENDERING, TYPE_TRANSFORM
Method Summary
Method Attributes Method Name and Description
 
add(name, obj)
Add a R.engine.GameObject to the component to be processed when this component is executed.
 
Destroys the container which refers to the game objects.
 
execute(renderContext, time, dt)
Update each of the game objects within this component.
 
get(name)
Retrieve the R.engine.GameObject that is associated with the given name from the component.
 
Get the class name of this object
 
Releases the component back into the object pool.
 
remove(obj)
Remove the game object from the component.
Methods borrowed from class R.components.Base:
getGameObject, getHostObject, getPriority, getType, getTypeString, setGameObject, setHostObject, setPriority
Methods borrowed from class R.engine.BaseObject:
addEvent, addEvents, getElement, jQ, removeEvent, setElement, triggerEvent, update
Methods borrowed from class R.engine.PooledObject:
clearObjectDataModel, getId, getName, getObjectDataModel, getProperties, isDestroyed, setName, setObjectDataModel, toString, toXML
Class Detail
R.components.logic.Host(name, priority)
Creates a R.components.Host which can contain {@link R.engine.GameObject GameObjects}. This allows a component to embed other game objects within it. Each time the component is executed, each game object will be given a chance to update as well.
Parameters:
name
{String} The name of the component
priority Optional, Default: 1.0
{Number} The priority of this component
Method Detail
add(name, obj)
Add a R.engine.GameObject to the component to be processed when this component is executed. Objects will be updated in the order in which they are added.
Parameters:
name
{String} A unique name to refer to the object by
obj
{R.engine.GameObject} The game object reference

destroy()
Destroys the container which refers to the game objects.

execute(renderContext, time, dt)
Update each of the game objects within this component. The order in which game objects are updated is equivalent to the order in which the objects were added.
Parameters:
renderContext
{R.rendercontexts.AbstractRenderContext} The rendering context
time
{Number} The engine time in milliseconds
dt
{Number} The delta between the world time and the last time the world was updated in milliseconds.

{R.engine.GameObject} get(name)
Retrieve the R.engine.GameObject that is associated with the given name from the component.
Parameters:
name
{String} The unique name of the object
Returns:
{R.engine.GameObject}

{String} getClassName()
Get the class name of this object
Defined in: bounds.js.
Returns:
{String} "R.components.logic.Host"

release()
Releases the component back into the object pool. See R.engine.PooledObject#release for more information.

{R.engine.GameObject} remove(obj)
Remove the game object from the component.
Parameters:
obj
{R.engine.GameObject} The game object reference
Returns:
{R.engine.GameObject} The object which was removed

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