Class: ElementInput

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.

Constructor

new ElementInput(domElement, optionsopt)

Create a new pc.ElementInput instance.
Parameters:
Name Type Attributes Description
domElement Element The DOM element
options Object <optional>
Optional arguments
Properties
Name Type Attributes Description
useMouse Object <optional>
Whether to allow mouse input. Defaults to true.
useTouch Object <optional>
Whether to allow touch input. Defaults to true.
Source:

Methods

addElement(element)

Add a pc.ElementComponent to the internal list of ElementComponents that are being checked for input.
Parameters:
Name Type Description
element pc.ElementComponent The ElementComponent
Source:

attach(domElement)

Attach mouse and touch events to a DOM element.
Parameters:
Name Type Description
domElement Element The DOM element
Source:

detach()

Remove mouse and touch events from the DOM element that it is attached to
Source:

removeElement(element)

Remove a pc.ElementComponent from the internal list of ElementComponents that are being checked for input.
Parameters:
Name Type Description
element pc.ElementComponent The ElementComponent
Source: