@vpmedia/phaser 1.16.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/phaser/core/animation.js +28 -16
  4. package/src/phaser/core/animation_manager.js +34 -20
  5. package/src/phaser/core/animation_parser.js +1 -1
  6. package/src/phaser/core/array_set.js +17 -9
  7. package/src/phaser/core/cache.js +61 -45
  8. package/src/phaser/core/factory.js +10 -10
  9. package/src/phaser/core/frame_data.js +1 -1
  10. package/src/phaser/core/input.js +37 -20
  11. package/src/phaser/core/input_handler.js +1 -1
  12. package/src/phaser/core/input_mouse.js +16 -12
  13. package/src/phaser/core/input_mspointer.js +7 -7
  14. package/src/phaser/core/input_pointer.js +26 -17
  15. package/src/phaser/core/input_touch.js +7 -7
  16. package/src/phaser/core/loader.js +104 -75
  17. package/src/phaser/core/raf.js +1 -1
  18. package/src/phaser/core/scale_manager.js +27 -27
  19. package/src/phaser/core/scene_manager.js +9 -9
  20. package/src/phaser/core/sound.js +3 -3
  21. package/src/phaser/core/sound_manager.js +8 -8
  22. package/src/phaser/core/sound_sprite.js +3 -3
  23. package/src/phaser/core/timer.js +9 -9
  24. package/src/phaser/core/timer_event.js +2 -2
  25. package/src/phaser/core/tween.js +1 -1
  26. package/src/phaser/display/group.js +28 -20
  27. package/src/phaser/display/image.js +3 -1
  28. package/types/phaser/core/animation.d.ts +38 -26
  29. package/types/phaser/core/animation.d.ts.map +1 -1
  30. package/types/phaser/core/animation_manager.d.ts +54 -39
  31. package/types/phaser/core/animation_manager.d.ts.map +1 -1
  32. package/types/phaser/core/animation_parser.d.ts +2 -2
  33. package/types/phaser/core/array_set.d.ts +24 -16
  34. package/types/phaser/core/array_set.d.ts.map +1 -1
  35. package/types/phaser/core/cache.d.ts +79 -73
  36. package/types/phaser/core/cache.d.ts.map +1 -1
  37. package/types/phaser/core/factory.d.ts +17 -17
  38. package/types/phaser/core/factory.d.ts.map +1 -1
  39. package/types/phaser/core/frame_data.d.ts +2 -2
  40. package/types/phaser/core/frame_data.d.ts.map +1 -1
  41. package/types/phaser/core/input.d.ts +49 -32
  42. package/types/phaser/core/input.d.ts.map +1 -1
  43. package/types/phaser/core/input_handler.d.ts +2 -2
  44. package/types/phaser/core/input_handler.d.ts.map +1 -1
  45. package/types/phaser/core/input_mouse.d.ts +20 -19
  46. package/types/phaser/core/input_mouse.d.ts.map +1 -1
  47. package/types/phaser/core/input_mspointer.d.ts +15 -15
  48. package/types/phaser/core/input_mspointer.d.ts.map +1 -1
  49. package/types/phaser/core/input_pointer.d.ts +39 -30
  50. package/types/phaser/core/input_pointer.d.ts.map +1 -1
  51. package/types/phaser/core/input_touch.d.ts +15 -15
  52. package/types/phaser/core/input_touch.d.ts.map +1 -1
  53. package/types/phaser/core/loader.d.ts +118 -92
  54. package/types/phaser/core/loader.d.ts.map +1 -1
  55. package/types/phaser/core/raf.d.ts +3 -3
  56. package/types/phaser/core/raf.d.ts.map +1 -1
  57. package/types/phaser/core/scale_manager.d.ts +34 -34
  58. package/types/phaser/core/scale_manager.d.ts.map +1 -1
  59. package/types/phaser/core/scene_manager.d.ts +9 -9
  60. package/types/phaser/core/sound.d.ts +4 -4
  61. package/types/phaser/core/sound.d.ts.map +1 -1
  62. package/types/phaser/core/sound_manager.d.ts +12 -12
  63. package/types/phaser/core/sound_manager.d.ts.map +1 -1
  64. package/types/phaser/core/sound_sprite.d.ts +3 -3
  65. package/types/phaser/core/timer.d.ts +14 -14
  66. package/types/phaser/core/timer.d.ts.map +1 -1
  67. package/types/phaser/core/timer_event.d.ts +4 -4
  68. package/types/phaser/core/timer_event.d.ts.map +1 -1
  69. package/types/phaser/core/tween.d.ts +3 -3
  70. package/types/phaser/core/tween.d.ts.map +1 -1
  71. package/types/phaser/display/group.d.ts +38 -30
  72. package/types/phaser/display/group.d.ts.map +1 -1
  73. package/types/phaser/display/image.d.ts +7 -5
  74. package/types/phaser/display/image.d.ts.map +1 -1
