@vpmedia/phaser 1.95.0 → 1.96.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 (167) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.json +9 -9
  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 +56 -52
  21. package/src/phaser/core/sound.js +54 -54
  22. package/src/phaser/core/sound_manager.js +49 -49
  23. package/src/phaser/core/stage.js +16 -16
  24. package/src/phaser/core/time.js +30 -30
  25. package/src/phaser/core/timer.js +64 -64
  26. package/src/phaser/core/timer_event.js +9 -9
  27. package/src/phaser/core/tween.js +90 -90
  28. package/src/phaser/core/tween_data.js +30 -30
  29. package/src/phaser/core/tween_manager.js +29 -24
  30. package/src/phaser/core/world.js +4 -3
  31. package/src/phaser/display/bitmap_text.js +61 -54
  32. package/src/phaser/display/button.js +48 -47
  33. package/src/phaser/display/canvas/buffer.js +8 -8
  34. package/src/phaser/display/canvas/graphics.js +8 -8
  35. package/src/phaser/display/canvas/masker.js +5 -5
  36. package/src/phaser/display/canvas/pool.js +18 -18
  37. package/src/phaser/display/canvas/renderer.js +16 -16
  38. package/src/phaser/display/canvas/tinter.js +22 -22
  39. package/src/phaser/display/canvas/util.js +42 -42
  40. package/src/phaser/display/display_object.js +119 -108
  41. package/src/phaser/display/graphics.js +112 -112
  42. package/src/phaser/display/graphics_data.js +10 -10
  43. package/src/phaser/display/graphics_data_util.js +3 -3
  44. package/src/phaser/display/group.js +50 -50
  45. package/src/phaser/display/image.js +54 -50
  46. package/src/phaser/display/sprite_batch.js +2 -2
  47. package/src/phaser/display/sprite_util.js +19 -19
  48. package/src/phaser/display/text.js +212 -187
  49. package/src/phaser/display/webgl/abstract_filter.js +4 -4
  50. package/src/phaser/display/webgl/base_texture.js +9 -9
  51. package/src/phaser/display/webgl/blend_manager.js +7 -7
  52. package/src/phaser/display/webgl/earcut.js +95 -95
  53. package/src/phaser/display/webgl/earcut_node.js +4 -4
  54. package/src/phaser/display/webgl/fast_sprite_batch.js +15 -15
  55. package/src/phaser/display/webgl/filter_manager.js +9 -9
  56. package/src/phaser/display/webgl/filter_texture.js +10 -10
  57. package/src/phaser/display/webgl/graphics.js +37 -37
  58. package/src/phaser/display/webgl/graphics_data.js +4 -4
  59. package/src/phaser/display/webgl/mask_manager.js +6 -6
  60. package/src/phaser/display/webgl/render_texture.js +16 -16
  61. package/src/phaser/display/webgl/renderer.js +20 -20
  62. package/src/phaser/display/webgl/shader/complex.js +4 -4
  63. package/src/phaser/display/webgl/shader/fast.js +4 -4
  64. package/src/phaser/display/webgl/shader/normal.js +8 -8
  65. package/src/phaser/display/webgl/shader/primitive.js +4 -4
  66. package/src/phaser/display/webgl/shader/strip.js +4 -4
  67. package/src/phaser/display/webgl/shader_manager.js +9 -9
  68. package/src/phaser/display/webgl/sprite_batch.js +18 -18
  69. package/src/phaser/display/webgl/stencil_manager.js +16 -16
  70. package/src/phaser/display/webgl/texture.js +13 -13
  71. package/src/phaser/display/webgl/texture_util.js +8 -8
  72. package/src/phaser/display/webgl/util.js +25 -25
  73. package/src/phaser/geom/circle.js +69 -69
  74. package/src/phaser/geom/ellipse.js +28 -28
  75. package/src/phaser/geom/line.js +93 -93
  76. package/src/phaser/geom/matrix.js +54 -54
  77. package/src/phaser/geom/point.js +96 -96
  78. package/src/phaser/geom/polygon.js +22 -22
  79. package/src/phaser/geom/rectangle.js +132 -132
  80. package/src/phaser/geom/rounded_rectangle.js +12 -12
  81. package/src/phaser/geom/util/circle.js +33 -33
  82. package/src/phaser/geom/util/ellipse.js +5 -5
  83. package/src/phaser/geom/util/line.js +26 -26
  84. package/src/phaser/geom/util/matrix.js +8 -8
  85. package/src/phaser/geom/util/point.js +97 -97
  86. package/src/phaser/geom/util/polygon.js +4 -4
  87. package/src/phaser/geom/util/rectangle.js +74 -74
  88. package/src/phaser/geom/util/rounded_rectangle.js +4 -4
  89. package/src/phaser/util/math.js +81 -81
  90. package/types/phaser/core/animation.d.ts +61 -56
  91. package/types/phaser/core/animation.d.ts.map +1 -1
  92. package/types/phaser/core/animation_manager.d.ts +55 -55
  93. package/types/phaser/core/cache.d.ts +154 -154
  94. package/types/phaser/core/device.d.ts.map +1 -1
  95. package/types/phaser/core/dom.d.ts +43 -43
  96. package/types/phaser/core/event_manager.d.ts +63 -63
  97. package/types/phaser/core/factory.d.ts +47 -47
  98. package/types/phaser/core/frame.d.ts +30 -30
  99. package/types/phaser/core/frame_data.d.ts +28 -27
  100. package/types/phaser/core/frame_data.d.ts.map +1 -1
  101. package/types/phaser/core/game.d.ts +52 -19
  102. package/types/phaser/core/game.d.ts.map +1 -1
  103. package/types/phaser/core/loader.d.ts +170 -170
  104. package/types/phaser/core/loader_parser.d.ts.map +1 -1
  105. package/types/phaser/core/raf.d.ts +1 -1
  106. package/types/phaser/core/scene.d.ts +15 -9
  107. package/types/phaser/core/scene.d.ts.map +1 -1
  108. package/types/phaser/core/scene_manager.d.ts +51 -43
  109. package/types/phaser/core/scene_manager.d.ts.map +1 -1
  110. package/types/phaser/core/signal.d.ts +54 -51
  111. package/types/phaser/core/signal.d.ts.map +1 -1
  112. package/types/phaser/core/sound.d.ts +54 -54
  113. package/types/phaser/core/sound_manager.d.ts +49 -49
  114. package/types/phaser/core/stage.d.ts +10 -10
  115. package/types/phaser/core/time.d.ts +30 -30
  116. package/types/phaser/core/timer.d.ts +64 -64
  117. package/types/phaser/core/timer_event.d.ts +9 -9
  118. package/types/phaser/core/tween.d.ts +90 -90
  119. package/types/phaser/core/tween_data.d.ts +30 -30
  120. package/types/phaser/core/tween_manager.d.ts +29 -24
  121. package/types/phaser/core/tween_manager.d.ts.map +1 -1
  122. package/types/phaser/core/world.d.ts +4 -3
  123. package/types/phaser/core/world.d.ts.map +1 -1
  124. package/types/phaser/display/bitmap_text.d.ts +59 -52
  125. package/types/phaser/display/bitmap_text.d.ts.map +1 -1
  126. package/types/phaser/display/button.d.ts +47 -46
  127. package/types/phaser/display/button.d.ts.map +1 -1
  128. package/types/phaser/display/canvas/buffer.d.ts +8 -8
  129. package/types/phaser/display/canvas/renderer.d.ts +16 -16
  130. package/types/phaser/display/display_object.d.ts +119 -108
  131. package/types/phaser/display/display_object.d.ts.map +1 -1
  132. package/types/phaser/display/graphics.d.ts +101 -101
  133. package/types/phaser/display/graphics_data.d.ts +10 -10
  134. package/types/phaser/display/group.d.ts +47 -47
  135. package/types/phaser/display/image.d.ts +42 -40
  136. package/types/phaser/display/image.d.ts.map +1 -1
  137. package/types/phaser/display/text.d.ts +207 -184
  138. package/types/phaser/display/text.d.ts.map +1 -1
  139. package/types/phaser/display/webgl/abstract_filter.d.ts +4 -4
  140. package/types/phaser/display/webgl/base_texture.d.ts +9 -9
  141. package/types/phaser/display/webgl/blend_manager.d.ts +6 -6
  142. package/types/phaser/display/webgl/earcut.d.ts +95 -95
  143. package/types/phaser/display/webgl/earcut_node.d.ts +4 -4
  144. package/types/phaser/display/webgl/fast_sprite_batch.d.ts +15 -15
  145. package/types/phaser/display/webgl/filter_manager.d.ts +8 -8
  146. package/types/phaser/display/webgl/filter_texture.d.ts +10 -10
  147. package/types/phaser/display/webgl/graphics_data.d.ts +4 -4
  148. package/types/phaser/display/webgl/render_texture.d.ts +16 -16
  149. package/types/phaser/display/webgl/renderer.d.ts +20 -20
  150. package/types/phaser/display/webgl/shader/complex.d.ts +4 -4
  151. package/types/phaser/display/webgl/shader/fast.d.ts +4 -4
  152. package/types/phaser/display/webgl/shader/normal.d.ts +8 -8
  153. package/types/phaser/display/webgl/shader/primitive.d.ts +4 -4
  154. package/types/phaser/display/webgl/shader/strip.d.ts +4 -4
  155. package/types/phaser/display/webgl/shader_manager.d.ts +8 -8
  156. package/types/phaser/display/webgl/sprite_batch.d.ts +17 -17
  157. package/types/phaser/display/webgl/stencil_manager.d.ts +15 -15
  158. package/types/phaser/display/webgl/texture.d.ts +12 -12
  159. package/types/phaser/geom/circle.d.ts +69 -69
  160. package/types/phaser/geom/ellipse.d.ts +28 -28
  161. package/types/phaser/geom/line.d.ts +93 -93
  162. package/types/phaser/geom/matrix.d.ts +54 -54
  163. package/types/phaser/geom/point.d.ts +96 -96
  164. package/types/phaser/geom/polygon.d.ts +22 -22
  165. package/types/phaser/geom/rectangle.d.ts +132 -132
  166. package/types/phaser/geom/rounded_rectangle.d.ts +12 -12
  167. package/pnpm-workspace.yaml +0 -4
