Skip to content

Commit 285b811

Browse files
committed
Pointer has two new properties worldX and worldY which contain the position of the Pointer, translated into the coordinate space of the most recent Camera it interacted with.
1 parent 15af7c6 commit 285b811

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

src/input/Pointer.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var Pointer = new Class({
5656
* [description]
5757
*
5858
* @name Phaser.Input.Pointer#event
59-
* @type {null}
59+
* @type {any}
6060
* @since 3.0.0
6161
*/
6262
this.event;
@@ -97,6 +97,26 @@ var Pointer = new Class({
9797
*/
9898
this.position = new Vector2();
9999

100+
/**
101+
* The x position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with.
102+
*
103+
* @name Phaser.Input.Pointer#worldX
104+
* @type {number}
105+
* @default 0
106+
* @since 3.10.0
107+
*/
108+
this.worldX = 0;
109+
110+
/**
111+
* The y position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with.
112+
*
113+
* @name Phaser.Input.Pointer#worldY
114+
* @type {number}
115+
* @default 0
116+
* @since 3.10.0
117+
*/
118+
this.worldY = 0;
119+
100120
/**
101121
* X coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects.
102122
*

0 commit comments

Comments
 (0)