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:
- touchstart - A touch event started
- touchend - A touch event ended
- touchmove - A movement occurred after a touch event started
Defined in: touch.js.
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 Attributes | Method Name and Description |
---|---|
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.
|
|
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