@vpmedia/phaser 1.95.0 → 1.97.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 (184) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/package.json +10 -10
  3. package/src/phaser/core/animation.js +61 -56
  4. package/src/phaser/core/animation_manager.js +55 -55
  5. package/src/phaser/core/cache.js +154 -154
  6. package/src/phaser/core/device.js +2 -1
  7. package/src/phaser/core/device_util.js +27 -27
  8. package/src/phaser/core/dom.js +43 -43
  9. package/src/phaser/core/event_manager.js +63 -63
  10. package/src/phaser/core/factory.js +47 -47
  11. package/src/phaser/core/frame.js +30 -30
  12. package/src/phaser/core/frame_data.js +30 -28
  13. package/src/phaser/core/frame_util.js +8 -8
  14. package/src/phaser/core/game.js +34 -18
  15. package/src/phaser/core/loader.js +170 -170
  16. package/src/phaser/core/loader_parser.js +22 -22
  17. package/src/phaser/core/raf.js +1 -1
  18. package/src/phaser/core/scene.js +16 -10
  19. package/src/phaser/core/scene_manager.js +51 -43
  20. package/src/phaser/core/signal.js +68 -52
  21. package/src/phaser/core/signal.test.js +37 -0
  22. package/src/phaser/core/sound.js +54 -54
  23. package/src/phaser/core/sound_manager.js +49 -49
  24. package/src/phaser/core/stage.js +16 -16
  25. package/src/phaser/core/time.js +30 -30
  26. package/src/phaser/core/timer.js +79 -64
  27. package/src/phaser/core/timer_event.js +9 -9
  28. package/src/phaser/core/tween.js +90 -90
  29. package/src/phaser/core/tween_data.js +30 -30
  30. package/src/phaser/core/tween_manager.js +29 -24
  31. package/src/phaser/core/world.js +4 -3
  32. package/src/phaser/display/bitmap_text.js +61 -54
  33. package/src/phaser/display/button.js +48 -47
  34. package/src/phaser/display/canvas/buffer.js +8 -8
  35. package/src/phaser/display/canvas/graphics.js +8 -8
  36. package/src/phaser/display/canvas/masker.js +5 -5
  37. package/src/phaser/display/canvas/pool.js +18 -18
  38. package/src/phaser/display/canvas/renderer.js +16 -16
  39. package/src/phaser/display/canvas/tinter.js +22 -22
  40. package/src/phaser/display/canvas/util.js +42 -42
  41. package/src/phaser/display/display_object.js +119 -108
  42. package/src/phaser/display/graphics.js +112 -112
  43. package/src/phaser/display/graphics_data.js +10 -10
  44. package/src/phaser/display/graphics_data_util.js +3 -3
  45. package/src/phaser/display/group.js +50 -50
  46. package/src/phaser/display/image.js +54 -50
  47. package/src/phaser/display/sprite_batch.js +2 -2
  48. package/src/phaser/display/sprite_util.js +19 -19
  49. package/src/phaser/display/text.js +212 -187
  50. package/src/phaser/display/webgl/abstract_filter.js +4 -4
  51. package/src/phaser/display/webgl/base_texture.js +9 -9
  52. package/src/phaser/display/webgl/blend_manager.js +7 -7
  53. package/src/phaser/display/webgl/earcut.js +95 -95
  54. package/src/phaser/display/webgl/earcut_node.js +4 -4
  55. package/src/phaser/display/webgl/fast_sprite_batch.js +15 -15
  56. package/src/phaser/display/webgl/filter_manager.js +9 -9
  57. package/src/phaser/display/webgl/filter_texture.js +10 -10
  58. package/src/phaser/display/webgl/graphics.js +37 -37
  59. package/src/phaser/display/webgl/graphics_data.js +4 -4
  60. package/src/phaser/display/webgl/mask_manager.js +6 -6
  61. package/src/phaser/display/webgl/render_texture.js +16 -16
  62. package/src/phaser/display/webgl/renderer.js +20 -20
  63. package/src/phaser/display/webgl/shader/complex.js +4 -4
  64. package/src/phaser/display/webgl/shader/fast.js +4 -4
  65. package/src/phaser/display/webgl/shader/normal.js +8 -8
  66. package/src/phaser/display/webgl/shader/primitive.js +4 -4
  67. package/src/phaser/display/webgl/shader/strip.js +4 -4
  68. package/src/phaser/display/webgl/shader_manager.js +9 -9
  69. package/src/phaser/display/webgl/sprite_batch.js +18 -18
  70. package/src/phaser/display/webgl/stencil_manager.js +16 -16
  71. package/src/phaser/display/webgl/texture.js +13 -13
  72. package/src/phaser/display/webgl/texture_util.js +8 -8
  73. package/src/phaser/display/webgl/util.js +25 -25
  74. package/src/phaser/geom/circle.js +69 -69
  75. package/src/phaser/geom/circle.test.js +1 -0
  76. package/src/phaser/geom/ellipse.js +28 -28
  77. package/src/phaser/geom/ellipse.test.js +1 -0
  78. package/src/phaser/geom/line.js +93 -93
  79. package/src/phaser/geom/line.test.js +1 -0
  80. package/src/phaser/geom/matrix.js +54 -54
  81. package/src/phaser/geom/matrix.test.js +1 -0
  82. package/src/phaser/geom/point.js +96 -96
  83. package/src/phaser/geom/point.test.js +1 -0
  84. package/src/phaser/geom/polygon.js +22 -22
  85. package/src/phaser/geom/rectangle.js +132 -132
  86. package/src/phaser/geom/rectangle.test.js +1 -0
  87. package/src/phaser/geom/rounded_rectangle.js +12 -12
  88. package/src/phaser/geom/rounded_rectangle.test.js +1 -0
  89. package/src/phaser/geom/util/circle.js +33 -33
  90. package/src/phaser/geom/util/circle.test.js +1 -0
  91. package/src/phaser/geom/util/ellipse.js +5 -5
  92. package/src/phaser/geom/util/ellipse.test.js +1 -0
  93. package/src/phaser/geom/util/line.js +26 -26
  94. package/src/phaser/geom/util/line.test.js +1 -0
  95. package/src/phaser/geom/util/matrix.js +8 -8
  96. package/src/phaser/geom/util/matrix.test.js +1 -0
  97. package/src/phaser/geom/util/point.js +97 -97
  98. package/src/phaser/geom/util/point.test.js +1 -0
  99. package/src/phaser/geom/util/polygon.js +4 -4
  100. package/src/phaser/geom/util/polygon.test.js +1 -0
  101. package/src/phaser/geom/util/rectangle.js +74 -74
  102. package/src/phaser/geom/util/rectangle.test.js +1 -0
  103. package/src/phaser/geom/util/rounded_rectangle.js +4 -4
  104. package/src/phaser/geom/util/rounded_rectangle.test.js +1 -0
  105. package/src/phaser/util/math.js +81 -81
  106. package/src/phaser/util/math.test.js +1 -0
  107. package/types/phaser/core/animation.d.ts +61 -56
  108. package/types/phaser/core/animation.d.ts.map +1 -1
  109. package/types/phaser/core/animation_manager.d.ts +55 -55
  110. package/types/phaser/core/cache.d.ts +154 -154
  111. package/types/phaser/core/device.d.ts.map +1 -1
  112. package/types/phaser/core/dom.d.ts +43 -43
  113. package/types/phaser/core/event_manager.d.ts +63 -63
  114. package/types/phaser/core/factory.d.ts +47 -47
  115. package/types/phaser/core/frame.d.ts +30 -30
  116. package/types/phaser/core/frame_data.d.ts +28 -27
  117. package/types/phaser/core/frame_data.d.ts.map +1 -1
  118. package/types/phaser/core/game.d.ts +52 -19
  119. package/types/phaser/core/game.d.ts.map +1 -1
  120. package/types/phaser/core/loader.d.ts +170 -170
  121. package/types/phaser/core/loader_parser.d.ts.map +1 -1
  122. package/types/phaser/core/raf.d.ts +1 -1
  123. package/types/phaser/core/scene.d.ts +15 -9
  124. package/types/phaser/core/scene.d.ts.map +1 -1
  125. package/types/phaser/core/scene_manager.d.ts +51 -43
  126. package/types/phaser/core/scene_manager.d.ts.map +1 -1
  127. package/types/phaser/core/signal.d.ts +54 -51
  128. package/types/phaser/core/signal.d.ts.map +1 -1
  129. package/types/phaser/core/sound.d.ts +54 -54
  130. package/types/phaser/core/sound_manager.d.ts +49 -49
  131. package/types/phaser/core/stage.d.ts +10 -10
  132. package/types/phaser/core/time.d.ts +30 -30
  133. package/types/phaser/core/timer.d.ts +64 -64
  134. package/types/phaser/core/timer_event.d.ts +9 -9
  135. package/types/phaser/core/tween.d.ts +90 -90
  136. package/types/phaser/core/tween_data.d.ts +30 -30
  137. package/types/phaser/core/tween_manager.d.ts +29 -24
  138. package/types/phaser/core/tween_manager.d.ts.map +1 -1
  139. package/types/phaser/core/world.d.ts +4 -3
  140. package/types/phaser/core/world.d.ts.map +1 -1
  141. package/types/phaser/display/bitmap_text.d.ts +59 -52
  142. package/types/phaser/display/bitmap_text.d.ts.map +1 -1
  143. package/types/phaser/display/button.d.ts +47 -46
  144. package/types/phaser/display/button.d.ts.map +1 -1
  145. package/types/phaser/display/canvas/buffer.d.ts +8 -8
  146. package/types/phaser/display/canvas/renderer.d.ts +16 -16
  147. package/types/phaser/display/display_object.d.ts +119 -108
  148. package/types/phaser/display/display_object.d.ts.map +1 -1
  149. package/types/phaser/display/graphics.d.ts +101 -101
  150. package/types/phaser/display/graphics_data.d.ts +10 -10
  151. package/types/phaser/display/group.d.ts +47 -47
  152. package/types/phaser/display/image.d.ts +42 -40
  153. package/types/phaser/display/image.d.ts.map +1 -1
  154. package/types/phaser/display/text.d.ts +207 -184
  155. package/types/phaser/display/text.d.ts.map +1 -1
  156. package/types/phaser/display/webgl/abstract_filter.d.ts +4 -4
  157. package/types/phaser/display/webgl/base_texture.d.ts +9 -9
  158. package/types/phaser/display/webgl/blend_manager.d.ts +6 -6
  159. package/types/phaser/display/webgl/earcut.d.ts +95 -95
  160. package/types/phaser/display/webgl/earcut_node.d.ts +4 -4
  161. package/types/phaser/display/webgl/fast_sprite_batch.d.ts +15 -15
  162. package/types/phaser/display/webgl/filter_manager.d.ts +8 -8
  163. package/types/phaser/display/webgl/filter_texture.d.ts +10 -10
  164. package/types/phaser/display/webgl/graphics_data.d.ts +4 -4
  165. package/types/phaser/display/webgl/render_texture.d.ts +16 -16
  166. package/types/phaser/display/webgl/renderer.d.ts +20 -20
  167. package/types/phaser/display/webgl/shader/complex.d.ts +4 -4
  168. package/types/phaser/display/webgl/shader/fast.d.ts +4 -4
  169. package/types/phaser/display/webgl/shader/normal.d.ts +8 -8
  170. package/types/phaser/display/webgl/shader/primitive.d.ts +4 -4
  171. package/types/phaser/display/webgl/shader/strip.d.ts +4 -4
  172. package/types/phaser/display/webgl/shader_manager.d.ts +8 -8
  173. package/types/phaser/display/webgl/sprite_batch.d.ts +17 -17
  174. package/types/phaser/display/webgl/stencil_manager.d.ts +15 -15
  175. package/types/phaser/display/webgl/texture.d.ts +12 -12
  176. package/types/phaser/geom/circle.d.ts +69 -69
  177. package/types/phaser/geom/ellipse.d.ts +28 -28
  178. package/types/phaser/geom/line.d.ts +93 -93
  179. package/types/phaser/geom/matrix.d.ts +54 -54
  180. package/types/phaser/geom/point.d.ts +96 -96
  181. package/types/phaser/geom/polygon.d.ts +22 -22
  182. package/types/phaser/geom/rectangle.d.ts +132 -132
  183. package/types/phaser/geom/rounded_rectangle.d.ts +12 -12
  184. package/pnpm-workspace.yaml +0 -4
