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

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

domElementElement

The DOM element.

optionsobject

Optional arguments.

options.useMouseboolean

Whether to allow mouse input. Defaults to true.

options.useTouchboolean

Whether to allow touch input. Defaults to true.

options.useXrboolean

Whether to allow XR input sources. Defaults to true.

Methods

addElement(element)

Add a pc.ElementComponent to the internal list of ElementComponents that are being checked for input.

Parameters

elementpc.ElementComponent

The ElementComponent.

attach(domElement)

Attach mouse and touch events to a DOM element.

Parameters

domElementElement

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

elementpc.ElementComponent

The ElementComponent.