@@ -12,8 +12,8 @@ import { Game } from './game';
12
12
  class WheelEventProxy {
13
13
  /**
14
14
  * TBD.
15
- * @param scaleFactor
16
- * @param deltaMode
15
+ * @param scaleFactor - TBD.
16
+ * @param deltaMode - TBD.
17
17
  */
18
18
  constructor(scaleFactor, deltaMode) {
19
19
  this._scaleFactor = scaleFactor;
@@ -25,7 +25,8 @@ class WheelEventProxy {
25
25
 
26
26
  /**
27
27
  * TBD.
28
- * @param event
28
+ * @param {WheelEvent} event - TBD.
29
+ * @returns {WheelEventProxy} TBD.
29
30
  */
30
31
  bindEvent(event) {
31
32
  // TODO
@@ -54,6 +55,7 @@ class WheelEventProxy {
54
55
 
55
56
  /**
56
57
  * TBD.
58
+ * @returns {number} TBD.
57
59
  */
58
60
  get deltaY() {
59
61
  return this._scaleFactor * (this.originalEvent.wheelDelta || this.originalEvent.detail) || 0;
@@ -61,6 +63,7 @@ class WheelEventProxy {
61
63
 
62
64
  /**
63
65
  * TBD.
66
+ * @returns {number} TBD.
64
67
  */
65
68
  get deltaX() {
66
69
  return this._scaleFactor * this.originalEvent.wheelDeltaX || 0;
@@ -81,6 +84,7 @@ export class Mouse {
81
84
  this.mouseOutCallback = null;
82
85
  this.mouseOverCallback = null;
83
86
  this.mouseWheelCallback = null;
87
+ this.mouseMoveCallback = null;
84
88
  this.capture = false;
85
89
  this.button = -1;
86
90
  this.wheelDelta = 0;
@@ -152,7 +156,7 @@ export class Mouse {
152
156
 
153
157
  /**
154
158
  * TBD.
155
- * @param event
159
+ * @param {MouseEvent} event - TBD.
156
160
  */
157
161
  onMouseDown(event) {
158
162
  this.event = event;
@@ -169,7 +173,7 @@ export class Mouse {
169
173
 
170
174
  /**
171
175
  * TBD.
172
- * @param event
176
+ * @param {MouseEvent} event - TBD.
173
177
  */
174
178
  onMouseMove(event) {
175
179
  this.event = event;
@@ -186,7 +190,7 @@ export class Mouse {
186
190
 
187
191
  /**
188
192
  * TBD.
189
- * @param event
193
+ * @param {MouseEvent} event - TBD.
190
194
  */
191
195
  onMouseUp(event) {
192
196
  this.event = event;
@@ -203,7 +207,7 @@ export class Mouse {
203
207
 
204
208
  /**
205
209
  * TBD.
206
- * @param event
210
+ * @param {MouseEvent} event - TBD.
207
211
  */
208
212
  onMouseUpGlobal(event) {
209
213
  if (!this.input.mousePointer.withinGame) {
@@ -217,7 +221,7 @@ export class Mouse {
217
221
 
218
222
  /**
219
223
  * TBD.
220
- * @param event
224
+ * @param {MouseEvent} event - TBD.
221
225
  */
222
226
  onMouseOutGlobal(event) {
223
227
  this.event = event;
@@ -236,7 +240,7 @@ export class Mouse {
236
240
 
237
241
  /**
238
242
  * TBD.
239
- * @param event
243
+ * @param {MouseEvent} event - TBD.
240
244
  */
241
245
  onMouseOut(event) {
242
246
  this.event = event;
@@ -256,7 +260,7 @@ export class Mouse {
256
260
 
257
261
  /**
258
262
  * TBD.
259
- * @param event
263
+ * @param {MouseEvent} event - TBD.
260
264
  */
261
265
  onMouseOver(event) {
262
266
  this.event = event;
@@ -269,7 +273,7 @@ export class Mouse {
269
273
 
270
274
  /**
271
275
  * TBD.
272
- * @param event
276
+ * @param {WheelEvent} event - TBD.
273
277
  */
274
278
  onMouseWheel(event) {
275
279
  if (this._wheelEvent) {
@@ -286,7 +290,7 @@ export class Mouse {
286
290
 
287
291
  /**
288
292
  * TBD.
289
- * @param event
293
+ * @param {MouseEvent} event - TBD.
290
294
  */
291
295
  eventPreventDefault(event) {
292
296
  if (this.capture) {
@@ -83,7 +83,7 @@ export class MSPointer {
83
83
 
84
84
  /**
85
85
  * TBD.
86
- * @param event
86
+ * @param {Event} event - TBD.
87
87
  */
88
88
  onPointerDown(event) {
89
89
  this.event = event;
@@ -104,7 +104,7 @@ export class MSPointer {
104
104
 
105
105
  /**
106
106
  * TBD.
107
- * @param event
107
+ * @param {Event} event - TBD.
108
108
  */
109
109
  onPointerMove(event) {
110
110
  this.event = event;
@@ -125,7 +125,7 @@ export class MSPointer {
125
125
 
126
126
  /**
127
127
  * TBD.
128
- * @param event
128
+ * @param {Event} event - TBD.
129
129
  */
130
130
  onPointerUp(event) {
131
131
  this.event = event;
@@ -146,7 +146,7 @@ export class MSPointer {
146
146
 
147
147
  /**
148
148
  * TBD.
149
- * @param event
149
+ * @param {Event} event - TBD.
150
150
  */
151
151
  onPointerUpGlobal(event) {
152
152
  if ((event.pointerType === 'mouse' || event.pointerType === 0x00000004) && !this.input.mousePointer.withinGame) {
@@ -161,7 +161,7 @@ export class MSPointer {
161
161
 
162
162
  /**
163
163
  * TBD.
164
- * @param event
164
+ * @param {Event} event - TBD.
165
165
  */
166
166
  onPointerOut(event) {
167
167
  this.event = event;
@@ -193,7 +193,7 @@ export class MSPointer {
193
193
 
194
194
  /**
195
195
  * TBD.
196
- * @param event
196
+ * @param {Event} event - TBD.
197
197
  */
198
198
  onPointerOver(event) {
199
199
  this.event = event;
@@ -213,7 +213,7 @@ export class MSPointer {
213
213
 
214
214
  /**
215
215
  * TBD.
216
- * @param event
216
+ * @param {Event} event - TBD.
217
217
  */
218
218
  eventPreventDefault(event) {
219
219
  if (this.capture) {
@@ -14,8 +14,8 @@ export class Pointer {
14
14
  /**
15
15
  * TBD.
16
16
  * @param {Game} game - TBD.
17
- * @param id
18
- * @param pointerMode
17
+ * @param {number} id - TBD.
18
+ * @param {number} pointerMode - TBD.
19
19
  */
20
20
  constructor(game, id, pointerMode) {
21
21
  this.game = game;
@@ -74,7 +74,7 @@ export class Pointer {
74
74
 
75
75
  /**
76
76
  * TBD.
77
- * @param event
77
+ * @param {MouseEvent|PointerEvent} event - TBD.
78
78
  */
79
79
  updateButtons(event) {
80
80
  if (event.type.toLowerCase().substr(-4) === 'down') {
@@ -88,7 +88,8 @@ export class Pointer {
88
88
 
89
89
  /**
90
90
  * TBD.
91
- * @param event
91
+ * @param {PointerEvent} event - TBD.
92
+ * @returns {Pointer} TBD.
92
93
  */
93
94
  start(event) {
94
95
  const input = this.game.input;
@@ -175,8 +176,9 @@ export class Pointer {
175
176
 
176
177
  /**
177
178
  * TBD.
178
- * @param event
179
- * @param fromClick
179
+ * @param {MouseEvent|PointerEvent} event - TBD.
180
+ * @param {boolean} fromClick - TBD.
181
+ * @returns {Pointer} TBD.
180
182
  */
181
183
  move(event, fromClick = false) {
182
184
  const input = this.game.input;
@@ -238,7 +240,8 @@ export class Pointer {
238
240
 
239
241
  /**
240
242
  * TBD.
241
- * @param fromClick
243
+ * @param {boolean} fromClick - TBD.
244
+ * @returns {boolean} TBD.
242
245
  */
243
246
  processInteractiveObjects(fromClick = false) {
244
247
  // Work out which object is on the top
@@ -299,8 +302,8 @@ export class Pointer {
299
302
 
300
303
  /**
301
304
  * TBD.
302
- * @param newTarget
303
- * @param silent
305
+ * @param newTarget - TBD.
306
+ * @param {boolean} silent - TBD.
304
307
  */
305
308
  swapTarget(newTarget, silent = false) {
306
309
  // Now we know the top-most item (if any) we can process it
@@ -331,7 +334,7 @@ export class Pointer {
331
334
 
332
335
  /**
333
336
  * TBD.
334
- * @param event
337
+ * @param {MouseEvent|PointerEvent} event - TBD.
335
338
  */
336
339
  leave(event) {
337
340
  this.withinGame = false;
@@ -340,7 +343,8 @@ export class Pointer {
340
343
 
341
344
  /**
342
345
  * TBD.
343
- * @param event
346
+ * @param {MouseEvent|PointerEvent} event - TBD.
347
+ * @returns {Pointer} TBD.
344
348
  */
345
349
  stop(event) {
346
350
  const input = this.game.input;
@@ -395,7 +399,8 @@ export class Pointer {
395
399
 
396
400
  /**
397
401
  * TBD.
398
- * @param duration - TBD.
402
+ * @param {number} duration - TBD.
403
+ * @returns {boolean} TBD.
399
404
  */
400
405
  justPressed(duration) {
401
406
  duration = duration || this.game.input.justPressedRate;
@@ -404,7 +409,8 @@ export class Pointer {
404
409
 
405
410
  /**
406
411
  * TBD.
407
- * @param duration - TBD.
412
+ * @param {number} duration - TBD.
413
+ * @returns {boolean} TBD.
408
414
  */
409
415
  justReleased(duration) {
410
416
  duration = duration || this.game.input.justReleasedRate;
@@ -413,10 +419,10 @@ export class Pointer {
413
419
 
414
420
  /**
415
421
  * TBD.
416
- * @param name
417
- * @param callback - TBD.
418
- * @param callbackContext
419
- * @param callbackArgs
422
+ * @param {string} name - TBD.
423
+ * @param {Function} callback - TBD.
424
+ * @param {object} callbackContext - TBD.
425
+ * @param callbackArgs - TBD.
420
426
  */
421
427
  addClickTrampoline(name, callback, callbackContext, callbackArgs) {
422
428
  if (!this.isDown) {
@@ -488,6 +494,7 @@ export class Pointer {
488
494
 
489
495
  /**
490
496
  * TBD.
497
+ * @returns {number} TBD.
491
498
  */
492
499
  get duration() {
493
500
  if (this.isUp) {
@@ -498,6 +505,7 @@ export class Pointer {
498
505
 
499
506
  /**
500
507
  * TBD.
508
+ * @returns {number} TBD.
501
509
  */
502
510
  get worldX() {
503
511
  return this.x;
@@ -505,6 +513,7 @@ export class Pointer {
505
513
 
506
514
  /**
507
515
  * TBD.
516
+ * @returns {number} TBD.
508
517
  */
509
518
  get worldY() {
510
519
  return this.y;
@@ -75,7 +75,7 @@ export class Touch {
75
75
 
76
76
  /**
77
77
  * TBD.
78
- * @param event
78
+ * @param {TouchEvent} event - TBD.
79
79
  */
80
80
  onTouchStart(event) {
81
81
  this.event = event;
@@ -96,7 +96,7 @@ export class Touch {
96
96
 
97
97
  /**
98
98
  * TBD.
99
- * @param event
99
+ * @param {TouchEvent} event - TBD.
100
100
  */
101
101
  onTouchCancel(event) {
102
102
  this.event = event;
@@ -116,7 +116,7 @@ export class Touch {
116
116
 
117
117
  /**
118
118
  * TBD.
119
- * @param event
119
+ * @param {TouchEvent} event - TBD.
120
120
  */
121
121
  onTouchEnter(event) {
122
122
  this.event = event;
@@ -131,7 +131,7 @@ export class Touch {
131
131
 
132
132
  /**
133
133
  * TBD.
134
- * @param event
134
+ * @param {TouchEvent} event - TBD.
135
135
  */
136
136
  onTouchLeave(event) {
137
137
  this.event = event;
@@ -143,7 +143,7 @@ export class Touch {
143
143
 
144
144
  /**
145
145
  * TBD.
146
- * @param event
146
+ * @param {TouchEvent} event - TBD.
147
147
  */
148
148
  onTouchMove(event) {
149
149
  this.event = event;
@@ -158,7 +158,7 @@ export class Touch {
158
158
 
159
159
  /**
160
160
  * TBD.
161
- * @param event
161
+ * @param {TouchEvent} event - TBD.
162
162
  */
163
163
  onTouchEnd(event) {
164
164
  this.event = event;
@@ -176,7 +176,7 @@ export class Touch {
176
176
 
177
177
  /**
178
178
  * TBD.
179
- * @param event
179
+ * @param {TouchEvent} event - TBD.
180
180
  */
181
181
  eventPreventDefault(event) {
182
182
  if (this.preventDefault) {