@vpmedia/phaser 1.18.0 → 1.19.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 (80) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -2
  3. package/src/phaser/core/cache.js +37 -16
  4. package/src/phaser/core/dom.js +3 -3
  5. package/src/phaser/core/input.js +13 -12
  6. package/src/phaser/core/input_handler.js +2 -1
  7. package/src/phaser/core/input_mouse.js +3 -2
  8. package/src/phaser/core/input_pointer.js +2 -1
  9. package/src/phaser/core/loader.js +70 -69
  10. package/src/phaser/core/scene_manager.js +1 -1
  11. package/src/phaser/core/signal_binding.js +16 -7
  12. package/src/phaser/core/tween.js +5 -4
  13. package/src/phaser/core/tween_data.js +2 -1
  14. package/src/phaser/display/canvas/renderer.js +8 -5
  15. package/src/phaser/display/display_object.js +2 -0
  16. package/src/phaser/display/graphics.js +4 -4
  17. package/src/phaser/display/image.js +6 -4
  18. package/src/phaser/display/text.js +41 -30
  19. package/src/phaser/display/webgl/abstract_filter.js +1 -1
  20. package/src/phaser/display/webgl/fast_sprite_batch.js +3 -1
  21. package/src/phaser/display/webgl/graphics.js +6 -6
  22. package/src/phaser/display/webgl/render_texture.js +3 -1
  23. package/src/phaser/display/webgl/renderer.js +9 -5
  24. package/src/phaser/display/webgl/shader/normal.js +1 -1
  25. package/src/phaser/display/webgl/shader_manager.js +3 -2
  26. package/src/phaser/display/webgl/sprite_batch.js +2 -1
  27. package/src/phaser/display/webgl/stencil_manager.js +8 -6
  28. package/typedefs/global.d.ts +1 -1
  29. package/types/phaser/core/cache.d.ts +68 -44
  30. package/types/phaser/core/cache.d.ts.map +1 -1
  31. package/types/phaser/core/dom.d.ts +6 -6
  32. package/types/phaser/core/dom.d.ts.map +1 -1
  33. package/types/phaser/core/input.d.ts +20 -19
  34. package/types/phaser/core/input.d.ts.map +1 -1
  35. package/types/phaser/core/input_handler.d.ts +5 -4
  36. package/types/phaser/core/input_handler.d.ts.map +1 -1
  37. package/types/phaser/core/input_mouse.d.ts +1 -1
  38. package/types/phaser/core/input_mouse.d.ts.map +1 -1
  39. package/types/phaser/core/input_pointer.d.ts +3 -2
  40. package/types/phaser/core/input_pointer.d.ts.map +1 -1
  41. package/types/phaser/core/loader.d.ts +104 -103
  42. package/types/phaser/core/loader.d.ts.map +1 -1
  43. package/types/phaser/core/scene_manager.d.ts +2 -2
  44. package/types/phaser/core/scene_manager.d.ts.map +1 -1
  45. package/types/phaser/core/signal_binding.d.ts +23 -15
  46. package/types/phaser/core/signal_binding.d.ts.map +1 -1
  47. package/types/phaser/core/tween.d.ts +8 -8
  48. package/types/phaser/core/tween.d.ts.map +1 -1
  49. package/types/phaser/core/tween_data.d.ts +6 -5
  50. package/types/phaser/core/tween_data.d.ts.map +1 -1
  51. package/types/phaser/display/button.d.ts +3 -2
  52. package/types/phaser/display/button.d.ts.map +1 -1
  53. package/types/phaser/display/canvas/renderer.d.ts +10 -7
  54. package/types/phaser/display/canvas/renderer.d.ts.map +1 -1
  55. package/types/phaser/display/display_object.d.ts +5 -3
  56. package/types/phaser/display/display_object.d.ts.map +1 -1
  57. package/types/phaser/display/graphics.d.ts +6 -6
  58. package/types/phaser/display/graphics.d.ts.map +1 -1
  59. package/types/phaser/display/image.d.ts +14 -11
  60. package/types/phaser/display/image.d.ts.map +1 -1
  61. package/types/phaser/display/text.d.ts +61 -50
  62. package/types/phaser/display/text.d.ts.map +1 -1
  63. package/types/phaser/display/webgl/abstract_filter.d.ts +3 -3
  64. package/types/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
  65. package/types/phaser/display/webgl/fast_sprite_batch.d.ts +3 -2
  66. package/types/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
  67. package/types/phaser/display/webgl/graphics.d.ts +13 -12
  68. package/types/phaser/display/webgl/graphics.d.ts.map +1 -1
  69. package/types/phaser/display/webgl/render_texture.d.ts +5 -3
  70. package/types/phaser/display/webgl/render_texture.d.ts.map +1 -1
  71. package/types/phaser/display/webgl/renderer.d.ts +12 -8
  72. package/types/phaser/display/webgl/renderer.d.ts.map +1 -1
  73. package/types/phaser/display/webgl/shader/normal.d.ts +2 -2
  74. package/types/phaser/display/webgl/shader/normal.d.ts.map +1 -1
  75. package/types/phaser/display/webgl/shader_manager.d.ts +6 -5
  76. package/types/phaser/display/webgl/shader_manager.d.ts.map +1 -1
  77. package/types/phaser/display/webgl/sprite_batch.d.ts +3 -2
  78. package/types/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
  79. package/types/phaser/display/webgl/stencil_manager.d.ts +11 -9
  80. package/types/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
