PIXI.InteractionData

class InteractionData

Holds all information related to an Interaction event

Summary


Properties from InteractionData

number
button
number
buttons
PIXI.Point
global

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

number
height
number
identifier

Unique identifier for this interaction.

boolean
isPrimary
MouseEvent | TouchEvent | PointerEvent
originalEvent
number
pointerId
string
pointerType
number
pressure = 0
number
rotationAngle = 0
number
tangentialPressure = 0
PIXI.DisplayObject
target

The target Sprite that was interacted with.

number
tiltX
number
tiltY
number
twist = 0
number
width

Methods from InteractionData

void
copyEvent(event: Touch | MouseEvent | PointerEvent)
P
getLocalPosition(displayObject: PIXI.DisplayObject, point: P, globalPos: IPointData)
void
reset()

Resets the data for pooling.

Public Properties


button InteractionData.ts:38
button: number

Indicates which button was pressed on the mouse or pointer device to trigger the event.

See: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
buttons InteractionData.ts:44
buttons: number

Indicates which buttons are pressed on the mouse or pointer device when the event is triggered.

See: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
global InteractionData.ts:14
global: PIXI.Point

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

height InteractionData.ts:57
height: number

The height of the pointer's contact along the y-axis, measured in CSS pixels. radiusY of TouchEvents will be represented by this value.

See: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height
identifier InteractionData.ts:29
identifier: number

Unique identifier for this interaction.

isPrimary InteractionData.ts:32
isPrimary: boolean

Indicates whether or not the pointer device that created the event is the primary pointer.

See: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary
originalEvent InteractionData.ts:20
originalEvent: MouseEvent | TouchEvent | PointerEvent

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

See:
pointerId InteractionData.ts:127
pointerId: number

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

See: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId
pointerType InteractionData.ts:76
pointerType: string

The type of pointer that triggered the event.

See: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType
pressure InteractionData.ts:82
pressure: number = 0

Pressure applied by the pointing device during the event. A Touch's force property will be represented by this value.

See: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure
rotationAngle InteractionData.ts:89
rotationAngle: number = 0

From TouchEvents (not PointerEvents triggered by touches), the rotationAngle of the Touch.

See: https://developer.mozilla.org/en-US/docs/Web/API/Touch/rotationAngle
tangentialPressure InteractionData.ts:101
tangentialPressure: number = 0

Barrel pressure on a stylus pointer.

See: https://w3c.github.io/pointerevents/#pointerevent-interface
target InteractionData.ts:17
target: PIXI.DisplayObject

The target Sprite that was interacted with.

tiltX InteractionData.ts:64
tiltX: number

The angle, in degrees, between the pointer device and the screen.

See: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX
tiltY InteractionData.ts:70
tiltY: number

The angle, in degrees, between the pointer device and the screen.

See: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY
twist InteractionData.ts:95
twist: number = 0

Twist of a stylus pointer.

See: https://w3c.github.io/pointerevents/#pointerevent-interface
width InteractionData.ts:50
width: number

The width of the pointer's contact along the x-axis, measured in CSS pixels. radiusX of TouchEvents will be represented by this value.

See: https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width

Public Methods


copyEvent InteractionData.ts:153
copyEvent(event: Touch | MouseEvent | PointerEvent) → {void}

Copies properties from normalized event data.

Parameters:
Name Type Description
event Touch | MouseEvent | PointerEvent

The normalized event data

Returns:
Type Description
void
getLocalPosition InteractionData.ts:137
getLocalPosition(displayObject: PIXI.DisplayObject, point: P, globalPos: IPointData) → {P}

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

Parameters:
Name Type Attributes Description
displayObject PIXI.DisplayObject

The DisplayObject that you would like the local coords off

point P

<optional>

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

globalPos IPointData

<optional>

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

Returns:
Type Description
P
  • A point containing the coordinates of the InteractionData position relative to the DisplayObject
reset InteractionData.ts:183
reset() → {void}

Resets the data for pooling.

Returns:
Type Description
void

Powered by webdoc!