API Reference

Class List

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

addElementAdd a pc.ElementComponent to the internal list of ElementComponents that are being checked for input.
attachAttach mouse and touch events to a DOM element.
detachRemove mouse and touch events from the DOM element that it is attached to
removeElementRemove 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

domElementElementThe DOM element
optionsObjectOptional arguments
options.useMouseObjectWhether to allow mouse input. Defaults to true.
options.useTouchObjectWhether 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

elementpc.ElementComponentThe ElementComponent

attach(domElement)

Attach mouse and touch events to a DOM element.

Parameters

domElementElementThe 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

elementpc.ElementComponentThe ElementComponent