@vpmedia/phaser 1.94.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 (205) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/package.json +11 -11
  3. package/src/phaser/core/animation.js +79 -56
  4. package/src/phaser/core/animation_manager.js +55 -55
  5. package/src/phaser/core/animation_parser.js +2 -2
  6. package/src/phaser/core/cache.js +154 -154
  7. package/src/phaser/core/device.js +2 -1
  8. package/src/phaser/core/device_util.js +27 -27
  9. package/src/phaser/core/dom.js +43 -43
  10. package/src/phaser/core/event_manager.js +63 -63
  11. package/src/phaser/core/factory.js +47 -47
  12. package/src/phaser/core/frame.js +30 -30
  13. package/src/phaser/core/frame_data.js +30 -28
  14. package/src/phaser/core/frame_util.js +8 -8
  15. package/src/phaser/core/game.js +35 -19
  16. package/src/phaser/core/input_pointer.js +18 -0
  17. package/src/phaser/core/loader.js +171 -171
  18. package/src/phaser/core/loader_parser.js +22 -22
  19. package/src/phaser/core/raf.js +1 -1
  20. package/src/phaser/core/scale_manager.js +3 -2
  21. package/src/phaser/core/scene.js +16 -10
  22. package/src/phaser/core/scene_manager.js +51 -43
  23. package/src/phaser/core/signal.js +56 -52
  24. package/src/phaser/core/sound.js +54 -54
  25. package/src/phaser/core/sound_manager.js +49 -49
  26. package/src/phaser/core/stage.js +16 -16
  27. package/src/phaser/core/time.js +54 -30
  28. package/src/phaser/core/timer.js +82 -64
  29. package/src/phaser/core/timer_event.js +9 -9
  30. package/src/phaser/core/tween.js +106 -90
  31. package/src/phaser/core/tween_data.js +30 -30
  32. package/src/phaser/core/tween_manager.js +32 -24
  33. package/src/phaser/core/world.js +4 -3
  34. package/src/phaser/display/bitmap_text.js +72 -54
  35. package/src/phaser/display/button.js +48 -47
  36. package/src/phaser/display/canvas/buffer.js +8 -8
  37. package/src/phaser/display/canvas/graphics.js +8 -8
  38. package/src/phaser/display/canvas/masker.js +5 -5
  39. package/src/phaser/display/canvas/pool.js +18 -18
  40. package/src/phaser/display/canvas/renderer.js +17 -16
  41. package/src/phaser/display/canvas/tinter.js +22 -22
  42. package/src/phaser/display/canvas/util.js +42 -42
  43. package/src/phaser/display/display_object.js +119 -108
  44. package/src/phaser/display/graphics.js +129 -112
  45. package/src/phaser/display/graphics_data.js +10 -10
  46. package/src/phaser/display/graphics_data_util.js +3 -3
  47. package/src/phaser/display/group.js +63 -50
  48. package/src/phaser/display/image.js +68 -50
  49. package/src/phaser/display/sprite_batch.js +2 -2
  50. package/src/phaser/display/sprite_util.js +19 -19
  51. package/src/phaser/display/text.js +217 -187
  52. package/src/phaser/display/webgl/abstract_filter.js +4 -4
  53. package/src/phaser/display/webgl/base_texture.js +9 -9
  54. package/src/phaser/display/webgl/blend_manager.js +7 -7
  55. package/src/phaser/display/webgl/earcut.js +95 -95
  56. package/src/phaser/display/webgl/earcut_node.js +4 -4
  57. package/src/phaser/display/webgl/fast_sprite_batch.js +15 -15
  58. package/src/phaser/display/webgl/filter_manager.js +9 -9
  59. package/src/phaser/display/webgl/filter_texture.js +10 -10
  60. package/src/phaser/display/webgl/graphics.js +37 -37
  61. package/src/phaser/display/webgl/graphics_data.js +4 -4
  62. package/src/phaser/display/webgl/mask_manager.js +6 -6
  63. package/src/phaser/display/webgl/render_texture.js +16 -16
  64. package/src/phaser/display/webgl/renderer.js +21 -20
  65. package/src/phaser/display/webgl/shader/complex.js +4 -4
  66. package/src/phaser/display/webgl/shader/fast.js +4 -4
  67. package/src/phaser/display/webgl/shader/normal.js +8 -8
  68. package/src/phaser/display/webgl/shader/primitive.js +4 -4
  69. package/src/phaser/display/webgl/shader/strip.js +4 -4
  70. package/src/phaser/display/webgl/shader_manager.js +9 -9
  71. package/src/phaser/display/webgl/sprite_batch.js +18 -18
  72. package/src/phaser/display/webgl/stencil_manager.js +16 -16
  73. package/src/phaser/display/webgl/texture.js +13 -13
  74. package/src/phaser/display/webgl/texture_util.js +8 -8
  75. package/src/phaser/display/webgl/util.js +25 -25
  76. package/src/phaser/geom/circle.js +74 -69
  77. package/src/phaser/geom/ellipse.js +33 -28
  78. package/src/phaser/geom/line.js +96 -93
  79. package/src/phaser/geom/matrix.js +61 -54
  80. package/src/phaser/geom/point.js +99 -96
  81. package/src/phaser/geom/polygon.js +27 -22
  82. package/src/phaser/geom/rectangle.js +137 -132
  83. package/src/phaser/geom/rounded_rectangle.js +12 -12
  84. package/src/phaser/geom/util/circle.js +33 -33
  85. package/src/phaser/geom/util/ellipse.js +5 -5
  86. package/src/phaser/geom/util/line.js +26 -26
  87. package/src/phaser/geom/util/matrix.js +8 -8
  88. package/src/phaser/geom/util/point.js +97 -97
  89. package/src/phaser/geom/util/polygon.js +4 -4
  90. package/src/phaser/geom/util/rectangle.js +74 -74
  91. package/src/phaser/geom/util/rounded_rectangle.js +4 -4
  92. package/src/phaser/util/math.js +81 -81
  93. package/types/phaser/core/animation.d.ts +79 -56
  94. package/types/phaser/core/animation.d.ts.map +1 -1
  95. package/types/phaser/core/animation_manager.d.ts +55 -55
  96. package/types/phaser/core/animation_parser.d.ts +3 -2
  97. package/types/phaser/core/animation_parser.d.ts.map +1 -1
  98. package/types/phaser/core/cache.d.ts +154 -154
  99. package/types/phaser/core/device.d.ts.map +1 -1
  100. package/types/phaser/core/dom.d.ts +51 -44
  101. package/types/phaser/core/dom.d.ts.map +1 -1
  102. package/types/phaser/core/event_manager.d.ts +63 -63
  103. package/types/phaser/core/factory.d.ts +47 -47
  104. package/types/phaser/core/frame.d.ts +30 -30
  105. package/types/phaser/core/frame_data.d.ts +28 -27
  106. package/types/phaser/core/frame_data.d.ts.map +1 -1
  107. package/types/phaser/core/game.d.ts +54 -21
  108. package/types/phaser/core/game.d.ts.map +1 -1
  109. package/types/phaser/core/input_pointer.d.ts +18 -0
  110. package/types/phaser/core/input_pointer.d.ts.map +1 -1
  111. package/types/phaser/core/loader.d.ts +175 -172
  112. package/types/phaser/core/loader.d.ts.map +1 -1
  113. package/types/phaser/core/loader_parser.d.ts.map +1 -1
  114. package/types/phaser/core/raf.d.ts +1 -1
  115. package/types/phaser/core/scale_manager.d.ts +6 -5
  116. package/types/phaser/core/scale_manager.d.ts.map +1 -1
  117. package/types/phaser/core/scene.d.ts +15 -9
  118. package/types/phaser/core/scene.d.ts.map +1 -1
  119. package/types/phaser/core/scene_manager.d.ts +51 -43
  120. package/types/phaser/core/scene_manager.d.ts.map +1 -1
  121. package/types/phaser/core/signal.d.ts +54 -51
  122. package/types/phaser/core/signal.d.ts.map +1 -1
  123. package/types/phaser/core/sound.d.ts +54 -54
  124. package/types/phaser/core/sound_manager.d.ts +49 -49
  125. package/types/phaser/core/stage.d.ts +10 -10
  126. package/types/phaser/core/time.d.ts +54 -30
  127. package/types/phaser/core/time.d.ts.map +1 -1
  128. package/types/phaser/core/timer.d.ts +82 -64
  129. package/types/phaser/core/timer.d.ts.map +1 -1
  130. package/types/phaser/core/timer_event.d.ts +9 -9
  131. package/types/phaser/core/tween.d.ts +106 -90
  132. package/types/phaser/core/tween.d.ts.map +1 -1
  133. package/types/phaser/core/tween_data.d.ts +30 -30
  134. package/types/phaser/core/tween_manager.d.ts +35 -67
  135. package/types/phaser/core/tween_manager.d.ts.map +1 -1
  136. package/types/phaser/core/world.d.ts +4 -3
  137. package/types/phaser/core/world.d.ts.map +1 -1
  138. package/types/phaser/display/bitmap_text.d.ts +76 -53
  139. package/types/phaser/display/bitmap_text.d.ts.map +1 -1
  140. package/types/phaser/display/button.d.ts +47 -46
  141. package/types/phaser/display/button.d.ts.map +1 -1
  142. package/types/phaser/display/canvas/buffer.d.ts +8 -8
  143. package/types/phaser/display/canvas/graphics.d.ts +3 -3
  144. package/types/phaser/display/canvas/graphics.d.ts.map +1 -1
  145. package/types/phaser/display/canvas/pool.d.ts +6 -3
  146. package/types/phaser/display/canvas/pool.d.ts.map +1 -1
  147. package/types/phaser/display/canvas/renderer.d.ts +18 -17
  148. package/types/phaser/display/canvas/renderer.d.ts.map +1 -1
  149. package/types/phaser/display/canvas/util.d.ts +6 -6
  150. package/types/phaser/display/canvas/util.d.ts.map +1 -1
  151. package/types/phaser/display/display_object.d.ts +119 -108
  152. package/types/phaser/display/display_object.d.ts.map +1 -1
  153. package/types/phaser/display/graphics.d.ts +118 -102
  154. package/types/phaser/display/graphics.d.ts.map +1 -1
  155. package/types/phaser/display/graphics_data.d.ts +10 -10
  156. package/types/phaser/display/group.d.ts +59 -47
  157. package/types/phaser/display/group.d.ts.map +1 -1
  158. package/types/phaser/display/image.d.ts +58 -45
  159. package/types/phaser/display/image.d.ts.map +1 -1
  160. package/types/phaser/display/text.d.ts +237 -188
  161. package/types/phaser/display/text.d.ts.map +1 -1
  162. package/types/phaser/display/webgl/abstract_filter.d.ts +4 -4
  163. package/types/phaser/display/webgl/base_texture.d.ts +10 -10
  164. package/types/phaser/display/webgl/base_texture.d.ts.map +1 -1
  165. package/types/phaser/display/webgl/blend_manager.d.ts +6 -6
  166. package/types/phaser/display/webgl/earcut.d.ts +95 -95
  167. package/types/phaser/display/webgl/earcut_node.d.ts +4 -4
  168. package/types/phaser/display/webgl/fast_sprite_batch.d.ts +15 -15
  169. package/types/phaser/display/webgl/filter_manager.d.ts +8 -8
  170. package/types/phaser/display/webgl/filter_texture.d.ts +10 -10
  171. package/types/phaser/display/webgl/graphics.d.ts +2 -2
  172. package/types/phaser/display/webgl/graphics.d.ts.map +1 -1
  173. package/types/phaser/display/webgl/graphics_data.d.ts +4 -4
  174. package/types/phaser/display/webgl/render_texture.d.ts +16 -16
  175. package/types/phaser/display/webgl/renderer.d.ts +21 -20
  176. package/types/phaser/display/webgl/renderer.d.ts.map +1 -1
  177. package/types/phaser/display/webgl/shader/complex.d.ts +4 -4
  178. package/types/phaser/display/webgl/shader/fast.d.ts +4 -4
  179. package/types/phaser/display/webgl/shader/normal.d.ts +8 -8
  180. package/types/phaser/display/webgl/shader/primitive.d.ts +4 -4
  181. package/types/phaser/display/webgl/shader/strip.d.ts +4 -4
  182. package/types/phaser/display/webgl/shader_manager.d.ts +8 -8
  183. package/types/phaser/display/webgl/sprite_batch.d.ts +17 -17
  184. package/types/phaser/display/webgl/stencil_manager.d.ts +15 -15
  185. package/types/phaser/display/webgl/texture.d.ts +12 -12
  186. package/types/phaser/display/webgl/texture_util.d.ts +4 -2
  187. package/types/phaser/display/webgl/texture_util.d.ts.map +1 -1
  188. package/types/phaser/geom/circle.d.ts +74 -69
  189. package/types/phaser/geom/circle.d.ts.map +1 -1
  190. package/types/phaser/geom/ellipse.d.ts +33 -28
  191. package/types/phaser/geom/ellipse.d.ts.map +1 -1
  192. package/types/phaser/geom/line.d.ts +96 -93
  193. package/types/phaser/geom/line.d.ts.map +1 -1
  194. package/types/phaser/geom/matrix.d.ts +61 -54
  195. package/types/phaser/geom/matrix.d.ts.map +1 -1
  196. package/types/phaser/geom/point.d.ts +99 -96
  197. package/types/phaser/geom/point.d.ts.map +1 -1
  198. package/types/phaser/geom/polygon.d.ts +29 -23
  199. package/types/phaser/geom/polygon.d.ts.map +1 -1
  200. package/types/phaser/geom/rectangle.d.ts +137 -132
  201. package/types/phaser/geom/rectangle.d.ts.map +1 -1
  202. package/types/phaser/geom/rounded_rectangle.d.ts +12 -12
  203. package/types/phaser/geom/util/point.d.ts +1 -1
  204. package/types/phaser/geom/util/point.d.ts.map +1 -1
  205. package/pnpm-workspace.yaml +0 -4
