- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
import { FederatedMouseEvent } from './FederatedMouseEvent';
/**
* A {@link PIXI.FederatedEvent} for pointer events.
* @memberof PIXI
*/
export class FederatedPointerEvent extends FederatedMouseEvent implements PointerEvent
{
/**
* The unique identifier of the pointer.
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId}
*/
public pointerId: 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 width = 0;
/**
* 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
*/
public height = 0;
/**
* 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
*/
public isPrimary = false;
/**
* The type of pointer that triggered the event.
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType
*/
public pointerType: string;
/**
* Pressure applied by the pointing device during the event.
*s
* A Touch's force property will be represented by this value.
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure
*/
public pressure: number;
/**
* Barrel pressure on a stylus pointer.
* @see https://w3c.github.io/pointerevents/#pointerevent-interface
*/
public tangentialPressure: number;
/**
* The angle, in degrees, between the pointer device and the screen.
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX
*/
public tiltX: number;
/**
* The angle, in degrees, between the pointer device and the screen.
* @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY
*/
public tiltY: number;
/**
* Twist of a stylus pointer.
* @see https://w3c.github.io/pointerevents/#pointerevent-interface
*/
public twist: number;
/** This is the number of clicks that occurs in 200ms/click of each other. */
public detail: number;
// Only included for completeness for now
getCoalescedEvents(): PointerEvent[]
{
if (this.type === 'pointermove' || this.type === 'mousemove' || this.type === 'touchmove')
{
return [this];
}
return [];
}
// Only included for completeness for now
getPredictedEvents(): PointerEvent[]
{
throw new Error('getPredictedEvents is not supported!');
}
}