pc.ElementInput
Handles mouse and touch events for pc.ElementComponents. When input events occur on an ElementComponent this fires the appropriate events on the ElementComponent.
Summary
Methods
addElement | Add a pc.ElementComponent to the internal list of ElementComponents that are being checked for input. |
attach | Attach mouse and touch events to a DOM element. |
detach | Remove mouse and touch events from the DOM element that it is attached to |
removeElement | Remove a pc.ElementComponent from the internal list of ElementComponents that are being checked for input. |
Details
Constructor
ElementInput(domElement, [options])
Create a new pc.ElementInput instance.
Parameters
domElement | Element | The DOM element |
options | Object | Optional arguments |
options.useMouse | Object | Whether to allow mouse input. Defaults to true. |
options.useTouch | Object | Whether to allow touch input. Defaults to true. |
Methods
addElement(element)
Add a pc.ElementComponent to the internal list of ElementComponents that are being checked for input.
Parameters
element | pc.ElementComponent | The ElementComponent |
attach(domElement)
Attach mouse and touch events to a DOM element.
Parameters
domElement | Element | The DOM element |
detach()
Remove mouse and touch events from the DOM element that it is attached to
removeElement(element)
Remove a pc.ElementComponent from the internal list of ElementComponents that are being checked for input.
Parameters
element | pc.ElementComponent | The ElementComponent |