You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ScaleManager.bounds is a Rectangle object that holds the exact size of the game canvas, taking DOM offset and game scale into account.
Pointer.withinGame is now accurate based on game scale and updated as the Pointer moves.
Stage.bounds is now updated if the game canvas offset changes position. Note that it gives the un-scaled game dimensions.
Copy file name to clipboardExpand all lines: README.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ Version 2.0.5 - "Tanchico" - in development
58
58
59
59
### Updates
60
60
61
-
* TypeScript definitions fixes and updates (thanks @luispedrofonseca@clark-stevenson@Anahkiasen@adamholdenyall@luispedrofonseca)
61
+
* TypeScript definitions fixes and updates (thanks @luispedrofonseca@clark-stevenson@Anahkiasen@adamholdenyall@luispedrofonseca@WillHuxtable)
62
62
* Input.getPointerFromIdentifier docs update to reflect where the identifier comes from. Pointer properties now set to give it fixed defaults (thanks @JirkaDellOro, #793)
63
63
* Pointer.pointerId added which is set by the DOM event (if present in the browser). Note that browsers can and do recycle pointer IDs.
64
64
* Pointer.type and Pointer.exists properties added.
@@ -69,6 +69,8 @@ Version 2.0.5 - "Tanchico" - in development
69
69
* PIXI.InteractionManager is no longer over-written if the object already exists (thanks @georgiee, #818)
70
70
* Key.justPressed and justReleased incorrectly set the delay value to 2500ms. Now defaults to 50ms (thanks @draklaw, fix #797)
71
71
* Stage.backgroundColor can now accept short-code hex values: `#222`, `#334`, etc.
72
+
* Pointer.withinGame is now accurate based on game scale and updated as the Pointer moves.
73
+
* Stage.bounds is now updated if the game canvas offset changes position. Note that it gives the un-scaled game dimensions.
72
74
73
75
74
76
### New Features
@@ -79,7 +81,7 @@ Version 2.0.5 - "Tanchico" - in development
79
81
* Input.getPointerFromId will return a pointer with a matching pointerId value, if any. pointerId is a value set by the browser in the DOM event.
80
82
* ArcadePhysics.getObjectsUnderPointer will return all children from a Group that overlap with the given Pointer.
81
83
* InputManager.minPriorityID lets you set the minimum priority level an object needs to be to be checked by a Pointer. Useful for UI layer stacking.
82
-
* New consts: Phaser.Tilemap.NORTH, SOUTH, EAST and WEST to use with the TileMapWalker Plugin.
84
+
* New consts: Phaser.Tilemap.NORTH, SOUTH, EAST and WEST to use with the TileMapWalker Plugin but generally just handy to have anyway.
* Phaser.Utils.transposeArray will transpose the given array and return it.
85
87
* Phaser.Utils.rotateArray will rotate the given array by 90 or 180 degrees in either direction and return it.
@@ -111,6 +113,8 @@ Version 2.0.5 - "Tanchico" - in development
111
113
* Cache.checkBitmapFontKey(key) - Check if a BitmapFont key exists in the cache (thanks to @delta11 for the proposal)
112
114
* Cache.checkJSONKey(key) - Check if a JSON key exists in the cache (thanks to @delta11 for the proposal)
113
115
* New movement data added for a Pointer Locked mouse (Pointer.movementX/Y) (thanks @woutercommandeur, #831)
116
+
* ScaleManager.bounds is a Rectangle object that holds the exact size of the game canvas, taking DOM offset and game scale into account.
117
+
114
118
115
119
116
120
### New Plugins
@@ -178,7 +182,9 @@ Note: Some of you may not be aware, but the `phaser.min.js` file in the build fo
178
182
179
183
## Koding
180
184
181
-
You can [][koding] and then start editing and previewing code right away using their web based VM development system.
You can [clone the Phaser repo in Koding](http://learn.koding.com/btn/clone_d.png) and then start editing and previewing code right away using their web based VM development system.
182
188
183
189

184
190
@@ -393,6 +399,5 @@ Phaser is released under the [MIT License](http://opensource.org/licenses/MIT).
* @property {Phaser.Rectangle} bounds - The bounds of the scaled game. The x/y will match the offset of the canvas element and the width/height the scaled width and height.
* @property {Phaser.Rectangle} bounds - The bounds of the Stage. Typically x/y = Stage.offset.x/y and the width/height match the game width and height.
Copy file name to clipboardExpand all lines: src/input/Pointer.js
+17-23Lines changed: 17 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -77,90 +77,82 @@ Phaser.Pointer = function (game, id) {
77
77
/**
78
78
* @property {number} _nextDrop - Local private variable storing the time at which the next history drop should occur.
79
79
* @private
80
-
* @default
81
80
*/
82
81
this._nextDrop=0;
83
82
84
83
/**
85
84
* @property {boolean} _stateReset - Monitor events outside of a state reset loop.
86
85
* @private
87
-
* @default
88
86
*/
89
87
this._stateReset=false;
90
88
91
89
/**
92
-
* @property {boolean} withinGame - true if the Pointer is within the game area, otherwise false.
90
+
* @property {boolean} withinGame - true if the Pointer is over the game canvas, otherwise false.
93
91
*/
94
92
this.withinGame=false;
95
93
96
94
/**
97
-
* @property {number} clientX - The horizontal coordinate of point relative to the viewport in pixels, excluding any scroll offset.
98
-
* @default
95
+
* @property {number} clientX - The horizontal coordinate of the Pointer within the application's client area at which the event occurred (as opposed to the coordinates within the page).
99
96
*/
100
97
this.clientX=-1;
101
98
102
99
/**
103
-
* @property {number} clientY - The vertical coordinate of point relative to the viewport in pixels, excluding any scroll offset.
104
-
* @default
100
+
* @property {number} clientY - The vertical coordinate of the Pointer within the application's client area at which the event occurred (as opposed to the coordinates within the page).
105
101
*/
106
102
this.clientY=-1;
107
103
108
104
/**
109
-
* @property {number} pageX - The horizontal coordinate of point relative to the viewport in pixels, including any scroll offset.
110
-
* @default
105
+
* @property {number} pageX - The horizontal coordinate of the Pointer relative to whole document.
111
106
*/
112
107
this.pageX=-1;
113
108
114
109
/**
115
-
* @property {number} pageY - The vertical coordinate of point relative to the viewport in pixels, including any scroll offset.
116
-
* @default
110
+
* @property {number} pageY - The vertical coordinate of the Pointer relative to whole document.
117
111
*/
118
112
this.pageY=-1;
119
113
120
114
/**
121
-
* @property {number} screenX - The horizontal coordinate of point relative to the screen in pixels.
122
-
* @default
115
+
* @property {number} screenX - The horizontal coordinate of the Pointer relative to the screen.
123
116
*/
124
117
this.screenX=-1;
125
118
126
119
/**
127
-
* @property {number} screenY - The vertical coordinate of point relative to the screen in pixels.
128
-
* @default
120
+
* @property {number} screenY - The vertical coordinate of the Pointer relative to the screen.
129
121
*/
130
122
this.screenY=-1;
131
123
132
124
/**
133
-
* @property {number} rawMovementX - The horizontal raw relative movement of pointer in pixels since last event.
125
+
* @property {number} rawMovementX - The horizontal raw relative movement of the Pointer in pixels since last event.
134
126
* @default
135
127
*/
136
128
this.rawMovementX=0;
137
129
138
130
/**
139
-
* @property {number} rawMovementY - The vertical raw relative movement of pointer in pixels since last event.
131
+
* @property {number} rawMovementY - The vertical raw relative movement of the Pointer in pixels since last event.
140
132
* @default
141
133
*/
142
134
this.rawMovementY=0;
143
135
144
136
/**
145
-
* @property {number} movementX - The horizontal processed relative movement of pointer in pixels since last event.
137
+
* @property {number} movementX - The horizontal processed relative movement of the Pointer in pixels since last event.
146
138
* @default
147
139
*/
148
140
this.movementX=0;
149
141
150
142
/**
151
-
* @property {number} movementY - The vertical processed relative movement of pointer in pixels since last event.
143
+
* @property {number} movementY - The vertical processed relative movement of the Pointer in pixels since last event.
152
144
* @default
153
145
*/
154
146
this.movementY=0;
155
147
156
148
/**
157
-
* @property {number} x - The horizontal coordinate of point relative to the game element. This value is automatically scaled based on game size.
149
+
* @property {number} x - The horizontal coordinate of the Pointer. This value is automatically scaled based on the game scale.
158
150
* @default
159
151
*/
160
152
this.x=-1;
161
153
162
154
/**
163
-
* @property {number} y - The vertical coordinate of point relative to the game element. This value is automatically scaled based on game size.
155
+
* @property {number} y - The vertical coordinate of the Pointer. This value is automatically scaled based on the game scale.
164
156
* @default
165
157
*/
166
158
this.y=-1;
@@ -208,7 +200,7 @@ Phaser.Pointer = function (game, id) {
208
200
this.totalTouches=0;
209
201
210
202
/**
211
-
* @property {number} msSinceLastClick - The number of miliseconds since the last click.
203
+
* @property {number} msSinceLastClick - The number of milliseconds since the last click or touch event.
0 commit comments