Class Index | File Index

Classes


Class R.components.input.Touch


Extends R.components.Input.
A component which responds to touch events and notifies its R.engine.GameObject by triggering one of three events. The R.engine.GameObject should add event handlers for any one of:

Each event handler will be passed a {@link R.struct.TouchInfo TouchInfo} object which contains information about the event. The touchmove event is also passed a boolean flag indicating if the touch is within the world bounding box of the game object.

Note: The rendering context that the object is contained within needs to enable touch event capturing with the R.rendercontexts.AbstractRenderContext#captureTouch method.
Defined in: touch.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
R.components.input.Touch(name, priority)
Create an instance of a touch input component.
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
 
Destroy this instance and remove all references.
 
execute(renderContext, time, dt)
Perform the checks on the touch info object, and also perform intersection tests to be able to call touch events.
 
Get the class name of this object
 
setGameObject(gameObject)
Establishes the link between this component and its host object.
 
setHostObject(hostObj)
Deprecated in favor of #setGameObject
Methods borrowed from class R.components.Base:
getGameObject, getHostObject, getPriority, getType, getTypeString, release, 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.input.Touch(name, priority)
Create an instance of a touch input component.
Parameters:
name
{String} The unique name of the component.
priority Optional
{Number} The priority of the component among other input components.
Method Detail
destroy()
Destroy this instance and remove all references.

execute(renderContext, time, dt)
Perform the checks on the touch info object, and also perform intersection tests to be able to call touch events.
Parameters:
renderContext
{R.rendercontexts.AbstractRenderContext} The render context
time
{Number} The current world time
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.input.Touch"

setGameObject(gameObject)
Establishes the link between this component and its host object. When you assign components to a host object, it will call this method so that each component can refer to its host object, the same way a host object can refer to a component with R.engine.GameObject#getComponent.
Parameters:
gameObject
{R.engine.GameObject} The object which hosts this component

setHostObject(hostObj)
Deprecated in favor of #setGameObject
Parameters:
hostObj

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