Class R.components.Render
Extends
R.components.Base.
The base component class for components which render
to an {@link R.rendercontexts.AbstractRenderContext render context}. Rendering
consists of anything which alters the visual state of the render context.
Defined in: render.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.components.Render(name, priority)
Creates a render component.
|
Field Attributes | Field Name and Description |
---|---|
The component should render itself to the rendering context.
|
|
The component should not render itself to the rendering context.
|
- Fields borrowed from class R.components.Base:
- TYPE_COLLIDER, TYPE_INPUT, TYPE_LOGIC, TYPE_RENDERING, TYPE_TRANSFORM
Method Attributes | Method Name and Description |
---|---|
destroy()
Destroy the component instance
|
|
execute(renderContext, time, dt)
Handles whether or not the component should draw to the
render context.
|
|
Get the class name of this object
|
|
Get the drawing mode of the component.
|
|
release()
Releases the component back into the object pool.
|
|
setDrawMode(drawMode)
Set the draw mode of the component.
|
|
transformOrigin(renderContext, before)
Adjust the local transformation to accommodate the origin.
|
- 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.Render(name, priority)
Creates a render component.
- Parameters:
- name
- {String} The name of the component
- priority
- {Number} The priority of the component between 0.0 and 1.0
Field Detail
DRAW
The component should render itself to the rendering context.
NO_DRAW
The component should not render itself to the rendering context.
Method Detail
destroy()
Destroy the component instance
execute(renderContext, time, dt)
Handles whether or not the component should draw to the
render context.
- 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.
{String}
getClassName()
Get the class name of this object
- Returns:
- {String} "R.components.Render"
{Number}
getDrawMode()
Get the drawing mode of the component.
- Returns:
- {Number}
release()
Releases the component back into the object pool. See PooledObject#release
for more information.
setDrawMode(drawMode)
Set the draw mode of the component. Currently this determines
if the component should render itself to the context or not.
transformOrigin(renderContext, before)
Adjust the local transformation to accommodate the origin.
- Parameters:
- renderContext
- {R.rendercontexts.AbstractRenderContext} The render context
- before
- {Boolean}
true
if the transform is occurring before rendering