PIXI.InteractionData
class InteractionData
Holds all information related to an Interaction event
Summary
Properties from InteractionData
number |
|
number |
|
PIXI.Point |
This point stores the global coords of where the touch/mouse event happened. |
number |
|
number |
Unique identifier for this interaction. |
boolean |
|
MouseEvent | TouchEvent | PointerEvent |
|
number |
|
string |
|
number |
|
number |
|
number |
|
PIXI.DisplayObject |
The target Sprite that was interacted with. |
number |
|
number |
|
number |
|
number |
|
Methods from InteractionData
void |
|
P |
|
void |
Resets the data for pooling. |
Public Properties
button: number
Indicates which button was pressed on the mouse or pointer device to trigger the event.
buttons: number
Indicates which buttons are pressed on the mouse or pointer device when the event is triggered.
global: PIXI.Point
This point stores the global coords of where the touch/mouse event happened.
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.
isPrimary: boolean
Indicates whether or not the pointer device that created the event is the primary pointer.
originalEvent: MouseEvent | TouchEvent | PointerEvent
When passed to an event handler, this will be the original DOM Event that was captured
pointerId: number
The unique identifier of the pointer. It will be the same as identifier
.
pointerType: string
The type of pointer that triggered the event.
pressure: number = 0
Pressure applied by the pointing device during the event. A Touch's force property will be represented by this value.
rotationAngle: number = 0
From TouchEvents (not PointerEvents triggered by touches), the rotationAngle of the Touch.
tangentialPressure: number = 0
Barrel pressure on a stylus pointer.
tiltX: number
The angle, in degrees, between the pointer device and the screen.
tiltY: number
The angle, in degrees, between the pointer device and the screen.
twist: number = 0
Twist of a stylus pointer.
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.
Public Methods
copyEvent(event: Touch | MouseEvent | PointerEvent) → {void}
Copies properties from normalized event data.
Name | Type | Description |
---|---|---|
event | Touch | MouseEvent | PointerEvent |
The normalized event data |
Type | Description |
---|---|
void |
getLocalPosition(displayObject: PIXI.DisplayObject, point: P, globalPos: IPointData) → {P}
This will return the local coordinates of the specified displayObject for this InteractionData
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) |
Type | Description |
---|---|
P |
|
reset() → {void}
Resets the data for pooling.
Type | Description |
---|---|
void |