Class R.components.render.Image
Extends
R.components.Render.
A {@link R.components.Render render component} that draws an image to the render context.
Images used by this component are loaded via an R.resources.loader.ImageLoader
so that client-side caching can be used.
Defined in: image.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.components.render.Image(name, priority, image)
Creates a component which renders images from an ImageLoader.
|
- Fields borrowed from class R.components.Render:
- DRAW, NO_DRAW
- Fields borrowed from class R.components.Base:
- TYPE_COLLIDER, TYPE_INPUT, TYPE_LOGIC, TYPE_RENDERING, TYPE_TRANSFORM
Method Attributes | Method Name and Description |
---|---|
execute(renderContext, time, dt)
Draw the image to the render context.
|
|
Get the class name of this object
|
|
getImage()
Get the image the component is rendering.
|
|
release()
Releases the component back into the object pool.
|
|
setImage(image)
Set the image the component will render from the R.resources.loaders.ImageLoader
specified when creating the component.
|
- Methods borrowed from class R.components.Render:
- destroy, getDrawMode, setDrawMode, transformOrigin
- 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.Image(name, priority, image)
Creates a component which renders images from an ImageLoader.
- Parameters:
- name
- {String} The name of the component
- priority Optional, Default: 0.1
- {Number} The render priority
- image
- {R.resources.types.Image} The image object, acquired with R.resources.loaders.ImageLoader#getImage.
Method Detail
execute(renderContext, time, dt)
Draw the image to the render context.
- Parameters:
- renderContext
- {R.rendercontexts.AbstractRenderContext} The context to render to
- 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.Image"
{HTMLImage}
getImage()
Get the image the component is rendering.
- Returns:
- {HTMLImage}
release()
Releases the component back into the object pool. See R.engine.PooledObject#release
for more information.
setImage(image)
Set the image the component will render from the R.resources.loaders.ImageLoader
specified when creating the component. This allows the user to change
the image on the fly.
- Parameters:
- image
- {R.resources.types.Image} The image to render