Navigation
These archived docs are for Phaser 2.2.2 Phaser 3 docs can be found on newdocs.phaser.io.
Phaser CE docs can be found on the Phaser CE Documentation site.

Constructor

PIXI. InteractionData

new InteractionData()

Holds all information related to an Interaction event

Source code: pixi/InteractionData.js, line 5

Public Properties

global : PIXI.Point

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

Source code: pixi/InteractionData.js, line 13

originalEvent : PIXI.Event

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

Source code: pixi/InteractionData.js, line 29

target : PIXI.Sprite

The target Sprite that was interacted with

Source code: pixi/InteractionData.js, line 21

Public Methods

getLocalPosition(displayObject, point) → {PIXI.Point}

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

Parameters
Name Type Argument 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)

Returns

A point containing the coordinates of the InteractionData position relative to the DisplayObject

Source code: pixi/InteractionData.js, line 38