@@ -1,5 +1,6 @@
1
1
  import { Signal } from './signal';
2
2
  import { Rectangle } from '../geom/rectangle';
3
+ import { Image } from '../display/image';
3
4
  import { canPlayAudio } from './device_util';
4
5
  import { Game } from './game';
5
6
 
@@ -47,8 +48,8 @@ export class Loader {
47
48
 
48
49
  /**
49
50
  * TBD.
50
- * @param sprite - TBD.
51
- * @param direction - TBD.
51
+ * @param {Image} sprite - TBD.
52
+ * @param {number} direction - TBD.
52
53
  */
53
54
  setPreloadSprite(sprite, direction = 0) {
54
55
  this.preloadSprite = {
@@ -80,7 +81,7 @@ export class Loader {
80
81
 
81
82
  /**
82
83
  * TBD.
83
- * @param type - TBD.
84
+ * @param {string} type - TBD.
84
85
  * @param {string} key - TBD.
85
86
  * @returns {boolean} TBD.
86
87
  */
@@ -90,7 +91,7 @@ export class Loader {
90
91
 
91
92
  /**
92
93
  * TBD.
93
- * @param type - TBD.
94
+ * @param {string} type - TBD.
94
95
  * @param {string} key - TBD.
95
96
  * @returns {number} TBD.
96
97
  */
@@ -112,7 +113,7 @@ export class Loader {
112
113
 
113
114
  /**
114
115
  * TBD.
115
- * @param type - TBD.
116
+ * @param {string} type - TBD.
116
117
  * @param {string} key - TBD.
117
118
  * @returns {object} TBD.
118
119
  */
@@ -126,10 +127,10 @@ export class Loader {
126
127
 
127
128
  /**
128
129
  * TBD.
129
- * @param hard
130
- * @param clearEvents
130
+ * @param {boolean} hard - TBD.
131
+ * @param {boolean} clearEvents - TBD.
131
132
  */
132
- reset(hard, clearEvents = false) {
133
+ reset(hard = false, clearEvents = false) {
133
134
  if (hard) {
134
135
  this.preloadSprite = null;
135
136
  }
@@ -154,12 +155,12 @@ export class Loader {
154
155
 
155
156
  /**
156
157
  * TBD.
157
- * @param type - TBD.
158
+ * @param {string} type - TBD.
158
159
  * @param {string} key - TBD.
159
160
  * @param {string} url - TBD.
160
- * @param properties - TBD.
161
- * @param overwrite - TBD.
162
- * @param extension - TBD.
161
+ * @param {object} properties - TBD.
162
+ * @param {boolean} overwrite - TBD.
163
+ * @param {string} extension - TBD.
163
164
  * @returns {Loader} TBD.
164
165
  */
165
166
  addToFileList(type, key = '', url = null, properties = null, overwrite = false, extension = null) {
@@ -211,10 +212,10 @@ export class Loader {
211
212
 
212
213
  /**
213
214
  * TBD.
214
- * @param type - TBD.
215
+ * @param {string} type - TBD.
215
216
  * @param {string} key - TBD.
216
217
  * @param {string} url - TBD.
217
- * @param properties - TBD.
218
+ * @param {object} properties - TBD.
218
219
  * @returns {Loader} TBD.
219
220
  */
220
221
  replaceInFileList(type, key, url, properties) {
@@ -225,7 +226,7 @@ export class Loader {
225
226
  * TBD.
226
227
  * @param {string} key - TBD.
227
228
  * @param {string} url - TBD.
228
- * @param data - TBD.
229
+ * @param {object} data - TBD.
229
230
  * @param {object} callbackContext - TBD.
230
231
  * @returns {Loader} TBD.
231
232
  */
@@ -264,17 +265,17 @@ export class Loader {
264
265
  * TBD.
265
266
  * @param {string} key - TBD.
266
267
  * @param {string} url - TBD.
267
- * @param overwrite - TBD.
268
+ * @param {boolean} overwrite - TBD.
268
269
  * @returns {Loader} TBD.
269
270
  */
270
- image(key, url, overwrite) {
271
+ image(key, url, overwrite = false) {
271
272
  return this.addToFileList('image', key, url, undefined, overwrite, '.png');
272
273
  }
273
274
 
274
275
  /**
275
276
  * TBD.
276
- * @param keys - TBD.
277
- * @param urls - TBD.
277
+ * @param {string[]} keys - TBD.
278
+ * @param {string[]} urls - TBD.
278
279
  * @returns {Loader} TBD.
279
280
  */
280
281
  images(keys, urls) {
@@ -294,7 +295,7 @@ export class Loader {
294
295
  * TBD.
295
296
  * @param {string} key - TBD.
296
297
  * @param {string} url - TBD.
297
- * @param overwrite - TBD.
298
+ * @param {boolean} overwrite - TBD.
298
299
  * @returns {Loader} TBD.
299
300
  */
300
301
  text(key, url, overwrite) {
@@ -305,7 +306,7 @@ export class Loader {
305
306
  * TBD.
306
307
  * @param {string} key - TBD.
307
308
  * @param {string} url - TBD.
308
- * @param overwrite - TBD.
309
+ * @param {boolean} overwrite - TBD.
309
310
  * @returns {Loader} TBD.
310
311
  */
311
312
  json(key, url, overwrite) {
@@ -316,7 +317,7 @@ export class Loader {
316
317
  * TBD.
317
318
  * @param {string} key - TBD.
318
319
  * @param {string} url - TBD.
319
- * @param overwrite - TBD.
320
+ * @param {boolean} overwrite - TBD.
320
321
  * @returns {Loader} TBD.
321
322
  */
322
323
  xml(key, url, overwrite) {
@@ -327,11 +328,11 @@ export class Loader {
327
328
  * TBD.
328
329
  * @param {string} key - TBD.
329
330
  * @param {string} url - TBD.
330
- * @param frameWidth - TBD.
331
- * @param frameHeight - TBD.
332
- * @param frameMax - TBD.
333
- * @param margin - TBD.
334
- * @param spacing - TBD.
331
+ * @param {number} frameWidth - TBD.
332
+ * @param {number} frameHeight - TBD.
333
+ * @param {number} frameMax - TBD.
334
+ * @param {number} margin - TBD.
335
+ * @param {number} spacing - TBD.
335
336
  * @returns {Loader} TBD.
336
337
  */
337
338
  spritesheet(key, url, frameWidth, frameHeight, frameMax = -1, margin = 0, spacing = 0) {
@@ -348,8 +349,8 @@ export class Loader {
348
349
  /**
349
350
  * TBD.
350
351
  * @param {string} key - TBD.
351
- * @param urls
352
- * @param autoDecode
352
+ * @param {string[]} urls - TBD.
353
+ * @param {boolean} autoDecode - TBD.
353
354
  * @returns {Loader} TBD.
354
355
  */
355
356
  audio(key, urls, autoDecode = true) {
@@ -365,10 +366,10 @@ export class Loader {
365
366
  /**
366
367
  * TBD.
367
368
  * @param {string} key - TBD.
368
- * @param urls - TBD.
369
- * @param jsonURL - TBD.
370
- * @param jsonData - TBD.
371
- * @param autoDecode - TBD.
369
+ * @param {string} urls - TBD.
370
+ * @param {string} jsonURL - TBD.
371
+ * @param {object} jsonData - TBD.
372
+ * @param {boolean} autoDecode - TBD.
372
373
  * @returns {Loader} TBD.
373
374
  */
374
375
  audioSprite(key, urls, jsonURL, jsonData, autoDecode = true) {
@@ -390,11 +391,11 @@ export class Loader {
390
391
  /**
391
392
  * TBD.
392
393
  * @param {string} key - TBD.
393
- * @param textureURL - TBD.
394
- * @param atlasURL - TBD.
395
- * @param atlasData - TBD.
396
- * @param xSpacing - TBD.
397
- * @param ySpacing - TBD.
394
+ * @param {string} textureURL - TBD.
395
+ * @param {string} atlasURL - TBD.
396
+ * @param {object} atlasData - TBD.
397
+ * @param {number} xSpacing - TBD.
398
+ * @param {number} ySpacing - TBD.
398
399
  * @returns {Loader} TBD.
399
400
  * @throws Error.
400
401
  */
@@ -434,10 +435,10 @@ export class Loader {
434
435
  /**
435
436
  * TBD.
436
437
  * @param {string} key - TBD.
437
- * @param textureURL - TBD.
438
- * @param atlasURL - TBD.
439
- * @param atlasData - TBD.
440
- * @param format - TBD.
438
+ * @param {string} textureURL - TBD.
439
+ * @param {string} atlasURL - TBD.
440
+ * @param {object} atlasData - TBD.
441
+ * @param {number} format - TBD.
441
442
  * @returns {Loader} TBD.
442
443
  */
443
444
  atlas(key, textureURL, atlasURL = null, atlasData = null, format = TEXTURE_ATLAS_JSON_HASH) {
@@ -474,7 +475,7 @@ export class Loader {
474
475
 
475
476
  /**
476
477
  * TBD.
477
- * @param type - TBD.
478
+ * @param {string} type - TBD.
478
479
  * @param {string} key - TBD.
479
480
  * @returns {Loader} TBD.
480
481
  */
@@ -488,7 +489,7 @@ export class Loader {
488
489
 
489
490
  /**
490
491
  * TBD.
491
- * @param type - TBD.
492
+ * @param {string} type - TBD.
492
493
  * @param {string} key - TBD.
493
494
  */
494
495
  removeFile(type, key) {
@@ -621,7 +622,7 @@ export class Loader {
621
622
 
622
623
  /**
623
624
  * TBD.
624
- * @param abnormal - TBD.
625
+ * @param {boolean} abnormal - TBD.
625
626
  */
626
627
  finishedLoading(abnormal) {
627
628
  if (this.hasLoaded) {
@@ -644,8 +645,8 @@ export class Loader {
644
645
 
645
646
  /**
646
647
  * TBD.
647
- * @param file - TBD.
648
- * @param errorMessage - TBD.
648
+ * @param {object} file - TBD.
649
+ * @param {string} errorMessage - TBD.
649
650
  */
650
651
  asyncComplete(file, errorMessage = '') {
651
652
  file.loaded = true;
@@ -660,7 +661,7 @@ export class Loader {
660
661
 
661
662
  /**
662
663
  * TBD.
663
- * @param pack - TBD.
664
+ * @param {object} pack - TBD.
664
665
  */
665
666
  processPack(pack) {
666
667
  const packData = pack.data[pack.key];
@@ -724,7 +725,7 @@ export class Loader {
724
725
  /**
725
726
  * TBD.
726
727
  * @param {string} url - TBD.
727
- * @param file - TBD.
728
+ * @param {object} file - TBD.
728
729
  * @returns {string} TBD.
729
730
  */
730
731
  transformUrl(url, file) {
@@ -739,7 +740,7 @@ export class Loader {
739
740
 
740
741
  /**
741
742
  * TBD.
742
- * @param file - TBD.
743
+ * @param {object} file - TBD.
743
744
  */
744
745
  loadFile(file) {
745
746
  switch (file.type) {
@@ -777,7 +778,7 @@ export class Loader {
777
778
 
778
779
  /**
779
780
  * TBD.
780
- * @param file - TBD.
781
+ * @param {object} file - TBD.
781
782
  */
782
783
  loadImageTag(file) {
783
784
  this.log('loadImageTag', file);
@@ -809,13 +810,13 @@ export class Loader {
809
810
 
810
811
  /**
811
812
  * TBD.
812
- * @param file - TBD.
813
+ * @param {object} file - TBD.
813
814
  * @param {string} url - TBD.
814
- * @param type - TBD.
815
- * @param onload - TBD.
816
- * @param onerror - TBD.
815
+ * @param {string} type - TBD.
816
+ * @param {Function} onload - TBD.
817
+ * @param {Function} onerror - TBD.
817
818
  */
818
- xhrLoad(file, url, type, onload, onerror) {
819
+ xhrLoad(file, url, type, onload, onerror = null) {
819
820
  this.log('xhrLoad', file);
820
821
  const scope = this;
821
822
  const xhr = new XMLHttpRequest();
@@ -884,7 +885,7 @@ export class Loader {
884
885
 
885
886
  /**
886
887
  * TBD.
887
- * @param urls - TBD.
888
+ * @param {object[]} urls - TBD.
888
889
  * @returns {string} TBD.
889
890
  */
890
891
  getAudioURL(urls) {
@@ -922,9 +923,9 @@ export class Loader {
922
923
 
923
924
  /**
924
925
  * TBD.
925
- * @param file - TBD.
926
- * @param xhr - TBD.
927
- * @param reason - TBD.
926
+ * @param {object} file - TBD.
927
+ * @param {XMLHttpRequest} xhr - TBD.
928
+ * @param {number} reason - TBD.
928
929
  */
929
930
  fileError(file, xhr, reason) {
930
931
  // const url = file.requestUrl || this.transformUrl(file.url, file);
@@ -940,8 +941,8 @@ export class Loader {
940
941
 
941
942
  /**
942
943
  * TBD.
943
- * @param file - TBD.
944
- * @param xhr - TBD.
944
+ * @param {object} file - TBD.
945
+ * @param {XMLHttpRequest} xhr - TBD.
945
946
  * @throws Error.
946
947
  */
947
948
  fileComplete(file, xhr) {
@@ -1032,8 +1033,8 @@ export class Loader {
1032
1033
 
1033
1034
  /**
1034
1035
  * TBD.
1035
- * @param file - TBD.
1036
- * @param xhr - TBD.
1036
+ * @param {object} file - TBD.
1037
+ * @param {XMLHttpRequest} xhr - TBD.
1037
1038
  */
1038
1039
  jsonLoadComplete(file, xhr) {
1039
1040
  const data = JSON.parse(xhr.responseText);
@@ -1057,8 +1058,8 @@ export class Loader {
1057
1058
 
1058
1059
  /**
1059
1060
  * TBD.
1060
- * @param file - TBD.
1061
- * @param xhr - TBD.
1061
+ * @param {object} file - TBD.
1062
+ * @param {XMLHttpRequest} xhr - TBD.
1062
1063
  */
1063
1064
  xmlLoadComplete(file, xhr) {
1064
1065
  // Always try parsing the content as XML, regardless of actually response type
@@ -1082,7 +1083,7 @@ export class Loader {
1082
1083
 
1083
1084
  /**
1084
1085
  * TBD.
1085
- * @param data - TBD.
1086
+ * @param {object} data - TBD.
1086
1087
  * @returns {Document} TBD.
1087
1088
  */
1088
1089
  parseXml(data) {
@@ -1127,8 +1128,8 @@ export class Loader {
1127
1128
 
1128
1129
  /**
1129
1130
  * TBD.
1130
- * @param message - TBD.
1131
- * @param data - TBD.
1131
+ * @param {string} message - TBD.
1132
+ * @param {string|object} data - TBD.
1132
1133
  */
1133
1134
  log(message, data = '') {
1134
1135
  if (!this.isUseLog) {
@@ -40,7 +40,7 @@ export class SceneManager {
40
40
  /**
41
41
  * TBD.
42
42
  * @param {string} key - TBD.
43
- * @param state - TBD.
43
+ * @param {object} state - TBD.
44
44
  * @param {boolean} autoStart - TBD.
45
45
  * @returns {Scene|object} TBD.
46
46
  */
@@ -1,12 +1,14 @@
1
+ import { Signal } from './signal';
2
+
1
3
  export class SignalBinding {
2
4
  /**
3
5
  * TBD.
4
- * @param signal
5
- * @param listener
6
- * @param isOnce
7
- * @param listenerContext
8
- * @param priority
9
- * @param args - TBD.
6
+ * @param {Signal} signal - TBD.
7
+ * @param {Function} listener - TBD.
8
+ * @param {boolean} isOnce - TBD.
9
+ * @param {object} listenerContext - TBD.
10
+ * @param {number} priority - TBD.
11
+ * @param {...any} args - TBD.
10
12
  */
11
13
  constructor(signal, listener, isOnce = false, listenerContext = null, priority = 0, args = null) {
12
14
  this._signal = signal;
@@ -22,7 +24,8 @@ export class SignalBinding {
22
24
 
23
25
  /**
24
26
  * TBD.
25
- * @param paramsArr
27
+ * @param {any[]} paramsArr - TBD.
28
+ * @returns {Function} TBD.
26
29
  */
27
30
  execute(paramsArr) {
28
31
  let handlerReturn;
@@ -43,6 +46,7 @@ export class SignalBinding {
43
46
 
44
47
  /**
45
48
  * TBD.
49
+ * @returns {Function} TBD.
46
50
  */
47
51
  detach() {
48
52
  return this.isBound() ? this._signal.remove(this._listener, this.context) : null;
@@ -50,6 +54,7 @@ export class SignalBinding {
50
54
 
51
55
  /**
52
56
  * TBD.
57
+ * @returns {boolean} TBD.
53
58
  */
54
59
  isBound() {
55
60
  return !!this._signal && !!this._listener;
@@ -57,6 +62,7 @@ export class SignalBinding {
57
62
 
58
63
  /**
59
64
  * TBD.
65
+ * @returns {boolean} TBD.
60
66
  */
61
67
  isOnce() {
62
68
  return this._isOnce;
@@ -64,6 +70,7 @@ export class SignalBinding {
64
70
 
65
71
  /**
66
72
  * TBD.
73
+ * @returns {Function} TBD.
67
74
  */
68
75
  getListener() {
69
76
  return this._listener;
@@ -71,6 +78,7 @@ export class SignalBinding {
71
78
 
72
79
  /**
73
80
  * TBD.
81
+ * @returns {Signal} TBD.
74
82
  */
75
83
  getSignal() {
76
84
  return this._signal;
@@ -87,6 +95,7 @@ export class SignalBinding {
87
95
 
88
96
  /**
89
97
  * TBD.
98
+ * @returns {string} TBD.
90
99
  */
91
100
  toString() {
92
101
  return '[SignalBinding isOnce:' + this._isOnce + ', isBound:' + this.isBound() + ', active:' + this.active + ']';
@@ -148,7 +148,7 @@ export class Tween {
148
148
  /**
149
149
  * TBD.
150
150
  * @param {string} property - TBD.
151
- * @param {number} value - TBD.
151
+ * @param {object} value - TBD.
152
152
  * @param {number} index - TBD.
153
153
  * @returns {Tween} TBD.
154
154
  */
@@ -235,8 +235,8 @@ export class Tween {
235
235
 
236
236
  /**
237
237
  * TBD.
238
- * @param interpolation - TBD.
239
- * @param context - TBD.
238
+ * @param {Function} interpolation - TBD.
239
+ * @param {object} context - TBD.
240
240
  * @param {number} index - TBD.
241
241
  * @returns {Tween} TBD.
242
242
  */
@@ -424,7 +424,8 @@ export class Tween {
424
424
  /**
425
425
  * TBD.
426
426
  * @param {number} frameRate - TBD.
427
- * @param data - TBD.
427
+ * @param {object[]} data - TBD.
428
+ * @returns {object[]} TBD.
428
429
  */
429
430
  generateData(frameRate = 60, data = []) {
430
431
  if (this.game === null || this.target === null) {
@@ -1,10 +1,11 @@
1
+ import { Tween } from './tween';
1
2
  import * as MathUtils from '../util/math';
2
3
  import { TWEEN_PENDING, TWEEN_RUNNING, TWEEN_COMPLETE, TWEEN_LOOPED } from './const';
3
4
 
4
5
  export class TweenData {
5
6
  /**
6
7
  * TBD.
7
- * @param parent - TBD.
8
+ * @param {Tween} parent - TBD.
8
9
  */
9
10
  constructor(parent) {
10
11
  this.parent = parent;
@@ -24,6 +24,9 @@ import { getSmoothingPrefix } from './util';
24
24
  import { detectCapabilities } from './tinter';
25
25
  import * as CanvasMaskManager from './masker';
26
26
  import { Game } from '../../core/game';
27
+ import { Stage } from '../../core/stage';
28
+ import { Image } from '../image';
29
+ import { Matrix } from '../../geom/matrix';
27
30
 
28
31
  export class CanvasRenderer {
29
32
  /**
@@ -60,7 +63,7 @@ export class CanvasRenderer {
60
63
 
61
64
  /**
62
65
  * TBD.
63
- * @param root - TBD.
66
+ * @param {Stage} root - TBD.
64
67
  */
65
68
  render(root) {
66
69
  if (!this.context) {
@@ -85,7 +88,7 @@ export class CanvasRenderer {
85
88
 
86
89
  /**
87
90
  * TBD.
88
- * @param removeView - TBD.
91
+ * @param {boolean} removeView - TBD.
89
92
  */
90
93
  destroy(removeView = true) {
91
94
  if (removeView && this.view.parent) {
@@ -117,9 +120,9 @@ export class CanvasRenderer {
117
120
 
118
121
  /**
119
122
  * TBD.
120
- * @param displayObject - TBD.
121
- * @param context - TBD.
122
- * @param matrix - TBD.
123
+ * @param {Image} displayObject - TBD.
124
+ * @param {CanvasRenderingContext2D} context - TBD.
125
+ * @param {Matrix} matrix - TBD.
123
126
  */
124
127
  renderDisplayObject(displayObject, context, matrix) {
125
128
  this.renderSession.context = context || this.context;
@@ -4,6 +4,7 @@ import { Matrix } from '../geom/matrix';
4
4
  import { getIdentityMatrix } from '../geom/util/matrix';
5
5
  import { PI_2 } from '../util/math';
6
6
  import { renderCanvas, renderWebGL } from './sprite_util';
7
+ import { Graphics } from './graphics';
7
8
 
8
9
  export class DisplayObject {
9
10
  /**
@@ -671,6 +672,7 @@ export class DisplayObject {
671
672
 
672
673
  /**
673
674
  * TBD.
675
+ * @returns {Graphics} TBD.
674
676
  */
675
677
  get mask() {
676
678
  return this._mask;
@@ -841,8 +841,8 @@ export class Graphics extends DisplayObject {
841
841
 
842
842
  /**
843
843
  * TBD.
844
- * @param points - TBD.
845
- * @param cull - TBD.
844
+ * @param {Point[]} points - TBD.
845
+ * @param {boolean} cull - TBD.
846
846
  */
847
847
  drawTriangle(points, cull = false) {
848
848
  const triangle = new Polygon(points);
@@ -861,8 +861,8 @@ export class Graphics extends DisplayObject {
861
861
 
862
862
  /**
863
863
  * TBD.
864
- * @param vertices - TBD.
865
- * @param indices - TBD.
864
+ * @param {number[]|Point[]} vertices - TBD.
865
+ * @param {number[]} indices - TBD.
866
866
  * @param {boolean} cull - TBD.
867
867
  */
868
868
  drawTriangles(vertices, indices, cull = false) {
@@ -1,6 +1,7 @@
1
1
  import { Texture } from './webgl/texture';
2
2
  import { AnimationManager } from '../core/animation_manager';
3
3
  import { EventManager } from '../core/event_manager';
4
+ import { Frame } from '../core/frame';
4
5
  import { Rectangle } from '../geom/rectangle';
5
6
  import { Matrix } from '../geom/matrix';
6
7
  import { DisplayObject } from './display_object';
@@ -140,7 +141,7 @@ export class Image extends DisplayObject {
140
141
 
141
142
  /**
142
143
  * TBD.
143
- * @param frame - TBD.
144
+ * @param {Frame} frame - TBD.
144
145
  */
145
146
  setFrame(frame) {
146
147
  this._frame = frame;
@@ -185,7 +186,7 @@ export class Image extends DisplayObject {
185
186
 
186
187
  /**
187
188
  * TBD.
188
- * @param parent - TBD.
189
+ * @param {DisplayObject} parent - TBD.
189
190
  * @param {number} width - TBD.
190
191
  * @param {number} height - TBD.
191
192
  */
@@ -205,6 +206,7 @@ export class Image extends DisplayObject {
205
206
 
206
207
  /**
207
208
  * TBD.
209
+ * @returns {number} TBD.
208
210
  */
209
211
  get frame() {
210
212
  return this.animations.frame;
@@ -236,7 +238,7 @@ export class Image extends DisplayObject {
236
238
 
237
239
  /**
238
240
  * TBD.
239
- * @param rect - TBD.
241
+ * @param {Rectangle} rect - TBD.
240
242
  * @param {boolean} copy - TBD.
241
243
  */
242
244
  crop(rect, copy = false) {
@@ -335,7 +337,7 @@ export class Image extends DisplayObject {
335
337
 
336
338
  /**
337
339
  * TBD.
338
- * @param texture - TBD.
340
+ * @param {Texture} texture - TBD.
339
341
  * @param {boolean} destroyBase - TBD.
340
342
  */
341
343
  setTexture(texture, destroyBase = false) {