Class R.components.logic.Bounds
Extends
R.components.Logic.
.
Defined in: bounds.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.components.logic.Bounds(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 Attributes | Method Name and Description |
---|---|
add(name, obj)
Add a R.engine.GameObject to the component to be processed when
this component is executed.
|
|
destroy()
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.
|
|
release()
Releases the component back into the object pool.
|
|
remove(obj)
Remove the game object from the component.
|
- Methods borrowed from class R.components.Logic:
- getClassName
- 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.Bounds(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}
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