@vpmedia/phaser 1.16.0 → 1.18.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 (183) hide show
  1. package/README.md +1 -1
  2. package/package.json +3 -3
  3. package/src/phaser/core/animation.js +31 -18
  4. package/src/phaser/core/animation_manager.js +36 -21
  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/const.js +66 -0
  9. package/src/phaser/core/device.js +87 -0
  10. package/src/phaser/core/dom.js +13 -8
  11. package/src/phaser/core/event_manager.js +2 -1
  12. package/src/phaser/core/factory.js +21 -21
  13. package/src/phaser/core/frame_data.js +1 -1
  14. package/src/phaser/core/game.js +1 -0
  15. package/src/phaser/core/input.js +37 -20
  16. package/src/phaser/core/input_handler.js +1 -1
  17. package/src/phaser/core/input_mouse.js +16 -12
  18. package/src/phaser/core/input_mspointer.js +7 -7
  19. package/src/phaser/core/input_pointer.js +26 -17
  20. package/src/phaser/core/input_touch.js +7 -7
  21. package/src/phaser/core/loader.js +104 -75
  22. package/src/phaser/core/raf.js +1 -1
  23. package/src/phaser/core/scale_manager.js +46 -29
  24. package/src/phaser/core/scene_manager.js +13 -9
  25. package/src/phaser/core/sound.js +3 -3
  26. package/src/phaser/core/sound_manager.js +17 -10
  27. package/src/phaser/core/sound_sprite.js +7 -4
  28. package/src/phaser/core/timer.js +38 -26
  29. package/src/phaser/core/timer_event.js +10 -8
  30. package/src/phaser/core/tween.js +66 -46
  31. package/src/phaser/core/tween_data.js +22 -15
  32. package/src/phaser/core/tween_manager.js +10 -6
  33. package/src/phaser/display/bitmap_text.js +7 -6
  34. package/src/phaser/display/canvas/pool.js +1 -1
  35. package/src/phaser/display/canvas/renderer.js +5 -4
  36. package/src/phaser/display/canvas/util.js +2 -2
  37. package/src/phaser/display/display_object.js +33 -16
  38. package/src/phaser/display/graphics.js +57 -36
  39. package/src/phaser/display/graphics_data.js +7 -7
  40. package/src/phaser/display/group.js +28 -20
  41. package/src/phaser/display/image.js +19 -12
  42. package/src/phaser/display/sprite_util.js +3 -2
  43. package/src/phaser/display/text.js +27 -14
  44. package/src/phaser/display/webgl/abstract_filter.js +2 -2
  45. package/src/phaser/display/webgl/base_texture.js +2 -2
  46. package/src/phaser/display/webgl/blend_manager.js +3 -2
  47. package/src/phaser/display/webgl/earcut_node.js +1 -1
  48. package/src/phaser/display/webgl/fast_sprite_batch.js +6 -6
  49. package/src/phaser/display/webgl/filter_manager.js +1 -1
  50. package/src/phaser/display/webgl/filter_texture.js +2 -2
  51. package/src/phaser/display/webgl/graphics_data.js +1 -1
  52. package/src/phaser/display/webgl/render_texture.js +7 -3
  53. package/src/phaser/display/webgl/renderer.js +9 -6
  54. package/src/phaser/display/webgl/shader/complex.js +1 -1
  55. package/src/phaser/display/webgl/shader/fast.js +1 -1
  56. package/src/phaser/display/webgl/shader/normal.js +2 -2
  57. package/src/phaser/display/webgl/shader/primitive.js +1 -1
  58. package/src/phaser/display/webgl/shader/strip.js +1 -1
  59. package/src/phaser/display/webgl/shader_manager.js +3 -3
  60. package/src/phaser/display/webgl/sprite_batch.js +9 -7
  61. package/src/phaser/display/webgl/stencil_manager.js +7 -7
  62. package/src/phaser/display/webgl/texture.js +8 -6
  63. package/types/phaser/core/animation.d.ts +43 -30
  64. package/types/phaser/core/animation.d.ts.map +1 -1
  65. package/types/phaser/core/animation_manager.d.ts +59 -43
  66. package/types/phaser/core/animation_manager.d.ts.map +1 -1
  67. package/types/phaser/core/animation_parser.d.ts +2 -2
  68. package/types/phaser/core/array_set.d.ts +24 -16
  69. package/types/phaser/core/array_set.d.ts.map +1 -1
  70. package/types/phaser/core/cache.d.ts +79 -73
  71. package/types/phaser/core/cache.d.ts.map +1 -1
  72. package/types/phaser/core/const.d.ts +88 -22
  73. package/types/phaser/core/const.d.ts.map +1 -1
  74. package/types/phaser/core/device.d.ts +87 -0
  75. package/types/phaser/core/device.d.ts.map +1 -1
  76. package/types/phaser/core/dom.d.ts +19 -27
  77. package/types/phaser/core/dom.d.ts.map +1 -1
  78. package/types/phaser/core/event_manager.d.ts +4 -3
  79. package/types/phaser/core/event_manager.d.ts.map +1 -1
  80. package/types/phaser/core/factory.d.ts +28 -28
  81. package/types/phaser/core/factory.d.ts.map +1 -1
  82. package/types/phaser/core/frame_data.d.ts +2 -2
  83. package/types/phaser/core/frame_data.d.ts.map +1 -1
  84. package/types/phaser/core/game.d.ts +1 -0
  85. package/types/phaser/core/game.d.ts.map +1 -1
  86. package/types/phaser/core/input.d.ts +51 -34
  87. package/types/phaser/core/input.d.ts.map +1 -1
  88. package/types/phaser/core/input_handler.d.ts +2 -2
  89. package/types/phaser/core/input_handler.d.ts.map +1 -1
  90. package/types/phaser/core/input_mouse.d.ts +20 -19
  91. package/types/phaser/core/input_mouse.d.ts.map +1 -1
  92. package/types/phaser/core/input_mspointer.d.ts +15 -15
  93. package/types/phaser/core/input_mspointer.d.ts.map +1 -1
  94. package/types/phaser/core/input_pointer.d.ts +39 -30
  95. package/types/phaser/core/input_pointer.d.ts.map +1 -1
  96. package/types/phaser/core/input_touch.d.ts +15 -15
  97. package/types/phaser/core/input_touch.d.ts.map +1 -1
  98. package/types/phaser/core/loader.d.ts +118 -92
  99. package/types/phaser/core/loader.d.ts.map +1 -1
  100. package/types/phaser/core/raf.d.ts +3 -3
  101. package/types/phaser/core/raf.d.ts.map +1 -1
  102. package/types/phaser/core/scale_manager.d.ts +68 -51
  103. package/types/phaser/core/scale_manager.d.ts.map +1 -1
  104. package/types/phaser/core/scene_manager.d.ts +18 -13
  105. package/types/phaser/core/scene_manager.d.ts.map +1 -1
  106. package/types/phaser/core/sound.d.ts +4 -4
  107. package/types/phaser/core/sound.d.ts.map +1 -1
  108. package/types/phaser/core/sound_manager.d.ts +22 -15
  109. package/types/phaser/core/sound_manager.d.ts.map +1 -1
  110. package/types/phaser/core/sound_sprite.d.ts +10 -7
  111. package/types/phaser/core/sound_sprite.d.ts.map +1 -1
  112. package/types/phaser/core/timer.d.ts +47 -35
  113. package/types/phaser/core/timer.d.ts.map +1 -1
  114. package/types/phaser/core/timer_event.d.ts +15 -14
  115. package/types/phaser/core/timer_event.d.ts.map +1 -1
  116. package/types/phaser/core/tween.d.ts +81 -61
  117. package/types/phaser/core/tween.d.ts.map +1 -1
  118. package/types/phaser/core/tween_data.d.ts +26 -19
  119. package/types/phaser/core/tween_data.d.ts.map +1 -1
  120. package/types/phaser/core/tween_manager.d.ts +16 -12
  121. package/types/phaser/core/tween_manager.d.ts.map +1 -1
  122. package/types/phaser/display/bitmap_text.d.ts +10 -9
  123. package/types/phaser/display/bitmap_text.d.ts.map +1 -1
  124. package/types/phaser/display/canvas/buffer.d.ts +2 -2
  125. package/types/phaser/display/canvas/buffer.d.ts.map +1 -1
  126. package/types/phaser/display/canvas/pool.d.ts +2 -2
  127. package/types/phaser/display/canvas/pool.d.ts.map +1 -1
  128. package/types/phaser/display/canvas/renderer.d.ts +5 -4
  129. package/types/phaser/display/canvas/renderer.d.ts.map +1 -1
  130. package/types/phaser/display/canvas/util.d.ts +2 -2
  131. package/types/phaser/display/canvas/util.d.ts.map +1 -1
  132. package/types/phaser/display/display_object.d.ts +50 -33
  133. package/types/phaser/display/display_object.d.ts.map +1 -1
  134. package/types/phaser/display/graphics.d.ts +65 -47
  135. package/types/phaser/display/graphics.d.ts.map +1 -1
  136. package/types/phaser/display/graphics_data.d.ts +16 -16
  137. package/types/phaser/display/graphics_data.d.ts.map +1 -1
  138. package/types/phaser/display/group.d.ts +38 -30
  139. package/types/phaser/display/group.d.ts.map +1 -1
  140. package/types/phaser/display/image.d.ts +24 -23
  141. package/types/phaser/display/image.d.ts.map +1 -1
  142. package/types/phaser/display/sprite_util.d.ts +5 -4
  143. package/types/phaser/display/sprite_util.d.ts.map +1 -1
  144. package/types/phaser/display/text.d.ts +33 -55
  145. package/types/phaser/display/text.d.ts.map +1 -1
  146. package/types/phaser/display/webgl/abstract_filter.d.ts +3 -3
  147. package/types/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
  148. package/types/phaser/display/webgl/base_texture.d.ts +4 -4
  149. package/types/phaser/display/webgl/base_texture.d.ts.map +1 -1
  150. package/types/phaser/display/webgl/blend_manager.d.ts +6 -5
  151. package/types/phaser/display/webgl/blend_manager.d.ts.map +1 -1
  152. package/types/phaser/display/webgl/earcut_node.d.ts +3 -3
  153. package/types/phaser/display/webgl/earcut_node.d.ts.map +1 -1
  154. package/types/phaser/display/webgl/fast_sprite_batch.d.ts +12 -12
  155. package/types/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
  156. package/types/phaser/display/webgl/filter_manager.d.ts +3 -3
  157. package/types/phaser/display/webgl/filter_manager.d.ts.map +1 -1
  158. package/types/phaser/display/webgl/filter_texture.d.ts +7 -7
  159. package/types/phaser/display/webgl/filter_texture.d.ts.map +1 -1
  160. package/types/phaser/display/webgl/graphics_data.d.ts +5 -5
  161. package/types/phaser/display/webgl/graphics_data.d.ts.map +1 -1
  162. package/types/phaser/display/webgl/render_texture.d.ts +9 -9
  163. package/types/phaser/display/webgl/render_texture.d.ts.map +1 -1
  164. package/types/phaser/display/webgl/renderer.d.ts +10 -7
  165. package/types/phaser/display/webgl/renderer.d.ts.map +1 -1
  166. package/types/phaser/display/webgl/shader/complex.d.ts +11 -11
  167. package/types/phaser/display/webgl/shader/complex.d.ts.map +1 -1
  168. package/types/phaser/display/webgl/shader/fast.d.ts +15 -15
  169. package/types/phaser/display/webgl/shader/fast.d.ts.map +1 -1
  170. package/types/phaser/display/webgl/shader/normal.d.ts +11 -11
  171. package/types/phaser/display/webgl/shader/normal.d.ts.map +1 -1
  172. package/types/phaser/display/webgl/shader/primitive.d.ts +12 -12
  173. package/types/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
  174. package/types/phaser/display/webgl/shader/strip.d.ts +12 -12
  175. package/types/phaser/display/webgl/shader/strip.d.ts.map +1 -1
  176. package/types/phaser/display/webgl/shader_manager.d.ts +5 -5
  177. package/types/phaser/display/webgl/shader_manager.d.ts.map +1 -1
  178. package/types/phaser/display/webgl/sprite_batch.d.ts +16 -14
  179. package/types/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
  180. package/types/phaser/display/webgl/stencil_manager.d.ts +12 -12
  181. package/types/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
  182. package/types/phaser/display/webgl/texture.d.ts +15 -12
  183. package/types/phaser/display/webgl/texture.d.ts.map +1 -1