@@ -26,10 +26,10 @@ import { textureFromCanvas } from './webgl/texture_util.js';
26
26
 
27
27
  export class Graphics extends DisplayObject {
28
28
  /**
29
- * TBD.
30
- * @param {import('../core/game.js').Game} game - TBD.
31
- * @param {number} x - TBD.
32
- * @param {number} y - TBD.
29
+ * Creates a new Graphics object.
30
+ * @param {import('../core/game.js').Game} game - The game instance.
31
+ * @param {number} x - The x coordinate of the graphics object.
32
+ * @param {number} y - The y coordinate of the graphics object.
33
33
  */
34
34
  constructor(game, x = 0, y = 0) {
35
35
  super(game);
@@ -72,7 +72,7 @@ export class Graphics extends DisplayObject {
72
72
  }
73
73
 
74
74
  /**
75
- * TBD.
75
+ * Destroys the graphics object and clears all data.
76
76
  */
77
77
  destroy() {
78
78
  // TODO
@@ -81,11 +81,11 @@ export class Graphics extends DisplayObject {
81
81
  }
82
82
 
83
83
  /**
84
- * TBD.
85
- * @param {number} lineWidth - TBD.
86
- * @param {number} color - TBD.
87
- * @param {number} alpha - TBD.
88
- * @returns {Graphics} TBD.
84
+ * Sets the line style for subsequent drawing operations.
85
+ * @param {number} lineWidth - The width of the line to draw.
86
+ * @param {number} color - The color of the line to draw.
87
+ * @param {number} alpha - The alpha (transparency) of the line to draw.
88
+ * @returns {Graphics} This Graphics object for chaining.
89
89
  */
90
90
  lineStyle(lineWidth = 0, color = 0, alpha = 1) {
91
91
  this.lineWidth = lineWidth || 0;
@@ -106,10 +106,10 @@ export class Graphics extends DisplayObject {
106
106
  }
107
107
 
108
108
  /**
109
- * TBD.
110
- * @param {number} x - TBD.
111
- * @param {number} y - TBD.
112
- * @returns {Graphics} TBD.
109
+ * Moves the drawing cursor to the specified point.
110
+ * @param {number} x - The x coordinate to move to.
111
+ * @param {number} y - The y coordinate to move to.
112
+ * @returns {Graphics} This Graphics object for chaining.
113
113
  */
114
114
  moveTo(x, y) {
115
115
  this.drawShape(new Polygon([x, y]));
@@ -117,10 +117,10 @@ export class Graphics extends DisplayObject {
117
117
  }
118
118
 
119
119
  /**
120
- * TBD.
121
- * @param {number} x - TBD.
122
- * @param {number} y - TBD.
123
- * @returns {Graphics} TBD.
120
+ * Draws a line from the current drawing position to the specified point.
121
+ * @param {number} x - The x coordinate to draw to.
122
+ * @param {number} y - The y coordinate to draw to.
123
+ * @returns {Graphics} This Graphics object for chaining.
124
124
  */
125
125
  lineTo(x, y) {
126
126
  if (!this.currentPath) {
@@ -133,12 +133,12 @@ export class Graphics extends DisplayObject {
133
133
  }
134
134
 
135
135
  /**
136
- * TBD.
137
- * @param {number} cpX - TBD.
138
- * @param {number} cpY - TBD.
139
- * @param {number} toX - TBD.
140
- * @param {number} toY - TBD.
141
- * @returns {Graphics} TBD.
136
+ * Draws a quadratic curve from the current position to the specified point.
137
+ * @param {number} cpX - The x coordinate of the control point.
138
+ * @param {number} cpY - The y coordinate of the control point.
139
+ * @param {number} toX - The x coordinate to draw to.
140
+ * @param {number} toY - The y coordinate to draw to.
141
+ * @returns {Graphics} This Graphics object for chaining.
142
142
  */
143
143
  quadraticCurveTo(cpX, cpY, toX, toY) {
144
144
  if (this.currentPath) {
@@ -170,14 +170,14 @@ export class Graphics extends DisplayObject {
170
170
  }
171
171
 
172
172
  /**
173
- * TBD.
174
- * @param {number} cpX - TBD.
175
- * @param {number} cpY - TBD.
176
- * @param {number} cpX2 - TBD.
177
- * @param {number} cpY2 - TBD.
178
- * @param {number} toX - TBD.
179
- * @param {number} toY - TBD.
180
- * @returns {Graphics} TBD.
173
+ * Draws a cubic Bezier curve from the current position to the specified point.
174
+ * @param {number} cpX - The x coordinate of the first control point.
175
+ * @param {number} cpY - The y coordinate of the first control point.
176
+ * @param {number} cpX2 - The x coordinate of the second control point.
177
+ * @param {number} cpY2 - The y coordinate of the second control point.
178
+ * @param {number} toX - The x coordinate to draw to.
179
+ * @param {number} toY - The y coordinate to draw to.
180
+ * @returns {Graphics} This Graphics object for chaining.
181
181
  */
182
182
  bezierCurveTo(cpX, cpY, cpX2, cpY2, toX, toY) {
183
183
  if (this.currentPath) {
@@ -215,13 +215,13 @@ export class Graphics extends DisplayObject {
215
215
  }
216
216
 
217
217
  /**
218
- * TBD.
219
- * @param {number} x1 - TBD.
220
- * @param {number} y1 - TBD.
221
- * @param {number} x2 - TBD.
222
- * @param {number} y2 - TBD.
223
- * @param {number} radius - TBD.
224
- * @returns {Graphics} TBD.
218
+ * Draws an arc from the current position to the specified point.
219
+ * @param {number} x1 - The x coordinate of the starting point.
220
+ * @param {number} y1 - The y coordinate of the starting point.
221
+ * @param {number} x2 - The x coordinate of the end point.
222
+ * @param {number} y2 - The y coordinate of the end point.
223
+ * @param {number} radius - The radius of the arc.
224
+ * @returns {Graphics} This Graphics object for chaining.
225
225
  */
226
226
  arcTo(x1, y1, x2, y2, radius) {
227
227
  if (this.currentPath) {
@@ -267,15 +267,15 @@ export class Graphics extends DisplayObject {
267
267
  }
268
268
 
269
269
  /**
270
- * TBD.
271
- * @param {number} cx - TBD.
272
- * @param {number} cy - TBD.
273
- * @param {number} radius - TBD.
274
- * @param {number} startAngle - TBD.
275
- * @param {number} endAngle - TBD.
276
- * @param {boolean} anticlockwise - TBD.
277
- * @param {number} segments - TBD.
278
- * @returns {Graphics} TBD.
270
+ * Draws an arc with the specified center, radius, and angles.
271
+ * @param {number} cx - The x coordinate of the center point.
272
+ * @param {number} cy - The y coordinate of the center point.
273
+ * @param {number} radius - The radius of the arc.
274
+ * @param {number} startAngle - The starting angle in radians.
275
+ * @param {number} endAngle - The ending angle in radians.
276
+ * @param {boolean} anticlockwise - Whether to draw the arc anticlockwise.
277
+ * @param {number} segments - The number of segments to use for drawing the arc.
278
+ * @returns {Graphics} This Graphics object for chaining.
279
279
  */
280
280
  arc(cx, cy, radius, startAngle, endAngle, anticlockwise = false, segments = 40) {
281
281
  // If we do this we can never draw a full circle
@@ -321,10 +321,10 @@ export class Graphics extends DisplayObject {
321
321
  }
322
322
 
323
323
  /**
324
- * TBD.
325
- * @param {number} color - TBD.
326
- * @param {number} alpha - TBD.
327
- * @returns {Graphics} TBD.
324
+ * Begins filling with the specified color and alpha.
325
+ * @param {number} color - The fill color to use.
326
+ * @param {number} alpha - The fill alpha (transparency) to use.
327
+ * @returns {Graphics} This Graphics object for chaining.
328
328
  */
329
329
  beginFill(color = 0, alpha = 1) {
330
330
  this.filling = true;
@@ -341,8 +341,8 @@ export class Graphics extends DisplayObject {
341
341
  }
342
342
 
343
343
  /**
344
- * TBD.
345
- * @returns {Graphics} TBD.
344
+ * Ends the current fill operation.
345
+ * @returns {Graphics} This Graphics object for chaining.
346
346
  */
347
347
  endFill() {
348
348
  this.filling = false;
@@ -352,12 +352,12 @@ export class Graphics extends DisplayObject {
352
352
  }
353
353
 
354
354
  /**
355
- * TBD.
356
- * @param {number} x - TBD.
357
- * @param {number} y - TBD.
358
- * @param {number} width - TBD.
359
- * @param {number} height - TBD.
360
- * @returns {Graphics} TBD.
355
+ * Draws a rectangle with the specified properties.
356
+ * @param {number} x - The x coordinate of the rectangle.
357
+ * @param {number} y - The y coordinate of the rectangle.
358
+ * @param {number} width - The width of the rectangle.
359
+ * @param {number} height - The height of the rectangle.
360
+ * @returns {Graphics} This Graphics object for chaining.
361
361
  */
362
362
  drawRect(x, y, width, height) {
363
363
  this.drawShape(new Rectangle(x, y, width, height));
@@ -365,13 +365,13 @@ export class Graphics extends DisplayObject {
365
365
  }
366
366
 
367
367
  /**
368
- * TBD.
369
- * @param {number} x - TBD.
370
- * @param {number} y - TBD.
371
- * @param {number} width - TBD.
372
- * @param {number} height - TBD.
373
- * @param {number} radius - TBD.
374
- * @returns {Graphics} TBD.
368
+ * Draws a rounded rectangle with the specified properties.
369
+ * @param {number} x - The x coordinate of the rectangle.
370
+ * @param {number} y - The y coordinate of the rectangle.
371
+ * @param {number} width - The width of the rectangle.
372
+ * @param {number} height - The height of the rectangle.
373
+ * @param {number} radius - The radius of the rounded corners.
374
+ * @returns {Graphics} This Graphics object for chaining.
375
375
  */
376
376
  drawRoundedRect(x, y, width, height, radius) {
377
377
  this.drawShape(new RoundedRectangle(x, y, width, height, radius));
@@ -379,11 +379,11 @@ export class Graphics extends DisplayObject {
379
379
  }
380
380
 
381
381
  /**
382
- * TBD.
383
- * @param {number} x - TBD.
384
- * @param {number} y - TBD.
385
- * @param {number} diameter - TBD.
386
- * @returns {Graphics} TBD.
382
+ * Draws a circle with the specified properties.
383
+ * @param {number} x - The x coordinate of the center point.
384
+ * @param {number} y - The y coordinate of the center point.
385
+ * @param {number} diameter - The diameter of the circle.
386
+ * @returns {Graphics} This Graphics object for chaining.
387
387
  */
388
388
  drawCircle(x, y, diameter) {
389
389
  this.drawShape(new Circle(x, y, diameter));
@@ -391,12 +391,12 @@ export class Graphics extends DisplayObject {
391
391
  }
392
392
 
393
393
  /**
394
- * TBD.
395
- * @param {number} x - TBD.
396
- * @param {number} y - TBD.
397
- * @param {number} width - TBD.
398
- * @param {number} height - TBD.
399
- * @returns {Graphics} TBD.
394
+ * Draws an ellipse with the specified properties.
395
+ * @param {number} x - The x coordinate of the center point.
396
+ * @param {number} y - The y coordinate of the center point.
397
+ * @param {number} width - The width of the ellipse.
398
+ * @param {number} height - The height of the ellipse.
399
+ * @returns {Graphics} This Graphics object for chaining.
400
400
  */
401
401
  drawEllipse(x, y, width, height) {
402
402
  this.drawShape(new Ellipse(x, y, width, height));
@@ -404,9 +404,9 @@ export class Graphics extends DisplayObject {
404
404
  }
405
405
 
406
406
  /**
407
- * TBD.
408
- * @param {Polygon} path - TBD.
409
- * @returns {Graphics} TBD.
407
+ * Draws a polygon with the specified path.
408
+ * @param {Polygon} path - The polygon to draw.
409
+ * @returns {Graphics} This Graphics object for chaining.
410
410
  */
411
411
  drawPolygon(path) {
412
412
  let points;
@@ -429,8 +429,8 @@ export class Graphics extends DisplayObject {
429
429
  }
430
430
 
431
431
  /**
432
- * TBD.
433
- * @returns {Graphics} TBD.
432
+ * Clears all graphics data.
433
+ * @returns {Graphics} This Graphics object for chaining.
434
434
  */
435
435
  clear() {
436
436
  this.lineWidth = 0;
@@ -444,7 +444,7 @@ export class Graphics extends DisplayObject {
444
444
  }
445
445
 
446
446
  /**
447
- * TBD.
447
+ * Generates a texture from the graphics object (not implemented).
448
448
  */
449
449
  generateTexture() {
450
450
  // TODO
@@ -452,8 +452,8 @@ export class Graphics extends DisplayObject {
452
452
  }
453
453
 
454
454
  /**
455
- * TBD.
456
- * @param {object} renderSession - TBD.
455
+ * Renders the graphics object using WebGL.
456
+ * @param {object} renderSession - The render session to use.
457
457
  */
458
458
  renderWebGL(renderSession) {
459
459
  // if the sprite is not visible or the alpha is 0 then no need to render this element
@@ -512,8 +512,8 @@ export class Graphics extends DisplayObject {
512
512
  }
513
513
 
514
514
  /**
515
- * TBD.
516
- * @param {object} renderSession - TBD.
515
+ * Renders the graphics object using Canvas.
516
+ * @param {object} renderSession - The render session to use.
517
517
  */
518
518
  renderCanvas(renderSession) {
519
519
  // if the sprite is not visible or the alpha is 0 then no need to render this element
@@ -568,9 +568,9 @@ export class Graphics extends DisplayObject {
568
568
  }
569
569
 
570
570
  /**
571
- * TBD.
572
- * @param {import('../geom/matrix.js').Matrix} matrix - TBD.
573
- * @returns {Rectangle} TBD.
571
+ * Gets the bounds of the graphics object.
572
+ * @param {import('../geom/matrix.js').Matrix} matrix - The transformation matrix to use.
573
+ * @returns {Rectangle} The bounds rectangle of the graphics object.
574
574
  */
575
575
  getBounds(matrix = null) {
576
576
  if (!this.renderable) {
@@ -629,8 +629,8 @@ export class Graphics extends DisplayObject {
629
629
  }
630
630
 
631
631
  /**
632
- * TBD.
633
- * @returns {Rectangle} TBD.
632
+ * Gets the local bounds of the graphics object.
633
+ * @returns {Rectangle} The local bounds rectangle of the graphics object.
634
634
  */
635
635
  getLocalBounds() {
636
636
  const matrixCache = this.worldTransform;
@@ -647,10 +647,10 @@ export class Graphics extends DisplayObject {
647
647
  }
648
648
 
649
649
  /**
650
- * TBD.
651
- * @param {Point} point - TBD.
652
- * @param {Point} tempPoint - TBD.
653
- * @returns {boolean} TBD.
650
+ * Checks if the graphics object contains a point.
651
+ * @param {Point} point - The point to check.
652
+ * @param {Point} tempPoint - A temporary point object to use.
653
+ * @returns {boolean} True if the graphics object contains the point, otherwise false.
654
654
  */
655
655
  containsPoint(point, tempPoint) {
656
656
  this.worldTransform.applyInverse(point, tempPoint);
@@ -667,7 +667,7 @@ export class Graphics extends DisplayObject {
667
667
  }
668
668
 
669
669
  /**
670
- * TBD.
670
+ * Updates the local bounds of the graphics object.
671
671
  */
672
672
  updateLocalBounds() {
673
673
  let minX = Infinity;
@@ -748,7 +748,7 @@ export class Graphics extends DisplayObject {
748
748
  }
749
749
 
750
750
  /**
751
- * TBD.
751
+ * Generates a cached sprite representation of the graphics object.
752
752
  */
753
753
  generateCachedSprite() {
754
754
  const bounds = this.getLocalBounds();
@@ -774,7 +774,7 @@ export class Graphics extends DisplayObject {
774
774
  }
775
775
 
776
776
  /**
777
- * TBD.
777
+ * Updates the cached sprite texture.
778
778
  */
779
779
  updateCachedSpriteTexture() {
780
780
  const cachedSprite = this._cachedSprite;
@@ -793,7 +793,7 @@ export class Graphics extends DisplayObject {
793
793
  }
794
794
 
795
795
  /**
796
- * TBD.
796
+ * Destroys the cached sprite.
797
797
  */
798
798
  destroyCachedSprite() {
799
799
  if (!this._cachedSprite) {
@@ -804,9 +804,9 @@ export class Graphics extends DisplayObject {
804
804
  }
805
805
 
806
806
  /**
807
- * TBD.
808
- * @param {object} shape - TBD.
809
- * @returns {GraphicsData} TBD.
807
+ * Draws a shape with the specified properties.
808
+ * @param {object} shape - The shape to draw.
809
+ * @returns {GraphicsData} The graphics data for the drawn shape.
810
810
  */
811
811
  drawShape(shape) {
812
812
  if (this.currentPath) {
@@ -841,7 +841,7 @@ export class Graphics extends DisplayObject {
841
841
  }
842
842
 
843
843
  /**
844
- * TBD.
844
+ * Performs post-update operations for the graphics object.
845
845
  */
846
846
  postUpdate() {
847
847
  if (this._boundsDirty) {
@@ -854,9 +854,9 @@ export class Graphics extends DisplayObject {
854
854
  }
855
855
 
856
856
  /**
857
- * TBD.
858
- * @param {Point[]} points - TBD.
859
- * @param {boolean} cull - TBD.
857
+ * Draws a triangle with the specified points and culling options.
858
+ * @param {Point[]} points - The points of the triangle.
859
+ * @param {boolean} cull - Whether to perform backface culling.
860
860
  */
861
861
  drawTriangle(points, cull = false) {
862
862
  const triangle = new Polygon(points);
@@ -874,10 +874,10 @@ export class Graphics extends DisplayObject {
874
874
  }
875
875
 
876
876
  /**
877
- * TBD.
878
- * @param {number[]|Point[]} vertices - TBD.
879
- * @param {number[]} indices - TBD.
880
- * @param {boolean} cull - TBD.
877
+ * Draws triangles with the specified vertices and indices.
878
+ * @param {number[]|Point[]} vertices - The vertices of the triangles.
879
+ * @param {number[]} indices - The indices of the vertices to use.
880
+ * @param {boolean} cull - Whether to perform backface culling.
881
881
  */
882
882
  drawTriangles(vertices, indices, cull = false) {
883
883
  const point1 = new Point();
@@ -2,14 +2,14 @@ import { clone } from './graphics_data_util.js';
2
2
 
3
3
  export class GraphicsData {
4
4
  /**
5
- * 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.
5
+ * Creates a new GraphicsData object.
6
+ * @param {number} lineWidth - The line width.
7
+ * @param {number} lineColor - The line color.
8
+ * @param {number} lineAlpha - The line alpha.
9
+ * @param {number} fillColor - The fill color.
10
+ * @param {number} fillAlpha - The fill alpha.
11
+ * @param {boolean} fill - Whether to fill the shape.
12
+ * @param {object} shape - The shape to draw.
13
13
  */
14
14
  constructor(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) {
15
15
  this.lineWidth = lineWidth;
@@ -25,8 +25,8 @@ export class GraphicsData {
25
25
  }
26
26
 
27
27
  /**
28
- * TBD.
29
- * @returns {GraphicsData} TBD.
28
+ * Clones this GraphicsData object.
29
+ * @returns {GraphicsData} A new cloned GraphicsData object.
30
30
  */
31
31
  clone() {
32
32
  return clone(this);
@@ -1,9 +1,9 @@
1
1
  import { GraphicsData } from './graphics_data.js';
2
2
 
3
3
  /**
4
- * TBD.
5
- * @param {GraphicsData} source - TBD.
6
- * @returns {GraphicsData} TBD.
4
+ * Clones a GraphicsData object.
5
+ * @param {GraphicsData} source - The source GraphicsData to clone.
6
+ * @returns {GraphicsData} A new cloned GraphicsData object.
7
7
  */
8
8
  export const clone = (source) => {
9
9
  return new GraphicsData(