@@ -7,8 +7,8 @@ import { renderCanvas, renderWebGL } from './sprite_util.js';
7
7
 
8
8
  export class DisplayObject {
9
9
  /**
10
- * TBD.
11
- * @param {import('../core/game.js').Game} game - TBD.
10
+ * Creates a new DisplayObject instance.
11
+ * @param {import('../core/game.js').Game} game - The game instance this display object belongs to.
12
12
  */
13
13
  constructor(game) {
14
14
  /** @type {boolean} */
@@ -69,7 +69,7 @@ export class DisplayObject {
69
69
  }
70
70
 
71
71
  /**
72
- * TBD.
72
+ * Destroys this display object and cleans up resources.
73
73
  */
74
74
  destroy() {
75
75
  if (this.children) {
@@ -103,20 +103,20 @@ export class DisplayObject {
103
103
  }
104
104
 
105
105
  /**
106
- * TBD.
107
- * @param {DisplayObject} child - TBD.
108
- * @returns {DisplayObject} TBD.
106
+ * Adds a child display object to this container.
107
+ * @param {DisplayObject} child - The child display object to add.
108
+ * @returns {DisplayObject} The added child display object.
109
109
  */
110
110
  addChild(child) {
111
111
  return this.addChildAt(child, this.children.length);
112
112
  }
113
113
 
114
114
  /**
115
- * TBD.
116
- * @param {DisplayObject} child - TBD.
117
- * @param {number} index - TBD.
118
- * @returns {DisplayObject} TBD.
119
- * @throws {Error}
115
+ * Adds a child display object at a specific index in the children list.
116
+ * @param {DisplayObject} child - The child display object to add.
117
+ * @param {number} index - The index to insert the child at.
118
+ * @returns {DisplayObject} The added child display object.
119
+ * @throws {Error} If the index is out of bounds.
120
120
  */
121
121
  addChildAt(child, index) {
122
122
  if (index >= 0 && index <= this.children.length) {
@@ -131,10 +131,10 @@ export class DisplayObject {
131
131
  }
132
132
 
133
133
  /**
134
- * TBD.
135
- * @param {DisplayObject} child - TBD.
136
- * @param {DisplayObject} child2 - TBD.
137
- * @throws {Error}
134
+ * Swaps the positions of two child display objects.
135
+ * @param {DisplayObject} child - The first child display object.
136
+ * @param {DisplayObject} child2 - The second child display object.
137
+ * @throws {Error} If either child is not a child of this container.
138
138
  */
139
139
  swapChildren(child, child2) {
140
140
  if (child === child2) {
@@ -150,10 +150,10 @@ export class DisplayObject {
150
150
  }
151
151
 
152
152
  /**
153
- * TBD.
154
- * @param {DisplayObject} child - TBD.
155
- * @returns {number} TBD.
156
- * @throws {Error}
153
+ * Gets the index of a child display object in the children list.
154
+ * @param {DisplayObject} child - The child display object to find.
155
+ * @returns {number} The index of the child in the children list.
156
+ * @throws {Error} If the child is not a child of this container.
157
157
  */
158
158
  getChildIndex(child) {
159
159
  const index = this.children.indexOf(child);
@@ -164,10 +164,10 @@ export class DisplayObject {
164
164
  }
165
165
 
166
166
  /**
167
- * TBD.
168
- * @param {DisplayObject} child - TBD.
169
- * @param {number} index - TBD.
170
- * @throws {Error}
167
+ * Sets the index of a child display object in the children list.
168
+ * @param {DisplayObject} child - The child display object to move.
169
+ * @param {number} index - The new index for the child.
170
+ * @throws {Error} If the index is out of bounds.
171
171
  */
172
172
  setChildIndex(child, index) {
173
173
  if (index < 0 || index >= this.children.length) {
@@ -179,10 +179,10 @@ export class DisplayObject {
179
179
  }
180
180
 
181
181
  /**
182
- * TBD.
183
- * @param {number} index - TBD.
184
- * @returns {DisplayObject} TBD.
185
- * @throws {Error}
182
+ * Gets a child display object at a specific index.
183
+ * @param {number} index - The index of the child to get.
184
+ * @returns {DisplayObject} The child display object at the specified index.
185
+ * @throws {Error} If the index is out of bounds.
186
186
  */
187
187
  getChildAt(index) {
188
188
  if (index < 0 || index >= this.children.length) {
@@ -196,9 +196,9 @@ export class DisplayObject {
196
196
  }
197
197
 
198
198
  /**
199
- * TBD.
200
- * @param {DisplayObject} child - TBD.
201
- * @returns {DisplayObject} TBD.
199
+ * Removes a child display object from this container.
200
+ * @param {DisplayObject} child - The child display object to remove.
201
+ * @returns {DisplayObject} The removed child display object.
202
202
  */
203
203
  removeChild(child) {
204
204
  const index = this.children.indexOf(child);
@@ -209,9 +209,9 @@ export class DisplayObject {
209
209
  }
210
210
 
211
211
  /**
212
- * TBD.
213
- * @param {number} index - TBD.
214
- * @returns {DisplayObject} TBD.
212
+ * Removes a child display object at a specific index.
213
+ * @param {number} index - The index of the child to remove.
214
+ * @returns {DisplayObject} The removed child display object.
215
215
  */
216
216
  removeChildAt(index) {
217
217
  const child = this.getChildAt(index);
@@ -223,11 +223,11 @@ export class DisplayObject {
223
223
  }
224
224
 
225
225
  /**
226
- * TBD.
227
- * @param {number} beginIndex - TBD.
228
- * @param {number} endIndex - TBD.
229
- * @returns {DisplayObject[]} TBD.
230
- * @throws {Error}
226
+ * Removes a range of child display objects from this container.
227
+ * @param {number} beginIndex - The starting index of the range to remove.
228
+ * @param {number} endIndex - The ending index (exclusive) of the range to remove.
229
+ * @returns {DisplayObject[]} The array of removed child display objects.
230
+ * @throws {Error} If the range is invalid.
231
231
  */
232
232
  removeChildren(beginIndex, endIndex) {
233
233
  if (beginIndex === undefined) {
@@ -252,9 +252,9 @@ export class DisplayObject {
252
252
  }
253
253
 
254
254
  /**
255
- * TBD.
256
- * @param {DisplayObject | null | undefined} parent - TBD.
257
- * @returns {DisplayObject} TBD.
255
+ * Updates the world transform of this display object and its children.
256
+ * @param {DisplayObject | null | undefined} parent - The parent display object to use for the world transform calculation.
257
+ * @returns {DisplayObject} This DisplayObject instance for chaining.
258
258
  */
259
259
  updateTransform(parent = null) {
260
260
  if (!parent && !this.parent) {
@@ -340,9 +340,9 @@ export class DisplayObject {
340
340
  }
341
341
 
342
342
  /**
343
- * TBD.
344
- * @param {DisplayObject} targetCoordinateSpace - TBD.
345
- * @returns {Rectangle} TBD.
343
+ * Gets the bounds of this display object in world coordinates.
344
+ * @param {DisplayObject} targetCoordinateSpace - The coordinate space to calculate bounds in.
345
+ * @returns {Rectangle} The bounds rectangle of this display object.
346
346
  */
347
347
  getBounds(targetCoordinateSpace) {
348
348
  const isTargetCoordinateSpaceDisplayObject = targetCoordinateSpace && targetCoordinateSpace.contains !== undefined;
@@ -442,17 +442,17 @@ export class DisplayObject {
442
442
  }
443
443
 
444
444
  /**
445
- * TBD.
446
- * @returns {Rectangle} TBD.
445
+ * Gets the bounds of this display object in local coordinates.
446
+ * @returns {Rectangle} The bounds rectangle of this display object in local space.
447
447
  */
448
448
  getLocalBounds() {
449
449
  return this.getBounds(this);
450
450
  }
451
451
 
452
452
  /**
453
- * TBD.
454
- * @param {DisplayObject} child - TBD.
455
- * @returns {boolean} TBD.
453
+ * Checks if a child display object is contained within this container.
454
+ * @param {DisplayObject} child - The child display object to check.
455
+ * @returns {boolean} True if the child is contained within this container, false otherwise.
456
456
  */
457
457
  contains(child) {
458
458
  if (!child) {
@@ -465,8 +465,8 @@ export class DisplayObject {
465
465
  }
466
466
 
467
467
  /**
468
- * TBD.
469
- * @param {object} renderSession - TBD.
468
+ * Renders this display object using WebGL.
469
+ * @param {object} renderSession - The WebGL rendering session.
470
470
  */
471
471
  renderWebGL(renderSession) {
472
472
  if (!this.visible || this.alpha <= 0) {
@@ -499,8 +499,8 @@ export class DisplayObject {
499
499
  }
500
500
 
501
501
  /**
502
- * TBD.
503
- * @param {object} renderSession - TBD.
502
+ * Renders this display object using Canvas.
503
+ * @param {object} renderSession - The Canvas rendering session.
504
504
  */
505
505
  renderCanvas(renderSession) {
506
506
  if (!this.visible || this.alpha <= 0) {
@@ -518,29 +518,29 @@ export class DisplayObject {
518
518
  }
519
519
 
520
520
  /**
521
- * TBD.
521
+ * Called before the update cycle for this display object.
522
522
  */
523
523
  preUpdate() {
524
524
  // override
525
525
  }
526
526
 
527
527
  /**
528
- * TBD.
528
+ * Called during the update cycle for this display object.
529
529
  */
530
530
  update() {
531
531
  // override
532
532
  }
533
533
 
534
534
  /**
535
- * TBD.
535
+ * Called after the update cycle for this display object.
536
536
  */
537
537
  postUpdate() {
538
538
  // override
539
539
  }
540
540
 
541
541
  /**
542
- * TBD.
543
- * @throws {Error}
542
+ * Generates a texture for this display object.
543
+ * @throws {Error} This method is not implemented yet.
544
544
  */
545
545
  generateTexture() {
546
546
  // TODO
@@ -548,9 +548,9 @@ export class DisplayObject {
548
548
  }
549
549
 
550
550
  /**
551
- * TBD.
552
- * @param {Point} position - TBD.
553
- * @returns {Point} TBD.
551
+ * Converts a local position to global (world) coordinates.
552
+ * @param {Point} position - The local position to convert.
553
+ * @returns {Point} The converted global position.
554
554
  */
555
555
  toGlobal(position) {
556
556
  this.updateTransform();
@@ -558,10 +558,10 @@ export class DisplayObject {
558
558
  }
559
559
 
560
560
  /**
561
- * TBD.
562
- * @param {Point} position - TBD.
563
- * @param {DisplayObject} from - TBD.
564
- * @returns {Point} TBD.
561
+ * Converts a global (world) position to local coordinates.
562
+ * @param {Point} position - The global position to convert.
563
+ * @param {DisplayObject} from - The display object to convert from (defaults to this).
564
+ * @returns {Point} The converted local position.
565
565
  */
566
566
  toLocal(position, from) {
567
567
  if (from) {
@@ -572,8 +572,8 @@ export class DisplayObject {
572
572
  }
573
573
 
574
574
  /**
575
- * TBD.
576
- * @param {object} renderSession - TBD.
575
+ * Renders a cached sprite for this display object.
576
+ * @param {object} renderSession - The rendering session.
577
577
  */
578
578
  renderCachedSprite(renderSession) {
579
579
  if (!this._cachedSprite) {
@@ -588,14 +588,14 @@ export class DisplayObject {
588
588
  }
589
589
 
590
590
  /**
591
- * TBD.
591
+ * Generates a cached sprite for this display object.
592
592
  */
593
593
  generateCachedSprite() {
594
594
  // TODO
595
595
  }
596
596
 
597
597
  /**
598
- * TBD.
598
+ * Destroys the cached sprite for this display object.
599
599
  */
600
600
  destroyCachedSprite() {
601
601
  if (!this._cachedSprite) {
@@ -608,15 +608,16 @@ export class DisplayObject {
608
608
  // GETTER SETTER
609
609
 
610
610
  /**
611
- * TBD.
612
- * @returns {number} TBD.
611
+ * Gets the width of this display object.
612
+ * @returns {number} The width in pixels.
613
613
  */
614
614
  get width() {
615
615
  return this.getLocalBounds().width * this.scale.x;
616
616
  }
617
617
 
618
618
  /**
619
- * TBD.
619
+ * Sets the width of this display object.
620
+ * @param {number} value - The new width in pixels.
620
621
  */
621
622
  set width(value) {
622
623
  const width = this.getLocalBounds().width;
@@ -629,15 +630,16 @@ export class DisplayObject {
629
630
  }
630
631
 
631
632
  /**
632
- * TBD.
633
- * @returns {number} TBD.
633
+ * Gets the height of this display object.
634
+ * @returns {number} The height in pixels.
634
635
  */
635
636
  get height() {
636
637
  return this.getLocalBounds().height * this.scale.y;
637
638
  }
638
639
 
639
640
  /**
640
- * TBD.
641
+ * Sets the height of this display object.
642
+ * @param {number} value - The new height in pixels.
641
643
  */
642
644
  set height(value) {
643
645
  const height = this.getLocalBounds().height;
@@ -650,38 +652,40 @@ export class DisplayObject {
650
652
  }
651
653
 
652
654
  /**
653
- * TBD.
654
- * @returns {number} TBD.
655
+ * Gets the x position of this display object.
656
+ * @returns {number} The x position in pixels.
655
657
  */
656
658
  get x() {
657
659
  return this.position.x;
658
660
  }
659
661
 
660
662
  /**
661
- * TBD.
663
+ * Sets the x position of this display object.
664
+ * @param {number} value - The new x position in pixels.
662
665
  */
663
666
  set x(value) {
664
667
  this.position.x = value;
665
668
  }
666
669
 
667
670
  /**
668
- * TBD.
669
- * @returns {number} TBD.
671
+ * Gets the y position of this display object.
672
+ * @returns {number} The y position in pixels.
670
673
  */
671
674
  get y() {
672
675
  return this.position.y;
673
676
  }
674
677
 
675
678
  /**
676
- * TBD.
679
+ * Sets the y position of this display object.
680
+ * @param {number} value - The new y position in pixels.
677
681
  */
678
682
  set y(value) {
679
683
  this.position.y = value;
680
684
  }
681
685
 
682
686
  /**
683
- * TBD.
684
- * @returns {boolean} TBD.
687
+ * Gets whether this display object is visible in the world.
688
+ * @returns {boolean} True if the object is visible, false otherwise.
685
689
  */
686
690
  get worldVisible() {
687
691
  if (!this.visible) {
@@ -703,15 +707,16 @@ export class DisplayObject {
703
707
  // MASK
704
708
 
705
709
  /**
706
- * TBD.
707
- * @returns {import('./graphics.js').Graphics} TBD.
710
+ * Gets the mask for this display object.
711
+ * @returns {import('./graphics.js').Graphics} The mask object or null if none is set.
708
712
  */
709
713
  get mask() {
710
714
  return this._mask;
711
715
  }
712
716
 
713
717
  /**
714
- * TBD.
718
+ * Sets the mask for this display object.
719
+ * @param {import('./graphics.js').Graphics} value - The mask object to set, or null to remove the mask.
715
720
  */
716
721
  set mask(value) {
717
722
  if (this._mask) {
@@ -726,106 +731,112 @@ export class DisplayObject {
726
731
  // BOUNDS
727
732
 
728
733
  /**
729
- * TBD.
730
- * @returns {number} TBD.
734
+ * Gets the x offset for this display object (based on anchor point).
735
+ * @returns {number} The x offset in pixels.
731
736
  */
732
737
  get offsetX() {
733
738
  return this.anchor.x * this.width;
734
739
  }
735
740
 
736
741
  /**
737
- * TBD.
738
- * @returns {number} TBD.
742
+ * Gets the y offset for this display object (based on anchor point).
743
+ * @returns {number} The y offset in pixels.
739
744
  */
740
745
  get offsetY() {
741
746
  return this.anchor.y * this.height;
742
747
  }
743
748
 
744
749
  /**
745
- * TBD.
746
- * @returns {number} TBD.
750
+ * Gets the center x position of this display object.
751
+ * @returns {number} The center x position in pixels.
747
752
  */
748
753
  get centerX() {
749
754
  return this.x - this.offsetX + this.width * 0.5;
750
755
  }
751
756
 
752
757
  /**
753
- * TBD.
758
+ * Sets the center x position of this display object.
759
+ * @param {number} value - The new center x position in pixels.
754
760
  */
755
761
  set centerX(value) {
756
762
  this.x = value + this.offsetX - this.width * 0.5;
757
763
  }
758
764
 
759
765
  /**
760
- * TBD.
761
- * @returns {number} TBD.
766
+ * Gets the center y position of this display object.
767
+ * @returns {number} The center y position in pixels.
762
768
  */
763
769
  get centerY() {
764
770
  return this.y - this.offsetY + this.height * 0.5;
765
771
  }
766
772
 
767
773
  /**
768
- * TBD.
774
+ * Sets the center y position of this display object.
775
+ * @param {number} value - The new center y position in pixels.
769
776
  */
770
777
  set centerY(value) {
771
778
  this.y = value + this.offsetY - this.height * 0.5;
772
779
  }
773
780
 
774
781
  /**
775
- * TBD.
776
- * @returns {number} TBD.
782
+ * Gets the left x position of this display object.
783
+ * @returns {number} The left x position in pixels.
777
784
  */
778
785
  get left() {
779
786
  return this.x - this.offsetX;
780
787
  }
781
788
 
782
789
  /**
783
- * TBD.
790
+ * Sets the left x position of this display object.
791
+ * @param {number} value - The new left x position in pixels.
784
792
  */
785
793
  set left(value) {
786
794
  this.x = value + this.offsetX;
787
795
  }
788
796
 
789
797
  /**
790
- * TBD.
791
- * @returns {number} TBD.
798
+ * Gets the right x position of this display object.
799
+ * @returns {number} The right x position in pixels.
792
800
  */
793
801
  get right() {
794
802
  return this.x + this.width - this.offsetX;
795
803
  }
796
804
 
797
805
  /**
798
- * TBD.
806
+ * Sets the right x position of this display object.
807
+ * @param {number} value - The new right x position in pixels.
799
808
  */
800
809
  set right(value) {
801
810
  this.x = value - this.width + this.offsetX;
802
811
  }
803
812
 
804
813
  /**
805
- * TBD.
806
- * @returns {number} TBD.
814
+ * Gets the top y position of this display object.
815
+ * @returns {number} The top y position in pixels.
807
816
  */
808
817
  get top() {
809
818
  return this.y - this.offsetY;
810
819
  }
811
820
 
812
821
  /**
813
- * TBD.
822
+ * Sets the top y position of this display object.
823
+ * @param {number} value - The new top y position in pixels.
814
824
  */
815
825
  set top(value) {
816
826
  this.y = value + this.offsetY;
817
827
  }
818
828
 
819
829
  /**
820
- * TBD.
821
- * @returns {number} TBD.
830
+ * Gets the bottom y position of this display object.
831
+ * @returns {number} The bottom y position in pixels.
822
832
  */
823
833
  get bottom() {
824
834
  return this.y + this.height - this.offsetY;
825
835
  }
826
836
 
827
837
  /**
828
- * TBD.
838
+ * Sets the bottom y position of this display object.
839
+ * @param {number} value - The new bottom y position in pixels.
829
840
  */
830
841
  set bottom(value) {
831
842
  this.y = value - this.height + this.offsetY;