@@ -7,6 +7,7 @@ import { Polygon } from '../geom/polygon';
7
7
  import { Circle } from '../geom/circle';
8
8
  import { Ellipse } from '../geom/ellipse';
9
9
  import { Point } from '../geom/point';
10
+ import { Matrix } from '../geom/matrix';
10
11
  import { GraphicsData } from './graphics_data';
11
12
  import { CanvasBuffer } from './canvas/buffer';
12
13
  import { textureFromCanvas } from './webgl/texture_util';
@@ -51,6 +52,7 @@ export class Graphics extends DisplayObject {
51
52
  this._localBounds = new Rectangle(0, 0, 1, 1);
52
53
  this.dirty = true;
53
54
  this._boundsDirty = false;
55
+ this._cacheAsBitmap = false;
54
56
  this.webGLDirty = false;
55
57
  this.cachedSpriteDirty = false;
56
58
  }
@@ -66,9 +68,10 @@ export class Graphics extends DisplayObject {
66
68
 
67
69
  /**
68
70
  * TBD.
69
- * @param lineWidth - TBD.
70
- * @param color - TBD.
71
- * @param alpha - TBD.
71
+ * @param {number} lineWidth - TBD.
72
+ * @param {number} color - TBD.
73
+ * @param {number} alpha - TBD.
74
+ * @returns {Graphics} TBD.
72
75
  */
73
76
  lineStyle(lineWidth = 0, color = 0, alpha = 1) {
74
77
  this.lineWidth = lineWidth || 0;
@@ -92,6 +95,7 @@ export class Graphics extends DisplayObject {
92
95
  * TBD.
93
96
  * @param {number} x - TBD.
94
97
  * @param {number} y - TBD.
98
+ * @returns {Graphics} TBD.
95
99
  */
96
100
  moveTo(x, y) {
97
101
  this.drawShape(new Polygon([x, y]));
@@ -102,6 +106,7 @@ export class Graphics extends DisplayObject {
102
106
  * TBD.
103
107
  * @param {number} x - TBD.
104
108
  * @param {number} y - TBD.
109
+ * @returns {Graphics} TBD.
105
110
  */
106
111
  lineTo(x, y) {
107
112
  if (!this.currentPath) {
@@ -115,10 +120,11 @@ export class Graphics extends DisplayObject {
115
120
 
116
121
  /**
117
122
  * TBD.
118
- * @param cpX - TBD.
119
- * @param cpY - TBD.
120
- * @param toX - TBD.
121
- * @param toY - TBD.
123
+ * @param {number} cpX - TBD.
124
+ * @param {number} cpY - TBD.
125
+ * @param {number} toX - TBD.
126
+ * @param {number} toY - TBD.
127
+ * @returns {Graphics} TBD.
122
128
  */
123
129
  quadraticCurveTo(cpX, cpY, toX, toY) {
124
130
  if (this.currentPath) {
@@ -151,12 +157,13 @@ export class Graphics extends DisplayObject {
151
157
 
152
158
  /**
153
159
  * TBD.
154
- * @param cpX - TBD.
155
- * @param cpY - TBD.
156
- * @param cpX2 - TBD.
157
- * @param cpY2 - TBD.
158
- * @param toX - TBD.
159
- * @param toY - TBD.
160
+ * @param {number} cpX - TBD.
161
+ * @param {number} cpY - TBD.
162
+ * @param {number} cpX2 - TBD.
163
+ * @param {number} cpY2 - TBD.
164
+ * @param {number} toX - TBD.
165
+ * @param {number} toY - TBD.
166
+ * @returns {Graphics} TBD.
160
167
  */
161
168
  bezierCurveTo(cpX, cpY, cpX2, cpY2, toX, toY) {
162
169
  if (this.currentPath) {
@@ -195,11 +202,12 @@ export class Graphics extends DisplayObject {
195
202
 
196
203
  /**
197
204
  * TBD.
198
- * @param x1 - TBD.
199
- * @param y1 - TBD.
200
- * @param x2 - TBD.
201
- * @param y2 - TBD.
202
- * @param radius - TBD.
205
+ * @param {number} x1 - TBD.
206
+ * @param {number} y1 - TBD.
207
+ * @param {number} x2 - TBD.
208
+ * @param {number} y2 - TBD.
209
+ * @param {number} radius - TBD.
210
+ * @returns {Graphics} TBD.
203
211
  */
204
212
  arcTo(x1, y1, x2, y2, radius) {
205
213
  if (this.currentPath) {
@@ -246,13 +254,14 @@ export class Graphics extends DisplayObject {
246
254
 
247
255
  /**
248
256
  * TBD.
249
- * @param cx - TBD.
250
- * @param cy - TBD.
251
- * @param radius - TBD.
252
- * @param startAngle - TBD.
253
- * @param endAngle - TBD.
254
- * @param anticlockwise - TBD.
255
- * @param segments - TBD.
257
+ * @param {number} cx - TBD.
258
+ * @param {number} cy - TBD.
259
+ * @param {number} radius - TBD.
260
+ * @param {number} startAngle - TBD.
261
+ * @param {number} endAngle - TBD.
262
+ * @param {boolean} anticlockwise - TBD.
263
+ * @param {number} segments - TBD.
264
+ * @returns {Graphics} TBD.
256
265
  */
257
266
  arc(cx, cy, radius, startAngle, endAngle, anticlockwise = false, segments = 40) {
258
267
  // If we do this we can never draw a full circle
@@ -299,8 +308,9 @@ export class Graphics extends DisplayObject {
299
308
 
300
309
  /**
301
310
  * TBD.
302
- * @param color - TBD.
303
- * @param alpha - TBD.
311
+ * @param {number} color - TBD.
312
+ * @param {number} alpha - TBD.
313
+ * @returns {Graphics} TBD.
304
314
  */
305
315
  beginFill(color = 0, alpha = 1) {
306
316
  this.filling = true;
@@ -318,6 +328,7 @@ export class Graphics extends DisplayObject {
318
328
 
319
329
  /**
320
330
  * TBD.
331
+ * @returns {Graphics} TBD.
321
332
  */
322
333
  endFill() {
323
334
  this.filling = false;
@@ -332,6 +343,7 @@ export class Graphics extends DisplayObject {
332
343
  * @param {number} y - TBD.
333
344
  * @param {number} width - TBD.
334
345
  * @param {number} height - TBD.
346
+ * @returns {Graphics} TBD.
335
347
  */
336
348
  drawRect(x, y, width, height) {
337
349
  this.drawShape(new Rectangle(x, y, width, height));
@@ -344,7 +356,8 @@ export class Graphics extends DisplayObject {
344
356
  * @param {number} y - TBD.
345
357
  * @param {number} width - TBD.
346
358
  * @param {number} height - TBD.
347
- * @param radius - TBD.
359
+ * @param {number} radius - TBD.
360
+ * @returns {Graphics} TBD.
348
361
  */
349
362
  drawRoundedRect(x, y, width, height, radius) {
350
363
  this.drawShape(new RoundedRectangle(x, y, width, height, radius));
@@ -355,7 +368,8 @@ export class Graphics extends DisplayObject {
355
368
  * TBD.
356
369
  * @param {number} x - TBD.
357
370
  * @param {number} y - TBD.
358
- * @param diameter - TBD.
371
+ * @param {number} diameter - TBD.
372
+ * @returns {Graphics} TBD.
359
373
  */
360
374
  drawCircle(x, y, diameter) {
361
375
  this.drawShape(new Circle(x, y, diameter));
@@ -368,6 +382,7 @@ export class Graphics extends DisplayObject {
368
382
  * @param {number} y - TBD.
369
383
  * @param {number} width - TBD.
370
384
  * @param {number} height - TBD.
385
+ * @returns {Graphics} TBD.
371
386
  */
372
387
  drawEllipse(x, y, width, height) {
373
388
  this.drawShape(new Ellipse(x, y, width, height));
@@ -376,7 +391,8 @@ export class Graphics extends DisplayObject {
376
391
 
377
392
  /**
378
393
  * TBD.
379
- * @param path - TBD.
394
+ * @param {Polygon} path - TBD.
395
+ * @returns {Graphics} TBD.
380
396
  */
381
397
  drawPolygon(path) {
382
398
  let points;
@@ -400,6 +416,7 @@ export class Graphics extends DisplayObject {
400
416
 
401
417
  /**
402
418
  * TBD.
419
+ * @returns {Graphics} TBD.
403
420
  */
404
421
  clear() {
405
422
  this.lineWidth = 0;
@@ -422,7 +439,7 @@ export class Graphics extends DisplayObject {
422
439
 
423
440
  /**
424
441
  * TBD.
425
- * @param renderSession - TBD.
442
+ * @param {object} renderSession - TBD.
426
443
  */
427
444
  renderWebGL(renderSession) {
428
445
  // if the sprite is not visible or the alpha is 0 then no need to render this element
@@ -482,7 +499,7 @@ export class Graphics extends DisplayObject {
482
499
 
483
500
  /**
484
501
  * TBD.
485
- * @param renderSession - TBD.
502
+ * @param {object} renderSession - TBD.
486
503
  */
487
504
  renderCanvas(renderSession) {
488
505
  // if the sprite is not visible or the alpha is 0 then no need to render this element
@@ -538,7 +555,8 @@ export class Graphics extends DisplayObject {
538
555
 
539
556
  /**
540
557
  * TBD.
541
- * @param matrix - TBD.
558
+ * @param {Matrix} matrix - TBD.
559
+ * @returns {Rectangle} TBD.
542
560
  */
543
561
  getBounds(matrix = null) {
544
562
  if (!this.renderable) {
@@ -598,6 +616,7 @@ export class Graphics extends DisplayObject {
598
616
 
599
617
  /**
600
618
  * TBD.
619
+ * @returns {Rectangle} TBD.
601
620
  */
602
621
  getLocalBounds() {
603
622
  const matrixCache = this.worldTransform;
@@ -615,8 +634,9 @@ export class Graphics extends DisplayObject {
615
634
 
616
635
  /**
617
636
  * TBD.
618
- * @param point - TBD.
619
- * @param tempPoint - TBD.
637
+ * @param {Point} point - TBD.
638
+ * @param {Point} tempPoint - TBD.
639
+ * @returns {boolean} TBD.
620
640
  */
621
641
  containsPoint(point, tempPoint) {
622
642
  this.worldTransform.applyInverse(point, tempPoint);
@@ -772,6 +792,7 @@ export class Graphics extends DisplayObject {
772
792
  /**
773
793
  * TBD.
774
794
  * @param shape - TBD.
795
+ * @returns {GraphicsData} TBD.
775
796
  */
776
797
  drawShape(shape) {
777
798
  if (this.currentPath) {
@@ -842,7 +863,7 @@ export class Graphics extends DisplayObject {
842
863
  * TBD.
843
864
  * @param vertices - TBD.
844
865
  * @param indices - TBD.
845
- * @param cull - TBD.
866
+ * @param {boolean} cull - TBD.
846
867
  */
847
868
  drawTriangles(vertices, indices, cull = false) {
848
869
  const point1 = new Point();
@@ -3,13 +3,13 @@ import { clone } from './graphics_data_util';
3
3
  export class GraphicsData {
4
4
  /**
5
5
  * TBD.
6
- * @param lineWidth - TBD.
7
- * @param lineColor - TBD.
8
- * @param lineAlpha - TBD.
9
- * @param fillColor - TBD.
10
- * @param fillAlpha - TBD.
11
- * @param fill - TBD.
12
- * @param shape - TBD.
6
+ * @param {number} lineWidth - TBD.
7
+ * @param {number} lineColor - TBD.
8
+ * @param {number} lineAlpha - TBD.
9
+ * @param {number} fillColor - TBD.
10
+ * @param {number} fillAlpha - TBD.
11
+ * @param {boolean} fill - TBD.
12
+ * @param {object} shape - TBD.
13
13
  */
14
14
  constructor(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) {
15
15
  this.lineWidth = lineWidth;
@@ -47,8 +47,8 @@ export class Group extends DisplayObject {
47
47
 
48
48
  /**
49
49
  * TBD.
50
- * @param destroyChildren - TBD.
51
- * @param soft - TBD.
50
+ * @param {boolean} destroyChildren - TBD.
51
+ * @param {boolean} soft - TBD.
52
52
  */
53
53
  destroy(destroyChildren = true, soft = false) {
54
54
  if (this.game === null || this.ignoreDestroy) {
@@ -70,9 +70,10 @@ export class Group extends DisplayObject {
70
70
 
71
71
  /**
72
72
  * TBD.
73
- * @param child - TBD.
74
- * @param silent - TBD.
75
- * @param index - TBD.
73
+ * @param {DisplayObject} child - TBD.
74
+ * @param {boolean} silent - TBD.
75
+ * @param {number} index - TBD.
76
+ * @returns {DisplayObject} TBD.
76
77
  */
77
78
  add(child, silent = false, index = -1) {
78
79
  if (child.parent === this) {
@@ -99,9 +100,9 @@ export class Group extends DisplayObject {
99
100
 
100
101
  /**
101
102
  * TBD.
102
- * @param child - TBD.
103
- * @param index - TBD.
104
- * @param silent - TBD.
103
+ * @param {DisplayObject} child - TBD.
104
+ * @param {number} index - TBD.
105
+ * @param {boolean} silent - TBD.
105
106
  */
106
107
  addAt(child, index, silent) {
107
108
  this.add(child, silent, index);
@@ -109,7 +110,8 @@ export class Group extends DisplayObject {
109
110
 
110
111
  /**
111
112
  * TBD.
112
- * @param index - TBD.
113
+ * @param {number} index - TBD.
114
+ * @returns {DisplayObject} TBD.
113
115
  */
114
116
  getAt(index) {
115
117
  if (index < 0 || index >= this.children.length) {
@@ -131,6 +133,7 @@ export class Group extends DisplayObject {
131
133
 
132
134
  /**
133
135
  * TBD.
136
+ * @returns {DisplayObject} TBD.
134
137
  */
135
138
  next() {
136
139
  if (this.cursor) {
@@ -148,6 +151,7 @@ export class Group extends DisplayObject {
148
151
 
149
152
  /**
150
153
  * TBD.
154
+ * @returns {DisplayObject} TBD.
151
155
  */
152
156
  previous() {
153
157
  if (this.cursor) {
@@ -165,8 +169,8 @@ export class Group extends DisplayObject {
165
169
 
166
170
  /**
167
171
  * TBD.
168
- * @param child1 - TBD.
169
- * @param child2 - TBD.
172
+ * @param {DisplayObject} child1 - TBD.
173
+ * @param {DisplayObject} child2 - TBD.
170
174
  */
171
175
  swap(child1, child2) {
172
176
  this.swapChildren(child1, child2);
@@ -175,7 +179,8 @@ export class Group extends DisplayObject {
175
179
 
176
180
  /**
177
181
  * TBD.
178
- * @param child - TBD.
182
+ * @param {DisplayObject} child - TBD.
183
+ * @returns {DisplayObject} TBD.
179
184
  */
180
185
  bringToTop(child) {
181
186
  if (child.parent === this && this.getIndex(child) < this.children.length) {
@@ -187,7 +192,8 @@ export class Group extends DisplayObject {
187
192
 
188
193
  /**
189
194
  * TBD.
190
- * @param child - TBD.
195
+ * @param {DisplayObject} child - TBD.
196
+ * @returns {DisplayObject} TBD.
191
197
  */
192
198
  sendToBack(child) {
193
199
  if (child.parent === this && this.getIndex(child) > 0) {
@@ -207,7 +213,8 @@ export class Group extends DisplayObject {
207
213
 
208
214
  /**
209
215
  * TBD.
210
- * @param child - TBD.
216
+ * @param {DisplayObject} child - TBD.
217
+ * @returns {number} TBD.
211
218
  */
212
219
  getIndex(child) {
213
220
  return this.children.indexOf(child);
@@ -252,9 +259,10 @@ export class Group extends DisplayObject {
252
259
 
253
260
  /**
254
261
  * TBD.
255
- * @param child - TBD.
256
- * @param destroy - TBD.
257
- * @param silent - TBD.
262
+ * @param {DisplayObject} child - TBD.
263
+ * @param {boolean} destroy - TBD.
264
+ * @param {boolean} silent - TBD.
265
+ * @returns {boolean} TBD.
258
266
  */
259
267
  remove(child, destroy = true, silent = false) {
260
268
  if (this.children.length === 0 || this.children.indexOf(child) === -1) {
@@ -276,9 +284,9 @@ export class Group extends DisplayObject {
276
284
 
277
285
  /**
278
286
  * TBD.
279
- * @param destroy - TBD.
280
- * @param silent - TBD.
281
- * @param destroyTexture - TBD.
287
+ * @param {boolean} destroy - TBD.
288
+ * @param {boolean} silent - TBD.
289
+ * @param {boolean} destroyTexture - TBD.
282
290
  */
283
291
  removeAll(destroy = true, silent = false, destroyTexture = false) {
284
292
  if (this.children.length === 0) {
@@ -2,6 +2,7 @@ import { Texture } from './webgl/texture';
2
2
  import { AnimationManager } from '../core/animation_manager';
3
3
  import { EventManager } from '../core/event_manager';
4
4
  import { Rectangle } from '../geom/rectangle';
5
+ import { Matrix } from '../geom/matrix';
5
6
  import { DisplayObject } from './display_object';
6
7
  import { Game } from '../core/game';
7
8
  import { clone } from '../geom/util/rectangle';
@@ -33,6 +34,7 @@ export class Image extends DisplayObject {
33
34
  this.blendMode = BLEND_NORMAL;
34
35
  this.shader = null;
35
36
  this._frame = null;
37
+ this.pendingDestroy = false;
36
38
  /* if (this.texture.baseTexture.hasLoaded) {
37
39
  this.onTextureUpdate();
38
40
  } */
@@ -95,8 +97,8 @@ export class Image extends DisplayObject {
95
97
  /**
96
98
  * TBD.
97
99
  * @param {string} key - TBD.
98
- * @param frame - TBD.
99
- * @param stopAnimation - TBD.
100
+ * @param {number} frame - TBD.
101
+ * @param {boolean} stopAnimation - TBD.
100
102
  */
101
103
  loadTexture(key, frame = 0, stopAnimation = true) {
102
104
  if (key === PENDING_ATLAS) {
@@ -183,7 +185,7 @@ export class Image extends DisplayObject {
183
185
 
184
186
  /**
185
187
  * TBD.
186
- * @param parent
188
+ * @param parent - TBD.
187
189
  * @param {number} width - TBD.
188
190
  * @param {number} height - TBD.
189
191
  */
@@ -217,6 +219,7 @@ export class Image extends DisplayObject {
217
219
 
218
220
  /**
219
221
  * TBD.
222
+ * @returns {string} TBD.
220
223
  */
221
224
  get frameName() {
222
225
  return this.animations.frameName;
@@ -233,8 +236,8 @@ export class Image extends DisplayObject {
233
236
 
234
237
  /**
235
238
  * TBD.
236
- * @param rect
237
- * @param copy
239
+ * @param rect - TBD.
240
+ * @param {boolean} copy - TBD.
238
241
  */
239
242
  crop(rect, copy = false) {
240
243
  if (rect) {
@@ -287,6 +290,7 @@ export class Image extends DisplayObject {
287
290
 
288
291
  /**
289
292
  * TBD.
293
+ * @returns {number} TBD.
290
294
  */
291
295
  get width() {
292
296
  return this.scale.x * this.texture.frame.width;
@@ -302,6 +306,7 @@ export class Image extends DisplayObject {
302
306
 
303
307
  /**
304
308
  * TBD.
309
+ * @returns {number} TBD.
305
310
  */
306
311
  get height() {
307
312
  return this.scale.y * this.texture.frame.height;
@@ -330,8 +335,8 @@ export class Image extends DisplayObject {
330
335
 
331
336
  /**
332
337
  * TBD.
333
- * @param texture
334
- * @param destroyBase
338
+ * @param texture - TBD.
339
+ * @param {boolean} destroyBase - TBD.
335
340
  */
336
341
  setTexture(texture, destroyBase = false) {
337
342
  setTexture(this, texture, destroyBase);
@@ -339,7 +344,8 @@ export class Image extends DisplayObject {
339
344
 
340
345
  /**
341
346
  * TBD.
342
- * @param matrix - TBD.
347
+ * @param {Matrix} matrix - TBD.
348
+ * @returns {Rectangle} TBD.
343
349
  */
344
350
  getBounds(matrix = null) {
345
351
  return getBounds(this, matrix);
@@ -347,6 +353,7 @@ export class Image extends DisplayObject {
347
353
 
348
354
  /**
349
355
  * TBD.
356
+ * @returns {Rectangle} TBD.
350
357
  */
351
358
  getLocalBounds() {
352
359
  return getLocalBounds(this);
@@ -354,8 +361,8 @@ export class Image extends DisplayObject {
354
361
 
355
362
  /**
356
363
  * TBD.
357
- * @param renderSession - TBD.
358
- * @param matrix - TBD.
364
+ * @param {object} renderSession - TBD.
365
+ * @param {Matrix} matrix - TBD.
359
366
  */
360
367
  renderWebGL(renderSession, matrix = null) {
361
368
  renderWebGL(this, renderSession, matrix);
@@ -363,8 +370,8 @@ export class Image extends DisplayObject {
363
370
 
364
371
  /**
365
372
  * TBD.
366
- * @param renderSession - TBD.
367
- * @param matrix - TBD.
373
+ * @param {object} renderSession - TBD.
374
+ * @param {Matrix} matrix - TBD.
368
375
  */
369
376
  renderCanvas(renderSession, matrix = null) {
370
377
  renderCanvas(this, renderSession, matrix);
@@ -1,5 +1,6 @@
1
1
  import { getTintedTexture } from './canvas/tinter';
2
2
  import { getIdentityMatrix } from '../geom/util/matrix';
3
+ import { Rectangle } from '../geom/rectangle';
3
4
  import { SCALE_LINEAR } from '../core/const';
4
5
 
5
6
  /**
@@ -22,7 +23,7 @@ export function setTexture(target, texture, destroyBase = false) {
22
23
  * TBD.
23
24
  * @param {object} target - TBD.
24
25
  * @param {object} matrix - TBD.
25
- * @returns {object} TBD.
26
+ * @returns {Rectangle} TBD.
26
27
  */
27
28
  export function getBounds(target, matrix = null) {
28
29
  // TODO verify
@@ -104,7 +105,7 @@ export function getBounds(target, matrix = null) {
104
105
  /**
105
106
  * TBD.
106
107
  * @param {object} target - TBD.
107
- * @returns {object} TBD.
108
+ * @returns {Rectangle} TBD.
108
109
  */
109
110
  export function getLocalBounds(target) {
110
111
  const matrixCache = target.worldTransform;