Class R.components.input.Mouse
Extends
R.components.Input.
A component which responds to mouse events and notifies
the host object when one of the events occurs. The R.engine.GameObject should
add event handlers for any of the following:
- mouseover - The mouse moved over the host object, or the object moved under the mouse
- mouseout - The mouse moved out of the host object (after being over it)
- mousedown - A mouse button was depressed, while over the object
- mouseup - A mouse button was released
- click - A mouse button was depressed, and released, while over the object
- mousemove - The mouse was moved
Defined in: mouse.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.components.input.Mouse(name, priority)
Create a mouse 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 the component.
|
|
execute(renderContext, time, dt)
Perform the checks on the mouse info object, and also perform
intersection tests to be able to call mouse events.
|
|
Get the class name of this object
|
|
setHostObject(hostobj)
Deprecated in favor of #setGameObject
|
- Methods borrowed from class R.components.Base:
- getGameObject, getHostObject, getPriority, getType, getTypeString, release, setGameObject, 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.Mouse(name, priority)
Create a mouse input component.
- Parameters:
- name
- {String} The unique name of the component.
- priority
- {Number} The priority of the component among other input components.
Method Detail
destroy()
Destroy the component.
execute(renderContext, time, dt)
Perform the checks on the mouse info object, and also perform
intersection tests to be able to call mouse 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.Mouse"
setHostObject(hostobj)
Deprecated in favor of #setGameObject
- Parameters:
- hostobj