Class: InteractionData

PIXI.interaction.InteractionData

Holds all information related to an Interaction event

new PIXI.interaction.InteractionData ()

Members

global PIXI.Point

This point stores the global coords of where the touch/mouse event happened

identifier number

Unique identifier for this interaction

originalEvent MouseEvent | TouchEvent | PointerEvent

When passed to an event handler, this will be the original DOM Event that was captured

See:

pointerId number readonly

The unique identifier of the pointer. It will be the same as identifier.

See:

The target DisplayObject that was interacted with

Methods

copyEvent (event)

Copies properties from normalized event data.

Name Type Description
event Touch | MouseEvent | PointerEvent

The normalized event data

getLocalPosition (displayObject, point, globalPos)PIXI.Point

This will return the local coordinates of the specified displayObject for this InteractionData

Name Type Description
displayObject PIXI.DisplayObject

The DisplayObject that you would like the local coords off

point PIXI.Point optional

A Point object in which to store the value, optional (otherwise will create a new point)

globalPos PIXI.Point optional

A Point object containing your custom global coords, optional (otherwise will use the current global coords)

Returns:
Type Description
PIXI.Point A point containing the coordinates of the InteractionData position relative to the DisplayObject

Resets the data for pooling.