@@ -4,18 +4,18 @@ import { Device } from './device.js';
4
4
  const logger = new Logger('device');
5
5
 
6
6
  /**
7
- * TBD.
8
- * @param {Device} device - TBD.
9
- * @param {string} type - TBD.
10
- * @returns {boolean} TBD.
7
+ * Check if the device can play a specific audio format.
8
+ * @param {Device} device - The device instance to check.
9
+ * @param {string} type - The audio format type to check.
10
+ * @returns {boolean} True if the device can play this audio format, false otherwise.
11
11
  */
12
12
  export const canPlayAudio = (device, type) => {
13
13
  return device.supportedAudioFormats[type] === true;
14
14
  };
15
15
 
16
16
  /**
17
- * TBD.
18
- * @param {Device} device - TBD.
17
+ * Detect the operating system of the device.
18
+ * @param {Device} device - The device instance to update.
19
19
  */
20
20
  export const checkOS = (device) => {
21
21
  const ua = navigator.userAgent;
@@ -51,8 +51,8 @@ export const checkOS = (device) => {
51
51
  };
52
52
 
53
53
  /**
54
- * TBD.
55
- * @param {Device} device - TBD.
54
+ * Detect input capabilities of the device.
55
+ * @param {Device} device - The device instance to update.
56
56
  */
57
57
  export const checkInput = (device) => {
58
58
  if (
@@ -71,8 +71,8 @@ export const checkInput = (device) => {
71
71
  };
72
72
 
73
73
  /**
74
- * TBD.
75
- * @param {Device} device - TBD.
74
+ * Check for fullscreen support capabilities.
75
+ * @param {Device} device - The device instance to update.
76
76
  */
77
77
  export const checkFullScreenSupport = (device) => {
78
78
  const fs = [
@@ -118,8 +118,8 @@ export const checkFullScreenSupport = (device) => {
118
118
  };
119
119
 
120
120
  /**
121
- * TBD.
122
- * @param {Device} device - TBD.
121
+ * Detect the browser type.
122
+ * @param {Device} device - The device instance to update.
123
123
  */
124
124
  export const checkBrowser = (device) => {
125
125
  const ua = navigator.userAgent;
@@ -135,10 +135,10 @@ export const checkBrowser = (device) => {
135
135
  };
136
136
 
137
137
  /**
138
- * Check for codec support.
139
- * @param {HTMLAudioElement} audioElement - TBD.
140
- * @param {string} type - TBD.
141
- * @returns {boolean} TBD.
138
+ * Check if an audio element can play a specific codec.
139
+ * @param {HTMLAudioElement} audioElement - The audio element to test.
140
+ * @param {string} type - The codec type to check.
141
+ * @returns {boolean} True if the codec is supported, false otherwise.
142
142
  */
143
143
  export const canPlayType = (audioElement, type) => {
144
144
  try {
@@ -152,9 +152,9 @@ export const canPlayType = (audioElement, type) => {
152
152
  };
153
153
 
154
154
  /**
155
- * Check for codec support.
156
- * @param {string} type - TBD.
157
- * @returns {boolean} TBD.
155
+ * Check if a media source type is supported by the browser.
156
+ * @param {string} type - The media source type to check.
157
+ * @returns {boolean} True if the media source type is supported, false otherwise.
158
158
  */
159
159
  export const isMediaSourceTypeSupported = (type) => {
160
160
  if ('MediaSource' in window) {
@@ -170,8 +170,8 @@ export const isMediaSourceTypeSupported = (type) => {
170
170
  };
171
171
 
172
172
  /**
173
- * TBD.
174
- * @param {Device} device - TBD.
173
+ * Check for supported audio formats on the device.
174
+ * @param {Device} device - The device instance to update with audio format support.
175
175
  * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types/Common_types
176
176
  * @see https://developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements
177
177
  * @see https://bit.ly/iphoneoscodecs
@@ -205,8 +205,8 @@ export const checkAudio = (device) => {
205
205
  };
206
206
 
207
207
  /**
208
- * TBD.
209
- * @param {Device} device - TBD.
208
+ * Check for supported image formats on the device.
209
+ * @param {Device} device - The device instance to update with image format support.
210
210
  */
211
211
  export const checkImage = (device) => {
212
212
  try {
@@ -233,8 +233,8 @@ export const checkImage = (device) => {
233
233
  };
234
234
 
235
235
  /**
236
- * TBD.
237
- * @param {Device} device - TBD.
236
+ * Initialize device capabilities detection.
237
+ * @param {Device} device - The device instance to initialize.
238
238
  */
239
239
  export const initialize = (device) => {
240
240
  logger.info('initialize');
@@ -247,8 +247,8 @@ export const initialize = (device) => {
247
247
  };
248
248
 
249
249
  /**
250
- * TBD.
251
- * @returns {Device} TBD.
250
+ * Create a new Device instance.
251
+ * @returns {Device} A new Device instance.
252
252
  */
253
253
  export const createDevice = () => {
254
254
  return new Device();
@@ -2,32 +2,32 @@ import { Point } from '../geom/point.js';
2
2
 
3
3
  class VisualBoundsDesktopRectangle {
4
4
  /**
5
- * TBD.
6
- * @returns {number} TBD.
5
+ * Gets the horizontal scroll position of the window.
6
+ * @returns {number} The horizontal scroll position in pixels.
7
7
  */
8
8
  get x() {
9
9
  return window && 'pageXOffset' in window ? window.pageXOffset : document.documentElement.scrollLeft;
10
10
  }
11
11
 
12
12
  /**
13
- * TBD.
14
- * @returns {number} TBD.
13
+ * Gets the vertical scroll position of the window.
14
+ * @returns {number} The vertical scroll position in pixels.
15
15
  */
16
16
  get y() {
17
17
  return window && 'pageYOffset' in window ? window.pageYOffset : document.documentElement.scrollTop;
18
18
  }
19
19
 
20
20
  /**
21
- * TBD.
22
- * @returns {number} TBD.
21
+ * Gets the width of the window.
22
+ * @returns {number} The width of the window in pixels.
23
23
  */
24
24
  get width() {
25
25
  return Math.max(window.innerWidth, document.documentElement.clientWidth);
26
26
  }
27
27
 
28
28
  /**
29
- * TBD.
30
- * @returns {number} TBD.
29
+ * Gets the height of the window.
30
+ * @returns {number} The height of the window in pixels.
31
31
  */
32
32
  get height() {
33
33
  return Math.max(window.innerHeight, document.documentElement.clientHeight);
@@ -36,32 +36,32 @@ class VisualBoundsDesktopRectangle {
36
36
 
37
37
  class LayoutBoundsDesktopRectangle {
38
38
  /**
39
- * TBD.
40
- * @returns {number} TBD.
39
+ * Gets the horizontal scroll position of the window.
40
+ * @returns {number} The horizontal scroll position in pixels.
41
41
  */
42
42
  get x() {
43
43
  return 0;
44
44
  }
45
45
 
46
46
  /**
47
- * TBD.
48
- * @returns {number} TBD.
47
+ * Gets the vertical scroll position of the window.
48
+ * @returns {number} The vertical scroll position in pixels.
49
49
  */
50
50
  get y() {
51
51
  return 0;
52
52
  }
53
53
 
54
54
  /**
55
- * TBD.
56
- * @returns {number} TBD.
55
+ * Gets the width of the window.
56
+ * @returns {number} The width of the window in pixels.
57
57
  */
58
58
  get width() {
59
59
  return Math.max(window.innerWidth, document.documentElement.clientWidth);
60
60
  }
61
61
 
62
62
  /**
63
- * TBD.
64
- * @returns {number} TBD.
63
+ * Gets the height of the window.
64
+ * @returns {number} The height of the window in pixels.
65
65
  */
66
66
  get height() {
67
67
  return Math.max(window.innerHeight, document.documentElement.clientHeight);
@@ -70,16 +70,16 @@ class LayoutBoundsDesktopRectangle {
70
70
 
71
71
  class VisualBoundsRectangle {
72
72
  /**
73
- * TBD.
74
- * @returns {number} TBD.
73
+ * Gets the horizontal scroll position of the document.
74
+ * @returns {number} The horizontal scroll position in pixels.
75
75
  */
76
76
  get x() {
77
77
  return window && 'pageXOffset' in window ? window.pageXOffset : document.documentElement.scrollLeft;
78
78
  }
79
79
 
80
80
  /**
81
- * TBD.
82
- * @returns {number} TBD.
81
+ * Gets the vertical scroll position of the document.
82
+ * @returns {number} The vertical scroll position in pixels.
83
83
  */
84
84
  get y() {
85
85
  return window && 'pageYOffset' in window ? window.pageYOffset : document.documentElement.scrollTop;
@@ -199,10 +199,10 @@ export class DOM {
199
199
  }
200
200
 
201
201
  /**
202
- * TBD.
203
- * @param {HTMLCanvasElement} element - TBD.
204
- * @param {Point} point - TBD.
205
- * @returns {Point} TBD.
202
+ * Gets the offset position of an element relative to the document.
203
+ * @param {HTMLCanvasElement} element - The element to get the offset for.
204
+ * @param {Point} point - Optional Point object to store the result.
205
+ * @returns {Point} The offset position of the element.
206
206
  */
207
207
  getOffset(element, point = null) {
208
208
  point = point || new Point();
@@ -217,10 +217,10 @@ export class DOM {
217
217
  }
218
218
 
219
219
  /**
220
- * TBD.
221
- * @param {HTMLCanvasElement} element - TBD.
222
- * @param {number} cushion - TBD.
223
- * @returns {boolean} TBD.
220
+ * Gets the bounding rectangle of an element with optional cushion.
221
+ * @param {HTMLCanvasElement} element - The element to get bounds for.
222
+ * @param {number} cushion - Optional padding to add around the element.
223
+ * @returns {boolean} True if bounds were successfully retrieved, false otherwise.
224
224
  */
225
225
  getBounds(element, cushion = 0) {
226
226
  element = element && !element.nodeType ? element[0] : element;
@@ -231,10 +231,10 @@ export class DOM {
231
231
  }
232
232
 
233
233
  /**
234
- * TBD.
235
- * @param {DOMRect} coords - TBD.
236
- * @param {number} cushion - TBD.
237
- * @returns {object} TBD.
234
+ * Calibrates DOM rectangle coordinates with optional cushion.
235
+ * @param {DOMRect} coords - The DOM rectangle coordinates to calibrate.
236
+ * @param {number} cushion - Optional padding to add around the rectangle.
237
+ * @returns {{width: number, height: number, left: number, right: number, top: number, bottom: number}} The calibrated rectangle.
238
238
  */
239
239
  calibrate(coords, cushion = 0) {
240
240
  const output = {
@@ -251,9 +251,9 @@ export class DOM {
251
251
  }
252
252
 
253
253
  /**
254
- * TBD.
255
- * @param {string} primaryFallback - TBD.
256
- * @returns {string} TBD.
254
+ * Gets the screen orientation.
255
+ * @param {string} primaryFallback - The fallback method to use if screen orientation API is not available.
256
+ * @returns {string} The screen orientation ('portrait-primary', 'landscape-primary', etc.).
257
257
  */
258
258
  getScreenOrientation(primaryFallback) {
259
259
  const screen = window.screen;
@@ -286,32 +286,32 @@ export class DOM {
286
286
  }
287
287
 
288
288
  /**
289
- * TBD.
290
- * @returns {number} TBD.
289
+ * Gets the horizontal scroll position of the window.
290
+ * @returns {number} The horizontal scroll position in pixels.
291
291
  */
292
292
  get scrollX() {
293
293
  return this.scrollXProvider();
294
294
  }
295
295
 
296
296
  /**
297
- * TBD.
298
- * @returns {number} TBD.
297
+ * Gets the vertical scroll position of the window.
298
+ * @returns {number} The vertical scroll position in pixels.
299
299
  */
300
300
  get scrollY() {
301
301
  return this.scrollYProvider();
302
302
  }
303
303
 
304
304
  /**
305
- * TBD.
306
- * @returns {number} TBD.
305
+ * Gets the width of the window's client area.
306
+ * @returns {number} The width of the client area in pixels.
307
307
  */
308
308
  get clientWidth() {
309
309
  return Math.max(window.innerWidth, document.documentElement.clientWidth);
310
310
  }
311
311
 
312
312
  /**
313
- * TBD.
314
- * @returns {number} TBD.
313
+ * Gets the height of the window's client area.
314
+ * @returns {number} The height of the client area in pixels.
315
315
  */
316
316
  get clientHeight() {
317
317
  return Math.max(window.innerHeight, document.documentElement.clientHeight);
@@ -2,8 +2,8 @@ import { Signal } from './signal.js';
2
2
 
3
3
  export class EventManager {
4
4
  /**
5
- * TBD.
6
- * @param {import('../display/display_object.js').DisplayObject} sprite - TBD.
5
+ * Creates a new EventManager instance.
6
+ * @param {import('../display/display_object.js').DisplayObject} sprite - Reference to the parent DisplayObject.
7
7
  */
8
8
  constructor(sprite) {
9
9
  this.parent = sprite;
@@ -25,7 +25,7 @@ export class EventManager {
25
25
  }
26
26
 
27
27
  /**
28
- * TBD.
28
+ * Destroys the EventManager and cleans up resources.
29
29
  */
30
30
  destroy() {
31
31
  this._parent = null;
@@ -77,8 +77,8 @@ export class EventManager {
77
77
  }
78
78
 
79
79
  /**
80
- * TBD.
81
- * @returns {Signal} TBD.
80
+ * Gets the onAddedToGroup signal.
81
+ * @returns {Signal} The Signal object for the onAddedToGroup event.
82
82
  */
83
83
  get onAddedToGroup() {
84
84
  if (!this._onAddedToGroup) {
@@ -88,8 +88,8 @@ export class EventManager {
88
88
  }
89
89
 
90
90
  /**
91
- * TBD.
92
- * @param {...any} args - TBD.
91
+ * Dispatches the onAddedToGroup event.
92
+ * @param {...any} args - Arguments to pass to the signal.
93
93
  */
94
94
  onAddedToGroup$dispatch(...args) {
95
95
  if (this._onAddedToGroup) {
@@ -98,8 +98,8 @@ export class EventManager {
98
98
  }
99
99
 
100
100
  /**
101
- * TBD.
102
- * @returns {Signal} TBD.
101
+ * Gets the onRemovedFromGroup signal.
102
+ * @returns {Signal} The Signal object for the onRemovedFromGroup event.
103
103
  */
104
104
  get onRemovedFromGroup() {
105
105
  if (!this._onRemovedFromGroup) {
@@ -109,8 +109,8 @@ export class EventManager {
109
109
  }
110
110
 
111
111
  /**
112
- * TBD.
113
- * @param {...any} args - TBD.
112
+ * Dispatches the onRemovedFromGroup event.
113
+ * @param {...any} args - Arguments to pass to the signal.
114
114
  */
115
115
  onRemovedFromGroup$dispatch(...args) {
116
116
  if (this._onRemovedFromGroup) {
@@ -119,8 +119,8 @@ export class EventManager {
119
119
  }
120
120
 
121
121
  /**
122
- * TBD.
123
- * @returns {Signal} TBD.
122
+ * Gets the onDestroy signal.
123
+ * @returns {Signal} The Signal object for the onDestroy event.
124
124
  */
125
125
  get onDestroy() {
126
126
  if (!this._onDestroy) {
@@ -130,8 +130,8 @@ export class EventManager {
130
130
  }
131
131
 
132
132
  /**
133
- * TBD.
134
- * @param {...any} args - TBD.
133
+ * Dispatches the onDestroy event.
134
+ * @param {...any} args - Arguments to pass to the signal.
135
135
  */
136
136
  onDestroy$dispatch(...args) {
137
137
  if (this._onDestroy) {
@@ -140,8 +140,8 @@ export class EventManager {
140
140
  }
141
141
 
142
142
  /**
143
- * TBD.
144
- * @returns {Signal} TBD.
143
+ * Gets the onOutOfBounds signal.
144
+ * @returns {Signal} The Signal object for the onOutOfBounds event.
145
145
  */
146
146
  get onOutOfBounds() {
147
147
  if (!this._onOutOfBounds) {
@@ -151,8 +151,8 @@ export class EventManager {
151
151
  }
152
152
 
153
153
  /**
154
- * TBD.
155
- * @param {...any} args - TBD.
154
+ * Dispatches the onOutOfBounds event.
155
+ * @param {...any} args - Arguments to pass to the signal.
156
156
  */
157
157
  onOutOfBounds$dispatch(...args) {
158
158
  if (this._onOutOfBounds) {
@@ -161,8 +161,8 @@ export class EventManager {
161
161
  }
162
162
 
163
163
  /**
164
- * TBD.
165
- * @returns {Signal} TBD.
164
+ * Gets the onEnterBounds signal.
165
+ * @returns {Signal} The Signal object for the onEnterBounds event.
166
166
  */
167
167
  get onEnterBounds() {
168
168
  if (!this._onEnterBounds) {
@@ -172,8 +172,8 @@ export class EventManager {
172
172
  }
173
173
 
174
174
  /**
175
- * TBD.
176
- * @param {...any} args - TBD.
175
+ * Dispatches the onEnterBounds event.
176
+ * @param {...any} args - Arguments to pass to the signal.
177
177
  */
178
178
  onEnterBounds$dispatch(...args) {
179
179
  if (this._onEnterBounds) {
@@ -182,8 +182,8 @@ export class EventManager {
182
182
  }
183
183
 
184
184
  /**
185
- * TBD.
186
- * @returns {Signal} TBD.
185
+ * Gets the onInputOver signal.
186
+ * @returns {Signal} The Signal object for the onInputOver event.
187
187
  */
188
188
  get onInputOver() {
189
189
  if (!this._onInputOver) {
@@ -193,8 +193,8 @@ export class EventManager {
193
193
  }
194
194
 
195
195
  /**
196
- * TBD.
197
- * @param {...any} args - TBD.
196
+ * Dispatches the onInputOver event.
197
+ * @param {...any} args - Arguments to pass to the signal.
198
198
  */
199
199
  onInputOver$dispatch(...args) {
200
200
  if (this._onInputOver) {
@@ -203,8 +203,8 @@ export class EventManager {
203
203
  }
204
204
 
205
205
  /**
206
- * TBD.
207
- * @returns {Signal} TBD.
206
+ * Gets the onInputOut signal.
207
+ * @returns {Signal} The Signal object for the onInputOut event.
208
208
  */
209
209
  get onInputOut() {
210
210
  if (!this._onInputOut) {
@@ -214,8 +214,8 @@ export class EventManager {
214
214
  }
215
215
 
216
216
  /**
217
- * TBD.
218
- * @param {...any} args - TBD.
217
+ * Dispatches the onInputOut event.
218
+ * @param {...any} args - Arguments to pass to the signal.
219
219
  */
220
220
  onInputOut$dispatch(...args) {
221
221
  if (this._onInputOut) {
@@ -224,8 +224,8 @@ export class EventManager {
224
224
  }
225
225
 
226
226
  /**
227
- * TBD.
228
- * @returns {Signal} TBD.
227
+ * Gets the onInputDown signal.
228
+ * @returns {Signal} The Signal object for the onInputDown event.
229
229
  */
230
230
  get onInputDown() {
231
231
  if (!this._onInputDown) {
@@ -235,8 +235,8 @@ export class EventManager {
235
235
  }
236
236
 
237
237
  /**
238
- * TBD.
239
- * @param {...any} args - TBD.
238
+ * Dispatches the onInputDown event.
239
+ * @param {...any} args - Arguments to pass to the signal.
240
240
  */
241
241
  onInputDown$dispatch(...args) {
242
242
  if (this._onInputDown) {
@@ -245,8 +245,8 @@ export class EventManager {
245
245
  }
246
246
 
247
247
  /**
248
- * TBD.
249
- * @returns {Signal} TBD.
248
+ * Gets the onInputUp signal.
249
+ * @returns {Signal} The Signal object for the onInputUp event.
250
250
  */
251
251
  get onInputUp() {
252
252
  if (!this._onInputUp) {
@@ -256,8 +256,8 @@ export class EventManager {
256
256
  }
257
257
 
258
258
  /**
259
- * TBD.
260
- * @param {...any} args - TBD.
259
+ * Dispatches the onInputUp event.
260
+ * @param {...any} args - Arguments to pass to the signal.
261
261
  */
262
262
  onInputUp$dispatch(...args) {
263
263
  if (this._onInputUp) {
@@ -266,8 +266,8 @@ export class EventManager {
266
266
  }
267
267
 
268
268
  /**
269
- * TBD.
270
- * @returns {Signal} TBD.
269
+ * Gets the onDragStart signal.
270
+ * @returns {Signal} The Signal object for the onDragStart event.
271
271
  */
272
272
  get onDragStart() {
273
273
  if (!this._onDragStart) {
@@ -277,8 +277,8 @@ export class EventManager {
277
277
  }
278
278
 
279
279
  /**
280
- * TBD.
281
- * @param {...any} args - TBD.
280
+ * Dispatches the onDragStart event.
281
+ * @param {...any} args - Arguments to pass to the signal.
282
282
  */
283
283
  onDragStart$dispatch(...args) {
284
284
  if (this._onDragStart) {
@@ -287,8 +287,8 @@ export class EventManager {
287
287
  }
288
288
 
289
289
  /**
290
- * TBD.
291
- * @returns {Signal} TBD.
290
+ * Gets the onDragUpdate signal.
291
+ * @returns {Signal} The Signal object for the onDragUpdate event.
292
292
  */
293
293
  get onDragUpdate() {
294
294
  if (!this._onDragUpdate) {
@@ -298,8 +298,8 @@ export class EventManager {
298
298
  }
299
299
 
300
300
  /**
301
- * TBD.
302
- * @param {...any} args - TBD.
301
+ * Dispatches the onDragUpdate event.
302
+ * @param {...any} args - Arguments to pass to the signal.
303
303
  */
304
304
  onDragUpdate$dispatch(...args) {
305
305
  if (this._onDragUpdate) {
@@ -308,8 +308,8 @@ export class EventManager {
308
308
  }
309
309
 
310
310
  /**
311
- * TBD.
312
- * @returns {Signal} TBD.
311
+ * Gets the onDragStop signal.
312
+ * @returns {Signal} The Signal object for the onDragStop event.
313
313
  */
314
314
  get onDragStop() {
315
315
  if (!this._onDragStop) {
@@ -319,8 +319,8 @@ export class EventManager {
319
319
  }
320
320
 
321
321
  /**
322
- * TBD.
323
- * @param {...any} args - TBD.
322
+ * Dispatches the onDragStop event.
323
+ * @param {...any} args - Arguments to pass to the signal.
324
324
  */
325
325
  onDragStop$dispatch(...args) {
326
326
  if (this._onDragStop) {
@@ -329,8 +329,8 @@ export class EventManager {
329
329
  }
330
330
 
331
331
  /**
332
- * TBD.
333
- * @returns {Signal} TBD.
332
+ * Gets the onAnimationStart signal.
333
+ * @returns {Signal} The Signal object for the onAnimationStart event.
334
334
  */
335
335
  get onAnimationStart() {
336
336
  if (!this._onAnimationStart) {
@@ -340,8 +340,8 @@ export class EventManager {
340
340
  }
341
341
 
342
342
  /**
343
- * TBD.
344
- * @param {...any} args - TBD.
343
+ * Dispatches the onAnimationStart event.
344
+ * @param {...any} args - Arguments to pass to the signal.
345
345
  */
346
346
  onAnimationStart$dispatch(...args) {
347
347
  if (this._onAnimationStart) {
@@ -350,8 +350,8 @@ export class EventManager {
350
350
  }
351
351
 
352
352
  /**
353
- * TBD.
354
- * @returns {Signal} TBD.
353
+ * Gets the onAnimationComplete signal.
354
+ * @returns {Signal} The Signal object for the onAnimationComplete event.
355
355
  */
356
356
  get onAnimationComplete() {
357
357
  if (!this._onAnimationComplete) {
@@ -361,8 +361,8 @@ export class EventManager {
361
361
  }
362
362
 
363
363
  /**
364
- * TBD.
365
- * @param {...any} args - TBD.
364
+ * Dispatches the onAnimationComplete event.
365
+ * @param {...any} args - Arguments to pass to the signal.
366
366
  */
367
367
  onAnimationComplete$dispatch(...args) {
368
368
  if (this._onAnimationComplete) {
@@ -371,8 +371,8 @@ export class EventManager {
371
371
  }
372
372
 
373
373
  /**
374
- * TBD.
375
- * @returns {Signal} TBD.
374
+ * Gets the onAnimationLoop signal.
375
+ * @returns {Signal} The Signal object for the onAnimationLoop event.
376
376
  */
377
377
  get onAnimationLoop() {
378
378
  if (!this._onAnimationLoop) {
@@ -382,8 +382,8 @@ export class EventManager {
382
382
  }
383
383
 
384
384
  /**
385
- * TBD.
386
- * @param {...any} args - TBD.
385
+ * Dispatches the onAnimationLoop event.
386
+ * @param {...any} args - Arguments to pass to the signal.
387
387
  */
388
388
  onAnimationLoop$dispatch(...args) {
389
389
  if (this._onAnimationLoop) {