@vpmedia/phaser 1.104.0 → 1.105.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 (297) hide show
  1. package/dist/index.js +151 -574
  2. package/dist/index.js.map +1 -1
  3. package/dist/phaser/core/animation.d.ts +35 -57
  4. package/dist/phaser/core/animation.d.ts.map +1 -1
  5. package/dist/phaser/core/animation_manager.d.ts +11 -10
  6. package/dist/phaser/core/animation_manager.d.ts.map +1 -1
  7. package/dist/phaser/core/animation_parser.d.ts +2 -2
  8. package/dist/phaser/core/animation_parser.d.ts.map +1 -1
  9. package/dist/phaser/core/array_set.d.ts +3 -3
  10. package/dist/phaser/core/array_set.d.ts.map +1 -1
  11. package/dist/phaser/core/cache.d.ts +60 -60
  12. package/dist/phaser/core/cache.d.ts.map +1 -1
  13. package/dist/phaser/core/device.d.ts.map +1 -1
  14. package/dist/phaser/core/device_util.d.ts +10 -10
  15. package/dist/phaser/core/device_util.d.ts.map +1 -1
  16. package/dist/phaser/core/dom.d.ts +6 -5
  17. package/dist/phaser/core/dom.d.ts.map +1 -1
  18. package/dist/phaser/core/event_manager.d.ts +49 -174
  19. package/dist/phaser/core/event_manager.d.ts.map +1 -1
  20. package/dist/phaser/core/factory.d.ts +7 -7
  21. package/dist/phaser/core/factory.d.ts.map +1 -1
  22. package/dist/phaser/core/frame.d.ts +27 -48
  23. package/dist/phaser/core/frame.d.ts.map +1 -1
  24. package/dist/phaser/core/frame_data.d.ts +11 -60
  25. package/dist/phaser/core/frame_data.d.ts.map +1 -1
  26. package/dist/phaser/core/frame_util.d.ts +4 -14
  27. package/dist/phaser/core/frame_util.d.ts.map +1 -1
  28. package/dist/phaser/core/game.d.ts +49 -58
  29. package/dist/phaser/core/game.d.ts.map +1 -1
  30. package/dist/phaser/core/input.d.ts +15 -13
  31. package/dist/phaser/core/input.d.ts.map +1 -1
  32. package/dist/phaser/core/input_handler.d.ts +23 -20
  33. package/dist/phaser/core/input_handler.d.ts.map +1 -1
  34. package/dist/phaser/core/input_mouse.d.ts +26 -1
  35. package/dist/phaser/core/input_mouse.d.ts.map +1 -1
  36. package/dist/phaser/core/input_mspointer.d.ts +2 -2
  37. package/dist/phaser/core/input_mspointer.d.ts.map +1 -1
  38. package/dist/phaser/core/input_pointer.d.ts +9 -9
  39. package/dist/phaser/core/input_pointer.d.ts.map +1 -1
  40. package/dist/phaser/core/input_touch.d.ts +2 -1
  41. package/dist/phaser/core/input_touch.d.ts.map +1 -1
  42. package/dist/phaser/core/loader.d.ts +28 -28
  43. package/dist/phaser/core/loader.d.ts.map +1 -1
  44. package/dist/phaser/core/loader_parser.d.ts +4 -4
  45. package/dist/phaser/core/loader_parser.d.ts.map +1 -1
  46. package/dist/phaser/core/raf.d.ts +2 -2
  47. package/dist/phaser/core/raf.d.ts.map +1 -1
  48. package/dist/phaser/core/scale_manager.d.ts +22 -17
  49. package/dist/phaser/core/scale_manager.d.ts.map +1 -1
  50. package/dist/phaser/core/scene.d.ts +1 -1
  51. package/dist/phaser/core/scene.d.ts.map +1 -1
  52. package/dist/phaser/core/scene_manager.d.ts +10 -9
  53. package/dist/phaser/core/scene_manager.d.ts.map +1 -1
  54. package/dist/phaser/core/signal.d.ts +9 -8
  55. package/dist/phaser/core/signal.d.ts.map +1 -1
  56. package/dist/phaser/core/signal_binding.d.ts +2 -2
  57. package/dist/phaser/core/signal_binding.d.ts.map +1 -1
  58. package/dist/phaser/core/sound.d.ts +56 -101
  59. package/dist/phaser/core/sound.d.ts.map +1 -1
  60. package/dist/phaser/core/sound_manager.d.ts +11 -9
  61. package/dist/phaser/core/sound_manager.d.ts.map +1 -1
  62. package/dist/phaser/core/sound_sprite.d.ts +4 -4
  63. package/dist/phaser/core/sound_sprite.d.ts.map +1 -1
  64. package/dist/phaser/core/stage.d.ts +3 -3
  65. package/dist/phaser/core/stage.d.ts.map +1 -1
  66. package/dist/phaser/core/time.d.ts +5 -5
  67. package/dist/phaser/core/time.d.ts.map +1 -1
  68. package/dist/phaser/core/timer.d.ts +10 -10
  69. package/dist/phaser/core/timer.d.ts.map +1 -1
  70. package/dist/phaser/core/timer_event.d.ts +11 -21
  71. package/dist/phaser/core/timer_event.d.ts.map +1 -1
  72. package/dist/phaser/core/tween.d.ts +37 -59
  73. package/dist/phaser/core/tween.d.ts.map +1 -1
  74. package/dist/phaser/core/tween_data.d.ts +6 -5
  75. package/dist/phaser/core/tween_data.d.ts.map +1 -1
  76. package/dist/phaser/core/tween_easing.d.ts +31 -31
  77. package/dist/phaser/core/tween_easing.d.ts.map +1 -1
  78. package/dist/phaser/core/tween_manager.d.ts +4 -4
  79. package/dist/phaser/core/tween_manager.d.ts.map +1 -1
  80. package/dist/phaser/core/world.d.ts +1 -1
  81. package/dist/phaser/core/world.d.ts.map +1 -1
  82. package/dist/phaser/display/bitmap_text.d.ts +22 -20
  83. package/dist/phaser/display/bitmap_text.d.ts.map +1 -1
  84. package/dist/phaser/display/button.d.ts +23 -35
  85. package/dist/phaser/display/button.d.ts.map +1 -1
  86. package/dist/phaser/display/canvas/buffer.d.ts +2 -2
  87. package/dist/phaser/display/canvas/buffer.d.ts.map +1 -1
  88. package/dist/phaser/display/canvas/graphics.d.ts +3 -3
  89. package/dist/phaser/display/canvas/graphics.d.ts.map +1 -1
  90. package/dist/phaser/display/canvas/masker.d.ts.map +1 -1
  91. package/dist/phaser/display/canvas/pool.d.ts +2 -2
  92. package/dist/phaser/display/canvas/pool.d.ts.map +1 -1
  93. package/dist/phaser/display/canvas/renderer.d.ts +5 -5
  94. package/dist/phaser/display/canvas/renderer.d.ts.map +1 -1
  95. package/dist/phaser/display/canvas/tinter.d.ts +3 -3
  96. package/dist/phaser/display/canvas/tinter.d.ts.map +1 -1
  97. package/dist/phaser/display/canvas/util.d.ts +9 -9
  98. package/dist/phaser/display/canvas/util.d.ts.map +1 -1
  99. package/dist/phaser/display/display_object.d.ts +45 -42
  100. package/dist/phaser/display/display_object.d.ts.map +1 -1
  101. package/dist/phaser/display/graphics.d.ts +24 -16
  102. package/dist/phaser/display/graphics.d.ts.map +1 -1
  103. package/dist/phaser/display/graphics_data.d.ts +1 -1
  104. package/dist/phaser/display/graphics_data.d.ts.map +1 -1
  105. package/dist/phaser/display/graphics_data_util.d.ts +1 -1
  106. package/dist/phaser/display/graphics_data_util.d.ts.map +1 -1
  107. package/dist/phaser/display/group.d.ts +24 -37
  108. package/dist/phaser/display/group.d.ts.map +1 -1
  109. package/dist/phaser/display/image.d.ts +34 -49
  110. package/dist/phaser/display/image.d.ts.map +1 -1
  111. package/dist/phaser/display/sprite_batch.d.ts +1 -1
  112. package/dist/phaser/display/sprite_batch.d.ts.map +1 -1
  113. package/dist/phaser/display/sprite_util.d.ts +5 -5
  114. package/dist/phaser/display/sprite_util.d.ts.map +1 -1
  115. package/dist/phaser/display/text.d.ts +86 -66
  116. package/dist/phaser/display/text.d.ts.map +1 -1
  117. package/dist/phaser/display/webgl/abstract_filter.d.ts +2 -1
  118. package/dist/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
  119. package/dist/phaser/display/webgl/base_texture.d.ts +2 -2
  120. package/dist/phaser/display/webgl/base_texture.d.ts.map +1 -1
  121. package/dist/phaser/display/webgl/blend_manager.d.ts +3 -2
  122. package/dist/phaser/display/webgl/blend_manager.d.ts.map +1 -1
  123. package/dist/phaser/display/webgl/earcut.d.ts +10 -10
  124. package/dist/phaser/display/webgl/earcut.d.ts.map +1 -1
  125. package/dist/phaser/display/webgl/earcut_node.d.ts +1 -1
  126. package/dist/phaser/display/webgl/earcut_node.d.ts.map +1 -1
  127. package/dist/phaser/display/webgl/fast_sprite_batch.d.ts +2 -1
  128. package/dist/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
  129. package/dist/phaser/display/webgl/filter_manager.d.ts +2 -1
  130. package/dist/phaser/display/webgl/filter_manager.d.ts.map +1 -1
  131. package/dist/phaser/display/webgl/filter_texture.d.ts +3 -2
  132. package/dist/phaser/display/webgl/filter_texture.d.ts.map +1 -1
  133. package/dist/phaser/display/webgl/graphics.d.ts +11 -10
  134. package/dist/phaser/display/webgl/graphics.d.ts.map +1 -1
  135. package/dist/phaser/display/webgl/graphics_data.d.ts +2 -1
  136. package/dist/phaser/display/webgl/graphics_data.d.ts.map +1 -1
  137. package/dist/phaser/display/webgl/mask_manager.d.ts.map +1 -1
  138. package/dist/phaser/display/webgl/render_texture.d.ts +2 -1
  139. package/dist/phaser/display/webgl/render_texture.d.ts.map +1 -1
  140. package/dist/phaser/display/webgl/renderer.d.ts +8 -6
  141. package/dist/phaser/display/webgl/renderer.d.ts.map +1 -1
  142. package/dist/phaser/display/webgl/shader/complex.d.ts +2 -1
  143. package/dist/phaser/display/webgl/shader/complex.d.ts.map +1 -1
  144. package/dist/phaser/display/webgl/shader/fast.d.ts +2 -1
  145. package/dist/phaser/display/webgl/shader/fast.d.ts.map +1 -1
  146. package/dist/phaser/display/webgl/shader/normal.d.ts +1 -0
  147. package/dist/phaser/display/webgl/shader/normal.d.ts.map +1 -1
  148. package/dist/phaser/display/webgl/shader/primitive.d.ts +2 -1
  149. package/dist/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
  150. package/dist/phaser/display/webgl/shader/strip.d.ts +2 -1
  151. package/dist/phaser/display/webgl/shader/strip.d.ts.map +1 -1
  152. package/dist/phaser/display/webgl/shader_manager.d.ts +4 -2
  153. package/dist/phaser/display/webgl/shader_manager.d.ts.map +1 -1
  154. package/dist/phaser/display/webgl/sprite_batch.d.ts +3 -2
  155. package/dist/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
  156. package/dist/phaser/display/webgl/stencil_manager.d.ts +5 -4
  157. package/dist/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
  158. package/dist/phaser/display/webgl/texture.d.ts +15 -2
  159. package/dist/phaser/display/webgl/texture.d.ts.map +1 -1
  160. package/dist/phaser/display/webgl/texture_util.d.ts +2 -2
  161. package/dist/phaser/display/webgl/texture_util.d.ts.map +1 -1
  162. package/dist/phaser/display/webgl/util.d.ts +6 -6
  163. package/dist/phaser/display/webgl/util.d.ts.map +1 -1
  164. package/dist/phaser/geom/circle.d.ts +11 -10
  165. package/dist/phaser/geom/circle.d.ts.map +1 -1
  166. package/dist/phaser/geom/ellipse.d.ts +6 -5
  167. package/dist/phaser/geom/ellipse.d.ts.map +1 -1
  168. package/dist/phaser/geom/line.d.ts +14 -14
  169. package/dist/phaser/geom/line.d.ts.map +1 -1
  170. package/dist/phaser/geom/matrix.d.ts +13 -12
  171. package/dist/phaser/geom/matrix.d.ts.map +1 -1
  172. package/dist/phaser/geom/point.d.ts +19 -19
  173. package/dist/phaser/geom/point.d.ts.map +1 -1
  174. package/dist/phaser/geom/polygon.d.ts +6 -6
  175. package/dist/phaser/geom/polygon.d.ts.map +1 -1
  176. package/dist/phaser/geom/rectangle.d.ts +20 -20
  177. package/dist/phaser/geom/rectangle.d.ts.map +1 -1
  178. package/dist/phaser/geom/rounded_rectangle.d.ts +2 -2
  179. package/dist/phaser/geom/rounded_rectangle.d.ts.map +1 -1
  180. package/dist/phaser/geom/util/circle.d.ts +9 -7
  181. package/dist/phaser/geom/util/circle.d.ts.map +1 -1
  182. package/dist/phaser/geom/util/ellipse.d.ts +1 -1
  183. package/dist/phaser/geom/util/ellipse.d.ts.map +1 -1
  184. package/dist/phaser/geom/util/line.d.ts +5 -3
  185. package/dist/phaser/geom/util/line.d.ts.map +1 -1
  186. package/dist/phaser/geom/util/matrix.d.ts +2 -1
  187. package/dist/phaser/geom/util/matrix.d.ts.map +1 -1
  188. package/dist/phaser/geom/util/point.d.ts +19 -19
  189. package/dist/phaser/geom/util/point.d.ts.map +1 -1
  190. package/dist/phaser/geom/util/polygon.d.ts +2 -1
  191. package/dist/phaser/geom/util/polygon.d.ts.map +1 -1
  192. package/dist/phaser/geom/util/rectangle.d.ts +17 -15
  193. package/dist/phaser/geom/util/rectangle.d.ts.map +1 -1
  194. package/dist/phaser/geom/util/rounded_rectangle.d.ts +2 -1
  195. package/dist/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
  196. package/dist/phaser/util/math.d.ts +51 -142
  197. package/dist/phaser/util/math.d.ts.map +1 -1
  198. package/package.json +1 -1
  199. package/src/phaser/core/animation.ts +38 -61
  200. package/src/phaser/core/animation_manager.ts +21 -21
  201. package/src/phaser/core/animation_parser.ts +11 -3
  202. package/src/phaser/core/array_set.ts +8 -8
  203. package/src/phaser/core/cache.ts +75 -68
  204. package/src/phaser/core/device.ts +23 -24
  205. package/src/phaser/core/device_util.ts +10 -10
  206. package/src/phaser/core/dom.ts +5 -5
  207. package/src/phaser/core/event_manager.ts +52 -193
  208. package/src/phaser/core/factory.ts +25 -18
  209. package/src/phaser/core/frame.ts +37 -51
  210. package/src/phaser/core/frame_data.ts +29 -76
  211. package/src/phaser/core/frame_util.ts +3 -16
  212. package/src/phaser/core/game.ts +36 -63
  213. package/src/phaser/core/input.ts +68 -68
  214. package/src/phaser/core/input_handler.ts +81 -86
  215. package/src/phaser/core/input_mouse.ts +42 -36
  216. package/src/phaser/core/input_mspointer.ts +24 -25
  217. package/src/phaser/core/input_pointer.ts +55 -56
  218. package/src/phaser/core/input_touch.ts +26 -26
  219. package/src/phaser/core/loader.ts +97 -70
  220. package/src/phaser/core/loader_parser.ts +6 -7
  221. package/src/phaser/core/raf.ts +2 -2
  222. package/src/phaser/core/scale_manager.ts +85 -82
  223. package/src/phaser/core/scene.ts +3 -4
  224. package/src/phaser/core/scene_manager.ts +26 -26
  225. package/src/phaser/core/signal.ts +10 -10
  226. package/src/phaser/core/signal_binding.ts +2 -2
  227. package/src/phaser/core/sound.ts +65 -112
  228. package/src/phaser/core/sound_manager.ts +31 -30
  229. package/src/phaser/core/sound_sprite.ts +10 -11
  230. package/src/phaser/core/stage.ts +8 -8
  231. package/src/phaser/core/time.ts +33 -34
  232. package/src/phaser/core/timer.ts +40 -34
  233. package/src/phaser/core/timer_event.ts +23 -23
  234. package/src/phaser/core/tween.ts +42 -68
  235. package/src/phaser/core/tween_data.ts +31 -31
  236. package/src/phaser/core/tween_easing.ts +31 -31
  237. package/src/phaser/core/tween_manager.ts +10 -11
  238. package/src/phaser/core/world.ts +1 -2
  239. package/src/phaser/display/bitmap_text.ts +41 -31
  240. package/src/phaser/display/button.ts +24 -51
  241. package/src/phaser/display/canvas/buffer.ts +6 -7
  242. package/src/phaser/display/canvas/graphics.ts +3 -4
  243. package/src/phaser/display/canvas/masker.ts +2 -3
  244. package/src/phaser/display/canvas/pool.ts +3 -4
  245. package/src/phaser/display/canvas/renderer.ts +19 -20
  246. package/src/phaser/display/canvas/tinter.ts +4 -5
  247. package/src/phaser/display/canvas/util.ts +9 -9
  248. package/src/phaser/display/display_object.ts +49 -50
  249. package/src/phaser/display/graphics.ts +56 -43
  250. package/src/phaser/display/graphics_data.ts +11 -12
  251. package/src/phaser/display/graphics_data_util.ts +1 -2
  252. package/src/phaser/display/group.ts +32 -42
  253. package/src/phaser/display/image.ts +32 -52
  254. package/src/phaser/display/sprite_batch.ts +1 -2
  255. package/src/phaser/display/sprite_util.ts +5 -6
  256. package/src/phaser/display/text.ts +82 -56
  257. package/src/phaser/display/webgl/abstract_filter.ts +8 -8
  258. package/src/phaser/display/webgl/base_texture.ts +14 -15
  259. package/src/phaser/display/webgl/blend_manager.ts +5 -5
  260. package/src/phaser/display/webgl/earcut.ts +27 -27
  261. package/src/phaser/display/webgl/earcut_node.ts +1 -1
  262. package/src/phaser/display/webgl/fast_sprite_batch.ts +19 -19
  263. package/src/phaser/display/webgl/filter_manager.ts +5 -5
  264. package/src/phaser/display/webgl/filter_texture.ts +7 -7
  265. package/src/phaser/display/webgl/graphics.ts +10 -11
  266. package/src/phaser/display/webgl/graphics_data.ts +11 -11
  267. package/src/phaser/display/webgl/mask_manager.ts +2 -3
  268. package/src/phaser/display/webgl/render_texture.ts +12 -12
  269. package/src/phaser/display/webgl/renderer.ts +24 -24
  270. package/src/phaser/display/webgl/shader/complex.ts +7 -7
  271. package/src/phaser/display/webgl/shader/fast.ts +8 -8
  272. package/src/phaser/display/webgl/shader/normal.ts +12 -12
  273. package/src/phaser/display/webgl/shader/primitive.ts +7 -7
  274. package/src/phaser/display/webgl/shader/strip.ts +7 -7
  275. package/src/phaser/display/webgl/shader_manager.ts +13 -13
  276. package/src/phaser/display/webgl/sprite_batch.ts +20 -20
  277. package/src/phaser/display/webgl/stencil_manager.ts +8 -8
  278. package/src/phaser/display/webgl/texture.ts +35 -24
  279. package/src/phaser/display/webgl/texture_util.ts +2 -3
  280. package/src/phaser/display/webgl/util.ts +6 -6
  281. package/src/phaser/geom/circle.ts +10 -10
  282. package/src/phaser/geom/ellipse.ts +6 -6
  283. package/src/phaser/geom/line.ts +14 -14
  284. package/src/phaser/geom/matrix.ts +12 -12
  285. package/src/phaser/geom/point.ts +19 -19
  286. package/src/phaser/geom/polygon.ts +5 -5
  287. package/src/phaser/geom/rectangle.ts +21 -21
  288. package/src/phaser/geom/rounded_rectangle.ts +2 -2
  289. package/src/phaser/geom/util/circle.ts +7 -7
  290. package/src/phaser/geom/util/ellipse.ts +1 -1
  291. package/src/phaser/geom/util/line.ts +5 -5
  292. package/src/phaser/geom/util/matrix.ts +1 -1
  293. package/src/phaser/geom/util/point.ts +20 -20
  294. package/src/phaser/geom/util/polygon.ts +1 -1
  295. package/src/phaser/geom/util/rectangle.ts +15 -15
  296. package/src/phaser/geom/util/rounded_rectangle.ts +1 -1
  297. package/src/phaser/util/math.ts +65 -151
package/dist/index.js CHANGED
@@ -1317,11 +1317,7 @@ var math_exports = /* @__PURE__ */ __exportAll({
1317
1317
  const DEG_TO_RAD = Math.PI / 180;
1318
1318
  const RAD_TO_DEG = 180 / Math.PI;
1319
1319
  const PI_2 = Math.PI * 2;
1320
- /**
1321
- * Converts a hexadecimal color value to RGB components.
1322
- * @param {number} hex - The hexadecimal color value.
1323
- * @returns {number[]} An array containing the RGB components [r, g, b].
1324
- */
1320
+ /** Converts a hexadecimal color value to RGB components. */
1325
1321
  const hex2rgb = (hex) => {
1326
1322
  return [
1327
1323
  (hex >> 16 & 255) / 255,
@@ -1329,79 +1325,41 @@ const hex2rgb = (hex) => {
1329
1325
  (hex & 255) / 255
1330
1326
  ];
1331
1327
  };
1332
- /**
1333
- * Converts RGB components to a hexadecimal color value.
1334
- * @param {number} rgb - The RGB components array [r, g, b].
1335
- * @returns {number} The hexadecimal color value.
1336
- */
1328
+ /** Converts RGB components to a hexadecimal color value. */
1337
1329
  const rgb2hex = (rgb) => {
1338
1330
  return (rgb[0] * 255 << 16) + (rgb[1] * 255 << 8) + rgb[2] * 255;
1339
1331
  };
1340
- /**
1341
- * Gets the next power of two greater than or equal to a value.
1342
- * @param {number} value - The input value.
1343
- * @returns {number} The next power of two.
1344
- */
1332
+ /** Gets the next power of two greater than or equal to a value. */
1345
1333
  const getNextPowerOfTwo = (value) => {
1346
1334
  if (value > 0 && (value & value - 1) === 0) return value;
1347
1335
  let result = 1;
1348
1336
  while (result < value) result <<= 1;
1349
1337
  return result;
1350
1338
  };
1351
- /**
1352
- * Checks if both width and height are powers of two.
1353
- * @param {number} width - The width to check.
1354
- * @param {number} height - The height to check.
1355
- * @returns {boolean} True if both width and height are powers of two, false otherwise.
1356
- */
1339
+ /** Checks if both width and height are powers of two. */
1357
1340
  const isPowerOfTwo = (width, height) => {
1358
1341
  return width > 0 && (width & width - 1) === 0 && height > 0 && (height & height - 1) === 0;
1359
1342
  };
1360
- /**
1361
- * Converts degrees to radians.
1362
- * @param {number} degrees - The angle in degrees.
1363
- * @returns {number} The angle in radians.
1364
- */
1343
+ /** Converts degrees to radians. */
1365
1344
  const degToRad = (degrees) => {
1366
1345
  return degrees * DEG_TO_RAD;
1367
1346
  };
1368
- /**
1369
- * Converts radians to degrees.
1370
- * @param {number} radians - The angle in radians.
1371
- * @returns {number} The angle in degrees.
1372
- */
1347
+ /** Converts radians to degrees. */
1373
1348
  const radToDeg = (radians) => {
1374
1349
  return radians * RAD_TO_DEG;
1375
1350
  };
1376
- /**
1377
- * Gets a random integer between min and max (inclusive).
1378
- * @param {number} min - The minimum value.
1379
- * @param {number} max - The maximum value.
1380
- * @returns {number} A random integer between min and max.
1381
- */
1351
+ /** Gets a random integer between min and max (inclusive). */
1382
1352
  const between = (min, max) => {
1383
1353
  return Math.floor(Math.random() * (max - min + 1) + min);
1384
1354
  };
1385
- /**
1386
- * Snaps a value to the nearest multiple of gap, starting from start.
1387
- * @param {number} input - The value to snap.
1388
- * @param {number} gap - The gap size to snap to.
1389
- * @param {number} start - The starting offset for snapping.
1390
- * @returns {number} The snapped value.
1391
- */
1355
+ /** Snaps a value to the nearest multiple of gap, starting from start. */
1392
1356
  const snapToCeil = (input, gap = 0, start = 0) => {
1393
1357
  if (gap === 0) return input;
1394
1358
  input -= start;
1395
1359
  input = gap * Math.ceil(input / gap);
1396
1360
  return start + input;
1397
1361
  };
1398
- /**
1399
- * Wraps a value within a range.
1400
- * @param {number} value - The value to wrap.
1401
- * @param {number} min - The minimum value of the range.
1402
- * @param {number} max - The maximum value of the range.
1403
- * @returns {number} The wrapped value.
1404
- */
1362
+ /** Wraps a value within a range. */
1405
1363
  const wrap = (value, min, max) => {
1406
1364
  const range = max - min;
1407
1365
  if (range <= 0) return 0;
@@ -1409,31 +1367,15 @@ const wrap = (value, min, max) => {
1409
1367
  if (result < 0) result += range;
1410
1368
  return result + min;
1411
1369
  };
1412
- /**
1413
- * Performs linear interpolation between two values.
1414
- * @param {number} p0 - The first point.
1415
- * @param {number} p1 - The second point.
1416
- * @param {number} t - The interpolation factor (0 to 1).
1417
- * @returns {number} The interpolated value.
1418
- */
1370
+ /** Performs linear interpolation between two values. */
1419
1371
  const linear = (p0, p1, t) => {
1420
1372
  return (p1 - p0) * t + p0;
1421
1373
  };
1422
- /**
1423
- * Calculates the absolute difference between two numbers.
1424
- * @param {number} a - The first number.
1425
- * @param {number} b - The second number.
1426
- * @returns {number} The absolute difference between a and b.
1427
- */
1374
+ /** Calculates the absolute difference between two numbers. */
1428
1375
  const difference = (a, b) => {
1429
1376
  return Math.abs(a - b);
1430
1377
  };
1431
- /**
1432
- * Performs linear interpolation on an array of values.
1433
- * @param {number[]} v - The array of values.
1434
- * @param {number} k - The interpolation factor (0 to 1).
1435
- * @returns {number} The interpolated value.
1436
- */
1378
+ /** Performs linear interpolation on an array of values. */
1437
1379
  const linearInterpolation = (v, k) => {
1438
1380
  const m = v.length - 1;
1439
1381
  const f = m * k;
@@ -1442,57 +1384,27 @@ const linearInterpolation = (v, k) => {
1442
1384
  if (k > 1) return linear(v[m], v[m - 1], m - f);
1443
1385
  return linear(v[i], v[i + 1 > m ? m : i + 1], f - i);
1444
1386
  };
1445
- /**
1446
- * Calculates the distance between two points.
1447
- * @param {number} x1 - The x-coordinate of the first point.
1448
- * @param {number} y1 - The y-coordinate of the first point.
1449
- * @param {number} x2 - The x-coordinate of the second point.
1450
- * @param {number} y2 - The y-coordinate of the second point.
1451
- * @returns {number} The distance between the two points.
1452
- */
1387
+ /** Calculates the distance between two points. */
1453
1388
  const distance = (x1, y1, x2, y2) => {
1454
1389
  const dx = x1 - x2;
1455
1390
  const dy = y1 - y2;
1456
1391
  return Math.sqrt(dx * dx + dy * dy);
1457
1392
  };
1458
- /**
1459
- * Checks if two numbers are within a tolerance of each other.
1460
- * @param {number} a - The first number.
1461
- * @param {number} b - The second number.
1462
- * @param {number} tolerance - The tolerance value.
1463
- * @returns {boolean} True if the numbers are within tolerance, false otherwise.
1464
- */
1393
+ /** Checks if two numbers are within a tolerance of each other. */
1465
1394
  const within = (a, b, tolerance) => {
1466
1395
  return Math.abs(a - b) <= tolerance;
1467
1396
  };
1468
- /**
1469
- * Creates a 32-bit color value from alpha, red, green, and blue components.
1470
- * @param {number} a - The alpha component (0-255).
1471
- * @param {number} r - The red component (0-255).
1472
- * @param {number} g - The green component (0-255).
1473
- * @param {number} b - The blue component (0-255).
1474
- * @returns {number} The 32-bit color value.
1475
- */
1397
+ /** Creates a 32-bit color value from alpha, red, green, and blue components. */
1476
1398
  const getColor32 = (a, r, g, b) => {
1477
1399
  return a << 24 | r << 16 | g << 8 | b;
1478
1400
  };
1479
- /**
1480
- * Creates a 24-bit color value from red, green, and blue components.
1481
- * @param {number} r - The red component (0-255).
1482
- * @param {number} g - The green component (0-255).
1483
- * @param {number} b - The blue component (0-255).
1484
- * @returns {number} The 24-bit color value.
1485
- */
1401
+ /** Creates a 24-bit color value from red, green, and blue components. */
1486
1402
  const getColor = (r, g, b) => {
1487
1403
  return r << 16 | g << 8 | b;
1488
1404
  };
1489
- /**
1490
- * Converts a hex color string to RGB components.
1491
- * @param {string} value - The hex color string (e.g. "#FF0000").
1492
- * @param {{r?: number, g?: number, b?: number}} out - The object to store the result in.
1493
- */
1405
+ /** Converts a hex color string to RGB components. */
1494
1406
  const hexToColor = (value, out) => {
1495
- value = value.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) => r + r + g + g + b + b);
1407
+ value = value.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i, (_m, r, g, b) => r + r + g + g + b + b);
1496
1408
  const result = /^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(value);
1497
1409
  if (result) {
1498
1410
  out.r = Number.parseInt(result[1], 16);
@@ -1500,11 +1412,7 @@ const hexToColor = (value, out) => {
1500
1412
  out.b = Number.parseInt(result[3], 16);
1501
1413
  }
1502
1414
  };
1503
- /**
1504
- * Converts a web color string (e.g. "rgb(255, 0, 0)") to RGB components with alpha.
1505
- * @param {string} value - The web color string (e.g. "rgba(255, 0, 0, 0.5)").
1506
- * @param {{r?: number, g?: number, b?: number, a?: number}} out - The object to store the result in.
1507
- */
1415
+ /** Converts a web color string (e.g. "rgb(255, 0, 0)") to RGB components with alpha. */
1508
1416
  const webToColor = (value, out) => {
1509
1417
  const result = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(value);
1510
1418
  if (result) {
@@ -1514,11 +1422,7 @@ const webToColor = (value, out) => {
1514
1422
  out.a = result[4] !== void 0 ? Number.parseFloat(result[4]) : 1;
1515
1423
  }
1516
1424
  };
1517
- /**
1518
- * Extracts RGB components from a 32-bit color value.
1519
- * @param {number} color - The 32-bit color value.
1520
- * @returns {{ alpha: number, red: number, green: number, blue: number, a: number, r: number, g: number, b: number}} An object containing the color components.
1521
- */
1425
+ /** Extracts RGB components from a 32-bit color value. */
1522
1426
  const getRGB = (color) => {
1523
1427
  if (color > 16777215) return {
1524
1428
  alpha: color >>> 24,
@@ -1541,12 +1445,7 @@ const getRGB = (color) => {
1541
1445
  b: color & 255
1542
1446
  };
1543
1447
  };
1544
- /**
1545
- * Converts a color value (string or number) to an object with various color formats.
1546
- * @param {string|number} value - The color value (e.g. "#FF0000" or 0xFF0000).
1547
- * @param {{a?: number, r?: number, g?: number, b?: number, rgba?: string, color?: number, color32?: number}} out - The object to store the result in.
1548
- * @returns {{a?: number, r?: number, g?: number, b?: number, rgba?: string, color?: number, color32?: number}} The updated out object.
1549
- */
1448
+ /** Converts a color value (string or number) to an object with various color formats. */
1550
1449
  const valueToColor = (value, out) => {
1551
1450
  if (typeof value === "string") if (value.indexOf("rgb") === 0) webToColor(value, out);
1552
1451
  else {
@@ -1990,13 +1889,9 @@ var DisplayObject = class {
1990
1889
  renderable = false;
1991
1890
  /** @type {boolean} */
1992
1891
  visible = true;
1993
- /** @type {Point} */
1994
1892
  position;
1995
- /** @type {Point} */
1996
1893
  scale;
1997
- /** @type {Point} */
1998
1894
  pivot;
1999
- /** @type {Point} */
2000
1895
  anchor;
2001
1896
  /** @type {number} */
2002
1897
  rotation = 0;
@@ -2008,9 +1903,7 @@ var DisplayObject = class {
2008
1903
  parent = null;
2009
1904
  /** @type {number} */
2010
1905
  worldAlpha = 1;
2011
- /** @type {Matrix} */
2012
1906
  worldTransform;
2013
- /** @type {Point} */
2014
1907
  worldScale;
2015
1908
  /** @type {Rectangle} */
2016
1909
  filterArea = null;
@@ -2018,7 +1911,6 @@ var DisplayObject = class {
2018
1911
  _sr = 0;
2019
1912
  /** @type {number} */
2020
1913
  _cr = 1;
2021
- /** @type {Rectangle} */
2022
1914
  cachedBounds;
2023
1915
  /** @type {Rectangle} */
2024
1916
  currentBounds = null;
@@ -2028,7 +1920,6 @@ var DisplayObject = class {
2028
1920
  _filters = null;
2029
1921
  /** @type {object} */
2030
1922
  _filterBlock = null;
2031
- /** @type {DisplayObject[]} */
2032
1923
  children;
2033
1924
  /** @type {boolean} */
2034
1925
  ignoreChildInput = false;
@@ -2036,10 +1927,18 @@ var DisplayObject = class {
2036
1927
  name = null;
2037
1928
  /** @type {object | null} */
2038
1929
  data = null;
2039
- /** @type {import('../core/game.js').Game} */
2040
1930
  game;
2041
- /** @type {number} */
2042
1931
  type;
1932
+ _cachedSprite;
1933
+ rotationCache;
1934
+ worldRotation;
1935
+ transformCallback;
1936
+ transformCallbackContext;
1937
+ _width;
1938
+ _height;
1939
+ z;
1940
+ events;
1941
+ renderOrderID;
2043
1942
  /**
2044
1943
  * Creates a new DisplayObject instance.
2045
1944
  * @param {import('../core/game.js').Game} game - The game instance this display object belongs to.
@@ -3019,51 +2918,28 @@ var Signal = class {
3019
2918
  //#endregion
3020
2919
  //#region src/phaser/core/animation.ts
3021
2920
  var Animation = class {
3022
- /** @type {import('./game.js').Game} */
3023
2921
  game;
3024
- /** @type {import('../display/image.js').Image} */
3025
2922
  _parent;
3026
- /** @type {import('./frame_data.js').FrameData} */
3027
2923
  _frameData;
3028
- /** @type {string} */
3029
2924
  name;
3030
- /** @type {Array<string|number>} */
3031
2925
  _frames;
3032
- /** @type {number} */
3033
2926
  delay;
3034
- /** @type {boolean} */
3035
2927
  loop;
3036
- /** @type {number} */
3037
2928
  loopCount;
3038
- /** @type {boolean} */
3039
2929
  isFinished;
3040
- /** @type {boolean} */
3041
2930
  isPlaying;
3042
- /** @type {boolean} */
3043
2931
  isPaused;
3044
- /** @type {number} */
3045
2932
  _pauseStartTime;
3046
- /** @type {number} */
3047
2933
  _frameIndex;
3048
- /** @type {number} */
3049
2934
  _frameDiff;
3050
- /** @type {number} */
3051
2935
  _frameSkip;
3052
- /** @type {import('./frame.js').Frame} */
3053
2936
  currentFrame;
3054
- /** @type {Signal} */
3055
2937
  onStart;
3056
- /** @type {Signal | null} */
3057
2938
  onUpdate;
3058
- /** @type {Signal} */
3059
2939
  onComplete;
3060
- /** @type {Signal} */
3061
2940
  onLoop;
3062
- /** @type {boolean} */
3063
2941
  isReversed;
3064
- /** @type {number} */
3065
2942
  _timeLastFrame;
3066
- /** @type {number} */
3067
2943
  _timeNextFrame;
3068
2944
  /**
3069
2945
  * Creates a new Animation instance.
@@ -3173,7 +3049,8 @@ var Animation = class {
3173
3049
  */
3174
3050
  reverseOnce() {
3175
3051
  this.onComplete.addOnce(this.reverse, this);
3176
- return this.toReversed();
3052
+ this.reverse();
3053
+ return this;
3177
3054
  }
3178
3055
  /**
3179
3056
  * Sets the current frame of this animation.
@@ -3446,6 +3323,7 @@ var AnimationManager = class {
3446
3323
  _frameData;
3447
3324
  _anims;
3448
3325
  _outputFrames;
3326
+ _frameIndex;
3449
3327
  /**
3450
3328
  * Creates a new AnimationManager instance.
3451
3329
  * @param {import('../display/image.js').Image} sprite - Reference to the parent Sprite.
@@ -3726,10 +3604,6 @@ var EventManager = class {
3726
3604
  _onAnimationStart;
3727
3605
  _onAnimationComplete;
3728
3606
  _onAnimationLoop;
3729
- /**
3730
- * Creates a new EventManager instance.
3731
- * @param {import('../display/display_object.js').DisplayObject} sprite - Reference to the parent DisplayObject.
3732
- */
3733
3607
  constructor(sprite) {
3734
3608
  this.parent = sprite;
3735
3609
  this._onAddedToGroup = null;
@@ -3748,11 +3622,8 @@ var EventManager = class {
3748
3622
  this._onAnimationComplete = null;
3749
3623
  this._onAnimationLoop = null;
3750
3624
  }
3751
- /**
3752
- * Destroys the EventManager and cleans up resources.
3753
- */
3754
3625
  destroy() {
3755
- this._parent = null;
3626
+ this.parent = null;
3756
3627
  if (this._onDestroy) this._onDestroy.dispose();
3757
3628
  if (this._onAddedToGroup) this._onAddedToGroup.dispose();
3758
3629
  if (this._onRemovedFromGroup) this._onRemovedFromGroup.dispose();
@@ -3769,228 +3640,108 @@ var EventManager = class {
3769
3640
  if (this._onAnimationComplete) this._onAnimationComplete.dispose();
3770
3641
  if (this._onAnimationLoop) this._onAnimationLoop.dispose();
3771
3642
  }
3772
- /**
3773
- * Gets the onAddedToGroup signal.
3774
- * @returns {Signal} The Signal object for the onAddedToGroup event.
3775
- */
3776
3643
  get onAddedToGroup() {
3777
3644
  if (!this._onAddedToGroup) this._onAddedToGroup = new Signal();
3778
3645
  return this._onAddedToGroup;
3779
3646
  }
3780
- /**
3781
- * Dispatches the onAddedToGroup event.
3782
- * @param {...any} args - Arguments to pass to the signal.
3783
- */
3784
3647
  onAddedToGroup$dispatch(...args) {
3785
3648
  if (this._onAddedToGroup) this._onAddedToGroup.dispatch(...args);
3786
3649
  }
3787
- /**
3788
- * Gets the onRemovedFromGroup signal.
3789
- * @returns {Signal} The Signal object for the onRemovedFromGroup event.
3790
- */
3791
3650
  get onRemovedFromGroup() {
3792
3651
  if (!this._onRemovedFromGroup) this._onRemovedFromGroup = new Signal();
3793
3652
  return this._onRemovedFromGroup;
3794
3653
  }
3795
- /**
3796
- * Dispatches the onRemovedFromGroup event.
3797
- * @param {...any} args - Arguments to pass to the signal.
3798
- */
3799
3654
  onRemovedFromGroup$dispatch(...args) {
3800
3655
  if (this._onRemovedFromGroup) this._onRemovedFromGroup.dispatch(...args);
3801
3656
  }
3802
- /**
3803
- * Gets the onDestroy signal.
3804
- * @returns {Signal} The Signal object for the onDestroy event.
3805
- */
3806
3657
  get onDestroy() {
3807
3658
  if (!this._onDestroy) this._onDestroy = new Signal();
3808
3659
  return this._onDestroy;
3809
3660
  }
3810
- /**
3811
- * Dispatches the onDestroy event.
3812
- * @param {...any} args - Arguments to pass to the signal.
3813
- */
3814
3661
  onDestroy$dispatch(...args) {
3815
3662
  if (this._onDestroy) this._onDestroy.dispatch(...args);
3816
3663
  }
3817
- /**
3818
- * Gets the onOutOfBounds signal.
3819
- * @returns {Signal} The Signal object for the onOutOfBounds event.
3820
- */
3821
3664
  get onOutOfBounds() {
3822
3665
  if (!this._onOutOfBounds) this._onOutOfBounds = new Signal();
3823
3666
  return this._onOutOfBounds;
3824
3667
  }
3825
- /**
3826
- * Dispatches the onOutOfBounds event.
3827
- * @param {...any} args - Arguments to pass to the signal.
3828
- */
3829
3668
  onOutOfBounds$dispatch(...args) {
3830
3669
  if (this._onOutOfBounds) this._onOutOfBounds.dispatch(...args);
3831
3670
  }
3832
- /**
3833
- * Gets the onEnterBounds signal.
3834
- * @returns {Signal} The Signal object for the onEnterBounds event.
3835
- */
3836
3671
  get onEnterBounds() {
3837
3672
  if (!this._onEnterBounds) this._onEnterBounds = new Signal();
3838
3673
  return this._onEnterBounds;
3839
3674
  }
3840
- /**
3841
- * Dispatches the onEnterBounds event.
3842
- * @param {...any} args - Arguments to pass to the signal.
3843
- */
3844
3675
  onEnterBounds$dispatch(...args) {
3845
3676
  if (this._onEnterBounds) this._onEnterBounds.dispatch(...args);
3846
3677
  }
3847
- /**
3848
- * Gets the onInputOver signal.
3849
- * @returns {Signal} The Signal object for the onInputOver event.
3850
- */
3851
3678
  get onInputOver() {
3852
3679
  if (!this._onInputOver) this._onInputOver = new Signal();
3853
3680
  return this._onInputOver;
3854
3681
  }
3855
- /**
3856
- * Dispatches the onInputOver event.
3857
- * @param {...any} args - Arguments to pass to the signal.
3858
- */
3859
3682
  onInputOver$dispatch(...args) {
3860
3683
  if (this._onInputOver) this._onInputOver.dispatch(...args);
3861
3684
  }
3862
- /**
3863
- * Gets the onInputOut signal.
3864
- * @returns {Signal} The Signal object for the onInputOut event.
3865
- */
3866
3685
  get onInputOut() {
3867
3686
  if (!this._onInputOut) this._onInputOut = new Signal();
3868
3687
  return this._onInputOut;
3869
3688
  }
3870
- /**
3871
- * Dispatches the onInputOut event.
3872
- * @param {...any} args - Arguments to pass to the signal.
3873
- */
3874
3689
  onInputOut$dispatch(...args) {
3875
3690
  if (this._onInputOut) this._onInputOut.dispatch(...args);
3876
3691
  }
3877
- /**
3878
- * Gets the onInputDown signal.
3879
- * @returns {Signal} The Signal object for the onInputDown event.
3880
- */
3881
3692
  get onInputDown() {
3882
3693
  if (!this._onInputDown) this._onInputDown = new Signal();
3883
3694
  return this._onInputDown;
3884
3695
  }
3885
- /**
3886
- * Dispatches the onInputDown event.
3887
- * @param {...any} args - Arguments to pass to the signal.
3888
- */
3889
3696
  onInputDown$dispatch(...args) {
3890
3697
  if (this._onInputDown) this._onInputDown.dispatch(...args);
3891
3698
  }
3892
- /**
3893
- * Gets the onInputUp signal.
3894
- * @returns {Signal} The Signal object for the onInputUp event.
3895
- */
3896
3699
  get onInputUp() {
3897
3700
  if (!this._onInputUp) this._onInputUp = new Signal();
3898
3701
  return this._onInputUp;
3899
3702
  }
3900
- /**
3901
- * Dispatches the onInputUp event.
3902
- * @param {...any} args - Arguments to pass to the signal.
3903
- */
3904
3703
  onInputUp$dispatch(...args) {
3905
3704
  if (this._onInputUp) this._onInputUp.dispatch(...args);
3906
3705
  }
3907
- /**
3908
- * Gets the onDragStart signal.
3909
- * @returns {Signal} The Signal object for the onDragStart event.
3910
- */
3911
3706
  get onDragStart() {
3912
3707
  if (!this._onDragStart) this._onDragStart = new Signal();
3913
3708
  return this._onDragStart;
3914
3709
  }
3915
- /**
3916
- * Dispatches the onDragStart event.
3917
- * @param {...any} args - Arguments to pass to the signal.
3918
- */
3919
3710
  onDragStart$dispatch(...args) {
3920
3711
  if (this._onDragStart) this._onDragStart.dispatch(...args);
3921
3712
  }
3922
- /**
3923
- * Gets the onDragUpdate signal.
3924
- * @returns {Signal} The Signal object for the onDragUpdate event.
3925
- */
3926
3713
  get onDragUpdate() {
3927
3714
  if (!this._onDragUpdate) this._onDragUpdate = new Signal();
3928
3715
  return this._onDragUpdate;
3929
3716
  }
3930
- /**
3931
- * Dispatches the onDragUpdate event.
3932
- * @param {...any} args - Arguments to pass to the signal.
3933
- */
3934
3717
  onDragUpdate$dispatch(...args) {
3935
3718
  if (this._onDragUpdate) this._onDragUpdate.dispatch(...args);
3936
3719
  }
3937
- /**
3938
- * Gets the onDragStop signal.
3939
- * @returns {Signal} The Signal object for the onDragStop event.
3940
- */
3941
3720
  get onDragStop() {
3942
3721
  if (!this._onDragStop) this._onDragStop = new Signal();
3943
3722
  return this._onDragStop;
3944
3723
  }
3945
- /**
3946
- * Dispatches the onDragStop event.
3947
- * @param {...any} args - Arguments to pass to the signal.
3948
- */
3949
3724
  onDragStop$dispatch(...args) {
3950
3725
  if (this._onDragStop) this._onDragStop.dispatch(...args);
3951
3726
  }
3952
- /**
3953
- * Gets the onAnimationStart signal.
3954
- * @returns {Signal} The Signal object for the onAnimationStart event.
3955
- */
3956
3727
  get onAnimationStart() {
3957
3728
  if (!this._onAnimationStart) this._onAnimationStart = new Signal();
3958
3729
  return this._onAnimationStart;
3959
3730
  }
3960
- /**
3961
- * Dispatches the onAnimationStart event.
3962
- * @param {...any} args - Arguments to pass to the signal.
3963
- */
3964
3731
  onAnimationStart$dispatch(...args) {
3965
3732
  if (this._onAnimationStart) this._onAnimationStart.dispatch(...args);
3966
3733
  }
3967
- /**
3968
- * Gets the onAnimationComplete signal.
3969
- * @returns {Signal} The Signal object for the onAnimationComplete event.
3970
- */
3971
3734
  get onAnimationComplete() {
3972
3735
  if (!this._onAnimationComplete) this._onAnimationComplete = new Signal();
3973
3736
  return this._onAnimationComplete;
3974
3737
  }
3975
- /**
3976
- * Dispatches the onAnimationComplete event.
3977
- * @param {...any} args - Arguments to pass to the signal.
3978
- */
3979
3738
  onAnimationComplete$dispatch(...args) {
3980
3739
  if (this._onAnimationComplete) this._onAnimationComplete.dispatch(...args);
3981
3740
  }
3982
- /**
3983
- * Gets the onAnimationLoop signal.
3984
- * @returns {Signal} The Signal object for the onAnimationLoop event.
3985
- */
3986
3741
  get onAnimationLoop() {
3987
3742
  if (!this._onAnimationLoop) this._onAnimationLoop = new Signal();
3988
3743
  return this._onAnimationLoop;
3989
3744
  }
3990
- /**
3991
- * Dispatches the onAnimationLoop event.
3992
- * @param {...any} args - Arguments to pass to the signal.
3993
- */
3994
3745
  onAnimationLoop$dispatch(...args) {
3995
3746
  if (this._onAnimationLoop) this._onAnimationLoop.dispatch(...args);
3996
3747
  }
@@ -4033,6 +3784,18 @@ var TextureUvs = class {
4033
3784
  }
4034
3785
  };
4035
3786
  var Texture = class Texture {
3787
+ noFrame;
3788
+ baseTexture;
3789
+ frame;
3790
+ trim;
3791
+ valid;
3792
+ isTiling;
3793
+ requiresUpdate;
3794
+ requiresReTint;
3795
+ _uvs;
3796
+ width;
3797
+ height;
3798
+ crop;
4036
3799
  /**
4037
3800
  * Creates a new Texture instance.
4038
3801
  * @param {import('./base_texture.js').BaseTexture} baseTexture - The base texture to use.
@@ -4136,44 +3899,21 @@ var Texture = class Texture {
4136
3899
  //#endregion
4137
3900
  //#region src/phaser/display/image.ts
4138
3901
  var Image$1 = class extends DisplayObject {
4139
- /** @type {string | number | Texture} */
4140
3902
  key;
4141
- /** @type {Texture} */
4142
3903
  texture;
4143
- /** @type {number} */
4144
- _width;
4145
- /** @type {number} */
4146
- _height;
4147
- /** @type {number} */
4148
3904
  tint;
4149
- /** @type {number} */
4150
3905
  cachedTint;
4151
- /** @type {Texture | null} */
4152
3906
  tilingTexture;
4153
- /** @type {Texture | null} */
4154
3907
  tintedTexture;
4155
- /** @type {number} */
4156
3908
  blendMode;
4157
- /** @type {object | null} */
4158
3909
  shader;
4159
- /** @type {import('../core/frame.js').Frame | null} */
4160
3910
  _frame;
4161
- /** @type {boolean} */
4162
3911
  pendingDestroy;
4163
- /** @type {EventManager} */
4164
- events;
4165
- /** @type {AnimationManager} */
4166
3912
  animations;
4167
- /** @type {boolean} */
4168
3913
  customRender;
4169
- /** @type {Rectangle | null} */
4170
3914
  cropRect;
4171
- /** @type {Rectangle | null} */
4172
3915
  _crop;
4173
- /** @type {boolean} */
4174
3916
  refreshTexture;
4175
- /** @type {number} */
4176
- renderOrderID;
4177
3917
  /**
4178
3918
  * Creates a new Image instance.
4179
3919
  * @param {import('../core/game.js').Game} game - The game instance this image belongs to.
@@ -4491,7 +4231,7 @@ var Image$1 = class extends DisplayObject {
4491
4231
  //#endregion
4492
4232
  //#region src/phaser/display/bitmap_text.ts
4493
4233
  var BitmapText = class extends DisplayObject {
4494
- type;
4234
+ pendingDestroy;
4495
4235
  textWidth;
4496
4236
  textHeight;
4497
4237
  _prevAnchor;
@@ -4731,6 +4471,7 @@ var BitmapText = class extends DisplayObject {
4731
4471
  this._prevAnchor.copyFrom(this.anchor);
4732
4472
  }
4733
4473
  super.updateTransform();
4474
+ return this;
4734
4475
  }
4735
4476
  /**
4736
4477
  * Adds a color to a specific position in the text.
@@ -4931,6 +4672,9 @@ var InputHandler = class {
4931
4672
  _wasEnabled;
4932
4673
  _tempPoint;
4933
4674
  _pointerData;
4675
+ _dx;
4676
+ _dy;
4677
+ _draggedPointerID;
4934
4678
  /**
4935
4679
  * TBD.
4936
4680
  * @param {import('../display/image.js').Image} sprite - TBD.
@@ -5651,33 +5395,19 @@ const STATE_DOWN = "Down";
5651
5395
  const STATE_UP = "Up";
5652
5396
  const STATE_DISABLED = "Disabled";
5653
5397
  var Button = class extends Image$1 {
5654
- /** @type {string | null} */
5655
5398
  _onOverFrame;
5656
- /** @type {string | null} */
5657
5399
  _onOutFrame;
5658
- /** @type {string | null} */
5659
5400
  _onDownFrame;
5660
- /** @type {string | null} */
5661
5401
  _onUpFrame;
5662
- /** @type {string | null} */
5663
5402
  _onDisabledFrame;
5664
- /** @type {Signal} */
5665
5403
  onInputOver;
5666
- /** @type {Signal} */
5667
5404
  onInputOut;
5668
- /** @type {Signal} */
5669
5405
  onInputDown;
5670
- /** @type {Signal} */
5671
5406
  onInputUp;
5672
- /** @type {boolean} */
5673
5407
  onOverMouseOnly;
5674
- /** @type {number} */
5675
5408
  justReleasedPreventsOver;
5676
- /** @type {boolean} */
5677
5409
  freezeFrames;
5678
- /** @type {boolean} */
5679
5410
  forceOut;
5680
- /** @type {InputHandler} */
5681
5411
  input;
5682
5412
  /**
5683
5413
  * Creates a new Button instance.
@@ -8122,13 +7852,11 @@ const textureFromCanvas = (canvas, scaleMode) => {
8122
7852
  //#endregion
8123
7853
  //#region src/phaser/display/graphics.ts
8124
7854
  var Graphics = class extends DisplayObject {
8125
- type;
8126
- renderable;
8127
7855
  fillAlpha;
8128
7856
  lineWidth;
8129
7857
  lineColor;
7858
+ lineAlpha;
8130
7859
  graphicsData;
8131
- tint;
8132
7860
  blendMode;
8133
7861
  currentPath;
8134
7862
  _webGL;
@@ -8136,10 +7864,14 @@ var Graphics = class extends DisplayObject {
8136
7864
  boundsPadding;
8137
7865
  _localBounds;
8138
7866
  dirty;
7867
+ clearDirty;
8139
7868
  _boundsDirty;
8140
7869
  _cacheAsBitmap;
8141
7870
  webGLDirty;
8142
7871
  cachedSpriteDirty;
7872
+ filling;
7873
+ fillColor;
7874
+ _prevTint;
8143
7875
  /**
8144
7876
  * Creates a new Graphics object.
8145
7877
  * @param {import('../core/game.js').Game} game - The game instance.
@@ -8879,33 +8611,18 @@ var Graphics = class extends DisplayObject {
8879
8611
  //#endregion
8880
8612
  //#region src/phaser/display/group.ts
8881
8613
  var Group = class extends DisplayObject {
8882
- /** @type {number} */
8883
- z;
8884
- /** @type {boolean} */
8885
8614
  ignoreDestroy;
8886
- /** @type {boolean} */
8887
8615
  pendingDestroy;
8888
- /** @type {Function} */
8889
8616
  classType;
8890
- /** @type {DisplayObject | null} */
8891
8617
  cursor;
8892
- /** @type {boolean} */
8893
8618
  inputEnableChildren;
8894
- /** @type {Signal} */
8895
8619
  onChildInputDown;
8896
- /** @type {Signal} */
8897
8620
  onChildInputUp;
8898
- /** @type {Signal} */
8899
8621
  onChildInputOver;
8900
- /** @type {Signal} */
8901
8622
  onChildInputOut;
8902
- /** @type {Signal} */
8903
8623
  onDestroy;
8904
- /** @type {number} */
8905
8624
  cursorIndex;
8906
- /** @type {string} */
8907
8625
  _sortProperty;
8908
- /** @type {object[] | null} */
8909
8626
  filters;
8910
8627
  /**
8911
8628
  * Creates a new Group object.
@@ -9159,6 +8876,23 @@ var Group = class extends DisplayObject {
9159
8876
  //#endregion
9160
8877
  //#region src/phaser/display/text.ts
9161
8878
  var Text = class extends Image$1 {
8879
+ canvas;
8880
+ context;
8881
+ padding;
8882
+ textBounds;
8883
+ style;
8884
+ colors;
8885
+ strokeColors;
8886
+ fontStyles;
8887
+ fontWeights;
8888
+ autoRound;
8889
+ useAdvancedWrap;
8890
+ _res;
8891
+ _text;
8892
+ _fontComponents;
8893
+ _lineSpacing;
8894
+ _charCount;
8895
+ dirty;
9162
8896
  /**
9163
8897
  * Creates a new Text object.
9164
8898
  * @param {import('../core/game.js').Game} game - The game instance this text belongs to.
@@ -9988,7 +9722,7 @@ var Text = class extends Image$1 {
9988
9722
  */
9989
9723
  set fontSize(value) {
9990
9724
  let mutatedValue = value || "0";
9991
- if (typeof mutatedValue === "number") mutatedValue += "px";
9725
+ if (typeof mutatedValue === "number") mutatedValue = `${mutatedValue}px`;
9992
9726
  this._fontComponents.fontSize = mutatedValue;
9993
9727
  this.updateFont(this._fontComponents);
9994
9728
  }
@@ -12223,127 +11957,64 @@ var WebGLRenderer = class {
12223
11957
  var FrameData = class {
12224
11958
  _frames;
12225
11959
  _frameNames;
12226
- /**
12227
- * Creates a new FrameData instance.
12228
- * This class holds data about frames in a texture atlas or sprite sheet.
12229
- */
12230
11960
  constructor() {
12231
- /**
12232
- * @type {import('./frame.js').Frame[]}
12233
- */
12234
11961
  this._frames = [];
12235
- /**
12236
- * @type {string[]}
12237
- */
12238
- this._frameNames = [];
11962
+ this._frameNames = {};
12239
11963
  }
12240
- /**
12241
- * Add a frame to the frame data collection.
12242
- * @param {import('./frame.js').Frame} frame - The frame to add.
12243
- * @returns {import('./frame.js').Frame} The added frame.
12244
- */
12245
11964
  addFrame(frame) {
12246
11965
  frame.index = this._frames.length;
12247
11966
  this._frames.push(frame);
12248
11967
  if (frame.name !== "") this._frameNames[frame.name] = frame.index;
12249
11968
  return frame;
12250
11969
  }
12251
- /**
12252
- * Get a frame by its index.
12253
- * @param {number} index - The index of the frame to get.
12254
- * @returns {import('./frame.js').Frame} The frame at the specified index, or the first frame if index is out of bounds.
12255
- */
12256
11970
  getFrame(index = 0) {
12257
11971
  if (index >= this._frames.length) index = 0;
12258
11972
  return this._frames[index];
12259
11973
  }
12260
- /**
12261
- * Get a frame by its name.
12262
- * @param {string} name - The name of the frame to get.
12263
- * @returns {import('./frame.js').Frame} The frame with the specified name, or null if not found.
12264
- */
12265
11974
  getFrameByName(name) {
12266
11975
  if (typeof this._frameNames[name] === "number") return this._frames[this._frameNames[name]];
12267
11976
  return null;
12268
11977
  }
12269
- /**
12270
- * Check if a frame with the given name exists.
12271
- * @param {string} name - The name of the frame to check.
12272
- * @returns {boolean} True if a frame with this name exists, false otherwise.
12273
- */
12274
11978
  checkFrameName(name) {
12275
11979
  if (this._frameNames[name] == null) return false;
12276
11980
  return true;
12277
11981
  }
12278
- /**
12279
- * Create a clone of this FrameData instance.
12280
- * @returns {FrameData} A new FrameData instance with cloned frames.
12281
- */
12282
11982
  clone() {
12283
11983
  return cloneFrameData(this);
12284
11984
  }
12285
- /**
12286
- * Get a range of frames by index.
12287
- * @param {number} start - The starting index of the frame range.
12288
- * @param {number} end - The ending index of the frame range.
12289
- * @param {import('./frame.js').Frame[]} output - Optional array to populate with frames.
12290
- * @returns {import('./frame.js').Frame[]} An array of frames in the specified range.
12291
- */
12292
11985
  getFrameRange(start, end, output = null) {
12293
11986
  const result = output || [];
12294
11987
  for (let i = start; i <= end; i += 1) result.push(this._frames[i]);
12295
11988
  return result;
12296
11989
  }
12297
- /**
12298
- * Get frame indexes from an array of frame names or indices.
12299
- * @param {number[]|string[]} frames - An array of frame names or indices.
12300
- * @param {boolean} useNumericIndex - Whether to treat numeric values as frame indices.
12301
- * @param {number[]} output - Optional array to populate with frame indexes.
12302
- * @returns {number[]} An array of frame indexes.
12303
- */
12304
11990
  getFrameIndexes(frames, useNumericIndex = true, output = null) {
12305
11991
  const result = output || [];
12306
- if (frames && frames.length > 0) {
12307
- for (let i = 0; i < frames.length; i += 1) if (useNumericIndex && this._frames[frames[i]]) result.push(this._frames[frames[i]].index);
12308
- else if (this.getFrameByName(frames[i])) result.push(this.getFrameByName(frames[i]).index);
12309
- } else for (let i = 0; i < this._frames.length; i += 1) result.push(this._frames[i].index);
11992
+ if (frames && frames.length > 0) for (let i = 0; i < frames.length; i += 1) {
11993
+ const f = frames[i];
11994
+ if (useNumericIndex && this._frames[f]) result.push(this._frames[f].index);
11995
+ else {
11996
+ const found = this.getFrameByName(f);
11997
+ if (found) result.push(found.index);
11998
+ }
11999
+ }
12000
+ else for (let i = 0; i < this._frames.length; i += 1) result.push(this._frames[i].index);
12310
12001
  return result;
12311
12002
  }
12312
- /**
12313
- * Destroy this FrameData instance and clean up resources.
12314
- * This method clears internal arrays and releases references to frames.
12315
- */
12316
12003
  destroy() {
12317
12004
  this._frames = null;
12318
12005
  this._frameNames = null;
12319
12006
  }
12320
- /**
12321
- * Get the total number of frames in this FrameData instance.
12322
- * @returns {number} The total number of frames.
12323
- */
12324
12007
  get total() {
12325
12008
  return this._frames.length;
12326
12009
  }
12327
12010
  };
12328
12011
  //#endregion
12329
12012
  //#region src/phaser/core/frame_util.ts
12330
- /**
12331
- * Clone a Frame object.
12332
- * @param {Frame} frame - The frame to clone.
12333
- * @param {Frame} output - Optional output frame to populate.
12334
- * @returns {Frame} The cloned frame or the provided output frame.
12335
- */
12336
12013
  const cloneFrame = (frame, output = null) => {
12337
12014
  const result = output || new Frame(frame.index, frame.x, frame.y, frame.width, frame.height);
12338
12015
  result.initialize(frame.index, frame.x, frame.y, frame.width, frame.height);
12339
12016
  return result;
12340
12017
  };
12341
- /**
12342
- * Clone a FrameData object.
12343
- * @param {FrameData} frameData - The frame data to clone.
12344
- * @param {FrameData} output - Optional output frame data to populate.
12345
- * @returns {FrameData} The cloned frame data or the provided output frame data.
12346
- */
12347
12018
  const cloneFrameData = (frameData, output = null) => {
12348
12019
  const result = output || new FrameData();
12349
12020
  for (let i = 0; i < frameData.total; i += 1) result.addFrame(frameData.getFrame(i).clone());
@@ -12352,27 +12023,29 @@ const cloneFrameData = (frameData, output = null) => {
12352
12023
  //#endregion
12353
12024
  //#region src/phaser/core/frame.ts
12354
12025
  var Frame = class {
12355
- /**
12356
- * Creates a new Frame instance.
12357
- * @param {number} index - The index of this frame in the animation.
12358
- * @param {number} x - The x coordinate of this frame's position in the texture.
12359
- * @param {number} y - The y coordinate of this frame's position in the texture.
12360
- * @param {number} width - The width of this frame in pixels.
12361
- * @param {number} height - The height of this frame in pixels.
12362
- * @param {string} name - The name of this frame.
12363
- */
12026
+ index;
12027
+ x;
12028
+ y;
12029
+ width;
12030
+ height;
12031
+ name;
12032
+ centerX;
12033
+ centerY;
12034
+ distance;
12035
+ rotated;
12036
+ rotationDirection;
12037
+ trimmed;
12038
+ sourceSizeW;
12039
+ sourceSizeH;
12040
+ spriteSourceSizeX;
12041
+ spriteSourceSizeY;
12042
+ spriteSourceSizeW;
12043
+ spriteSourceSizeH;
12044
+ right;
12045
+ bottom;
12364
12046
  constructor(index, x, y, width, height, name) {
12365
12047
  this.initialize(index, x, y, width, height, name);
12366
12048
  }
12367
- /**
12368
- * Initializes this frame with the specified properties.
12369
- * @param {number} index - The index of this frame in the animation.
12370
- * @param {number} x - The x coordinate of this frame's position in the texture.
12371
- * @param {number} y - The y coordinate of this frame's position in the texture.
12372
- * @param {number} width - The width of this frame in pixels.
12373
- * @param {number} height - The height of this frame in pixels.
12374
- * @param {string} name - The name of this frame.
12375
- */
12376
12049
  initialize(index, x, y, width, height, name) {
12377
12050
  this.index = index;
12378
12051
  this.x = x;
@@ -12395,11 +12068,6 @@ var Frame = class {
12395
12068
  this.right = this.x + this.width;
12396
12069
  this.bottom = this.y + this.height;
12397
12070
  }
12398
- /**
12399
- * Resizes this frame to the specified dimensions.
12400
- * @param {number} width - The new width of this frame in pixels.
12401
- * @param {number} height - The new height of this frame in pixels.
12402
- */
12403
12071
  resize(width, height) {
12404
12072
  this.width = width;
12405
12073
  this.height = height;
@@ -12411,16 +12079,6 @@ var Frame = class {
12411
12079
  this.right = this.x + width;
12412
12080
  this.bottom = this.y + height;
12413
12081
  }
12414
- /**
12415
- * Sets the trim properties for this frame.
12416
- * @param {boolean} trimmed - Whether this frame is trimmed.
12417
- * @param {number} actualWidth - The actual width of the trimmed frame.
12418
- * @param {number} actualHeight - The actual height of the trimmed frame.
12419
- * @param {number} destX - The destination x coordinate for the trimmed frame.
12420
- * @param {number} destY - The destination y coordinate for the trimmed frame.
12421
- * @param {number} destWidth - The destination width of the trimmed frame.
12422
- * @param {number} destHeight - The destination height of the trimmed frame.
12423
- */
12424
12082
  setTrim(trimmed, actualWidth, actualHeight, destX, destY, destWidth, destHeight) {
12425
12083
  this.trimmed = trimmed;
12426
12084
  if (trimmed) {
@@ -12434,18 +12092,9 @@ var Frame = class {
12434
12092
  this.spriteSourceSizeH = destHeight;
12435
12093
  }
12436
12094
  }
12437
- /**
12438
- * Creates a clone of this frame.
12439
- * @returns {Frame} A new Frame instance with the same properties.
12440
- */
12441
12095
  clone() {
12442
12096
  return cloneFrame(this);
12443
12097
  }
12444
- /**
12445
- * Gets the rectangle bounds of this frame.
12446
- * @param {Rectangle} output - The rectangle to use for the result (optional).
12447
- * @returns {Rectangle} A Rectangle object representing this frame's bounds.
12448
- */
12449
12098
  getRect(output = null) {
12450
12099
  const result = output || new Rectangle();
12451
12100
  result.setTo(this.x, this.y, this.width, this.height);
@@ -12460,7 +12109,7 @@ var Frame = class {
12460
12109
  * @param {object} json - TBD.
12461
12110
  * @returns {FrameData} TBD.
12462
12111
  */
12463
- const JSONDataHash = (game, json) => {
12112
+ const JSONDataHash = (game, json, _key) => {
12464
12113
  if (!json.frames) {
12465
12114
  game.logger.warn("JSONDataHash: Invalid Texture Atlas JSON given, missing frames object", json);
12466
12115
  return null;
@@ -13190,7 +12839,7 @@ var Cache = class {
13190
12839
  * @param {object} data - The data to associate with the resolved URL.
13191
12840
  * @returns {string} The resolved URL or null if not enabled.
13192
12841
  */
13193
- _resolveURL(url, data) {
12842
+ _resolveURL(url, data = null) {
13194
12843
  if (!this.autoResolveURL) return null;
13195
12844
  this._urlResolver.src = this.game.load.baseURL + url;
13196
12845
  this._urlTemp = this._urlResolver.src;
@@ -13674,6 +13323,31 @@ var ArraySet = class {
13674
13323
  //#endregion
13675
13324
  //#region src/phaser/core/input_mouse.ts
13676
13325
  var Mouse = class {
13326
+ game;
13327
+ input;
13328
+ callbackContext;
13329
+ mouseDownCallback;
13330
+ mouseUpCallback;
13331
+ mouseOutCallback;
13332
+ mouseOverCallback;
13333
+ mouseWheelCallback;
13334
+ mouseMoveCallback;
13335
+ capture;
13336
+ button;
13337
+ wheelDelta;
13338
+ enabled;
13339
+ locked;
13340
+ stopOnGameOut;
13341
+ event;
13342
+ _onMouseDown;
13343
+ _onMouseMove;
13344
+ _onMouseUp;
13345
+ _onMouseOut;
13346
+ _onMouseOver;
13347
+ _onMouseWheel;
13348
+ _onMouseUpGlobal;
13349
+ _onMouseOutGlobal;
13350
+ _wheelEvent;
13677
13351
  /**
13678
13352
  * TBD.
13679
13353
  * @param {import('./game.js').Game} game - TBD.
@@ -14503,6 +14177,7 @@ var Touch = class {
14503
14177
  _onTouchEnter;
14504
14178
  _onTouchLeave;
14505
14179
  _onTouchCancel;
14180
+ _documentTouchMove;
14506
14181
  /**
14507
14182
  * TBD.
14508
14183
  * @param {import('./game.js').Game} game - TBD.
@@ -14691,6 +14366,7 @@ var Input = class {
14691
14366
  _localPoint;
14692
14367
  _pollCounter;
14693
14368
  _oldPosition;
14369
+ _onClickTrampoline;
14694
14370
  _x;
14695
14371
  _y;
14696
14372
  /**
@@ -15542,7 +15218,7 @@ var Loader = class {
15542
15218
  removeFile(type, key) {
15543
15219
  const asset = this.getAsset(type, key);
15544
15220
  if (asset) {
15545
- if (!asset.loaded && !asset.loading) this._fileList.splice(asset.index, 1);
15221
+ if (!asset.file.loaded && !asset.file.loading) this._fileList.splice(asset.index, 1);
15546
15222
  }
15547
15223
  }
15548
15224
  /**
@@ -15811,7 +15487,7 @@ var Loader = class {
15811
15487
  return onload.call(scope, file, xhr);
15812
15488
  } catch (error) {
15813
15489
  const typedError = error instanceof Error ? error : new Error(String(error));
15814
- if (!scope.hasLoaded) scope.asyncComplete(file, error.message || "Exception");
15490
+ if (!scope.hasLoaded) scope.asyncComplete(file, typedError.message || "Exception");
15815
15491
  else scope.game.logger.exception("Loader", typedError);
15816
15492
  }
15817
15493
  return null;
@@ -15825,7 +15501,7 @@ var Loader = class {
15825
15501
  return onerror.call(scope, file, xhr);
15826
15502
  } catch (error) {
15827
15503
  const typedError = error instanceof Error ? error : new Error(String(error));
15828
- if (!scope.hasLoaded) scope.asyncComplete(file, error.message || "Exception");
15504
+ if (!scope.hasLoaded) scope.asyncComplete(file, typedError.message || "Exception");
15829
15505
  else scope.game.logger.exception("Loader", typedError);
15830
15506
  }
15831
15507
  return null;
@@ -16424,6 +16100,10 @@ var ScaleManager = class {
16424
16100
  _lastReportedCanvasSize;
16425
16101
  _lastReportedGameSize;
16426
16102
  _booted;
16103
+ _orientationChange;
16104
+ _windowResize;
16105
+ _fullScreenChange;
16106
+ _fullScreenError;
16427
16107
  /**
16428
16108
  * TBD.
16429
16109
  * @param {import('./game.js').Game} game - TBD.
@@ -16995,7 +16675,7 @@ var ScaleManager = class {
16995
16675
  if (!this.compatibility.supportsFullScreen) {
16996
16676
  const scope = this;
16997
16677
  setTimeout(() => {
16998
- scope.fullScreenError();
16678
+ scope.fullScreenError({});
16999
16679
  }, 10);
17000
16680
  return false;
17001
16681
  }
@@ -17288,6 +16968,7 @@ var SceneManager = class {
17288
16968
  onResizeCallback;
17289
16969
  onPauseUpdateCallback;
17290
16970
  onShutDownCallback;
16971
+ callbackContext;
17291
16972
  /**
17292
16973
  * Creates a new SceneManager instance.
17293
16974
  * @param {import('./game.js').Game} game - The game instance this manager belongs to.
@@ -17541,97 +17222,51 @@ var SceneManager = class {
17541
17222
  //#region src/phaser/core/sound.ts
17542
17223
  var Sound = class {
17543
17224
  _paused;
17544
- /** @type {import('./game.js').Game} */
17545
17225
  game;
17546
- /** @type {string} */
17547
17226
  name;
17548
- /** @type {string} */
17549
17227
  key;
17550
- /** @type {boolean} */
17551
17228
  loop;
17552
- /** @type {object} */
17553
17229
  markers;
17554
- /** @type {AudioContext} */
17555
17230
  context;
17556
- /** @type {boolean} */
17557
17231
  autoplay;
17558
- /** @type {number} */
17559
17232
  totalDuration;
17560
- /** @type {number} */
17561
17233
  startTime;
17562
- /** @type {number} */
17563
17234
  currentTime;
17564
- /** @type {number} */
17565
17235
  duration;
17566
- /** @type {number} */
17567
17236
  durationMS;
17568
- /** @type {number} */
17569
17237
  position;
17570
- /** @type {number} */
17571
17238
  stopTime;
17572
- /** @type {boolean} */
17573
17239
  paused;
17574
- /** @type {number} */
17575
17240
  pausedPosition;
17576
- /** @type {number} */
17577
17241
  pausedTime;
17578
- /** @type {boolean} */
17579
17242
  isPlaying;
17580
- /** @type {string} */
17581
17243
  currentMarker;
17582
- /** @type {import('./tween.js').Tween | null} */
17583
17244
  fadeTween;
17584
- /** @type {boolean} */
17585
17245
  pendingPlayback;
17586
- /** @type {boolean} */
17587
17246
  override;
17588
- /** @type {boolean} */
17589
17247
  allowMultiple;
17590
- /** @type {AudioNode | null} */
17591
17248
  externalNode;
17592
- /** @type {GainNode | null} */
17593
17249
  masterGainNode;
17594
- /** @type {GainNode | null} */
17595
17250
  gainNode;
17596
- /** @type {AudioBufferSourceNode | null} */
17597
17251
  _sound;
17598
- /** @type {boolean} */
17599
17252
  _markedToDelete;
17600
- /** @type {boolean} */
17601
17253
  _removeFromSoundManager;
17602
- /** @type {Signal} */
17603
17254
  onPlay;
17604
- /** @type {Signal} */
17605
17255
  onPause;
17606
- /** @type {Signal} */
17607
17256
  onResume;
17608
- /** @type {Signal} */
17609
17257
  onLoop;
17610
- /** @type {Signal} */
17611
17258
  onStop;
17612
- /** @type {Signal} */
17613
17259
  onMute;
17614
- /** @type {Signal} */
17615
17260
  onMarkerComplete;
17616
- /** @type {Signal} */
17617
17261
  onFadeComplete;
17618
- /** @type {number} */
17619
17262
  _volume;
17620
- /** @type {AudioBuffer | null} */
17621
17263
  _buffer;
17622
- /** @type {boolean} */
17623
17264
  _muted;
17624
- /** @type {string} */
17625
17265
  _tempMarker;
17626
- /** @type {number} */
17627
17266
  _tempPosition;
17628
- /** @type {number} */
17629
17267
  _tempVolume;
17630
- /** @type {number} */
17631
17268
  _tempPause;
17632
- /** @type {number} */
17633
17269
  _muteVolume;
17634
- /** @type {boolean} */
17635
17270
  _tempLoop;
17636
17271
  /**
17637
17272
  * Creates a new Sound instance.
@@ -17811,7 +17446,7 @@ var Sound = class {
17811
17446
  * @param {boolean} forceRestart - Whether to force restarting the sound even if it's already playing.
17812
17447
  * @returns {Sound} This Sound instance for chaining.
17813
17448
  */
17814
- play(marker, position, volume, loop, forceRestart = true) {
17449
+ play(marker = "", position = 0, volume = 1, loop = false, forceRestart = true) {
17815
17450
  if (marker === void 0 || marker === false || marker === null) marker = "";
17816
17451
  if (forceRestart === void 0) forceRestart = true;
17817
17452
  if (this.isPlaying && !this.allowMultiple && !forceRestart && !this.override) return this;
@@ -18127,6 +17762,8 @@ var SoundManager = class {
18127
17762
  _watching;
18128
17763
  _watchCallback;
18129
17764
  _watchContext;
17765
+ masterGain;
17766
+ _muteVolume;
18130
17767
  /**
18131
17768
  * Creates a new SoundManager instance.
18132
17769
  * @param {import('./game.js').Game} game - Reference to the Phaser Game instance.
@@ -18521,8 +18158,6 @@ var SoundManager = class {
18521
18158
  //#endregion
18522
18159
  //#region src/phaser/core/stage.ts
18523
18160
  var Stage = class extends DisplayObject {
18524
- name;
18525
- worldTransform;
18526
18161
  currentRenderOrderID;
18527
18162
  _bgColor;
18528
18163
  /**
@@ -18594,6 +18229,7 @@ var Stage = class extends DisplayObject {
18594
18229
  updateTransform() {
18595
18230
  this.worldAlpha = 1;
18596
18231
  for (let i = 0; i < this.children.length; i += 1) this.children[i].updateTransform();
18232
+ return this;
18597
18233
  }
18598
18234
  /**
18599
18235
  * Destroys the stage and cleans up resources.
@@ -18643,17 +18279,6 @@ var TimerEvent = class {
18643
18279
  callbackContext;
18644
18280
  args;
18645
18281
  pendingDelete;
18646
- /**
18647
- * Creates a new TimerEvent instance.
18648
- * @param {import('./timer.js').Timer} timer - Reference to the parent Timer.
18649
- * @param {number} delay - The delay (in milliseconds) before the event should occur.
18650
- * @param {number} tick - The tick (in milliseconds) at which the event should occur.
18651
- * @param {number} repeatCount - The number of times the event should repeat.
18652
- * @param {boolean} loop - Whether the event should loop.
18653
- * @param {Function} callback - The function to call when the event occurs.
18654
- * @param {object} callbackContext - The context in which to call the callback function.
18655
- * @param {...any} args - Arguments to pass to the callback function.
18656
- */
18657
18282
  constructor(timer, delay, tick, repeatCount, loop, callback, callbackContext, args) {
18658
18283
  this.timer = timer;
18659
18284
  this.delay = delay;
@@ -18745,7 +18370,7 @@ var Timer = class {
18745
18370
  * @param {...any} args - Arguments to pass to the callback function.
18746
18371
  * @returns {TimerEvent} The created TimerEvent.
18747
18372
  */
18748
- create(delay, loop, repeatCount, callback, callbackContext = null, args) {
18373
+ create(delay, loop, repeatCount, callback, callbackContext = null, args = []) {
18749
18374
  const roundedDelay = Math.round(delay);
18750
18375
  let tick = roundedDelay;
18751
18376
  if (this._now === 0) tick += this.game.time.time;
@@ -19300,6 +18925,7 @@ var TweenData = class {
19300
18925
  interpolationContext;
19301
18926
  isRunning;
19302
18927
  isFrom;
18928
+ yoyoCounter;
19303
18929
  /**
19304
18930
  * Creates a new TweenData instance.
19305
18931
  * @param {import('./tween.js').Tween} parent - The parent Tween instance.
@@ -19530,51 +19156,28 @@ var TweenData = class {
19530
19156
  //#endregion
19531
19157
  //#region src/phaser/core/tween.ts
19532
19158
  var Tween = class {
19533
- /** @type {import('./game.js').Game} */
19534
19159
  game;
19535
- /** @type {import('../display/display_object.js').DisplayObject} */
19536
19160
  target;
19537
- /** @type {import('./tween_manager.js').TweenManager} */
19538
19161
  manager;
19539
- /** @type {TweenData[]} */
19540
19162
  timeline;
19541
- /** @type {boolean} */
19542
19163
  reverse;
19543
- /** @type {number} */
19544
19164
  timeScale;
19545
- /** @type {number} */
19546
19165
  repeatCounter;
19547
- /** @type {boolean} */
19548
19166
  pendingDelete;
19549
- /** @type {Signal} */
19550
19167
  onStart;
19551
- /** @type {Signal} */
19552
19168
  onLoop;
19553
- /** @type {Signal} */
19554
19169
  onRepeat;
19555
- /** @type {Signal} */
19556
19170
  onChildComplete;
19557
- /** @type {Signal} */
19558
19171
  onComplete;
19559
- /** @type {boolean} */
19560
19172
  isRunning;
19561
- /** @type {number} */
19562
19173
  current;
19563
- /** @type {object} */
19564
19174
  properties;
19565
- /** @type {Tween | null} */
19566
19175
  chainedTween;
19567
- /** @type {boolean} */
19568
19176
  isPaused;
19569
- /** @type {Function | null} */
19570
19177
  _onUpdateCallback;
19571
- /** @type {object | null} */
19572
19178
  _onUpdateCallbackContext;
19573
- /** @type {number} */
19574
19179
  _pausedTime;
19575
- /** @type {boolean} */
19576
19180
  _codePaused;
19577
- /** @type {boolean} */
19578
19181
  _hasStarted;
19579
19182
  /**
19580
19183
  * Creates a new Tween instance.
@@ -20451,62 +20054,36 @@ var World = class extends Group {
20451
20054
  //#endregion
20452
20055
  //#region src/phaser/core/game.ts
20453
20056
  var Game = class {
20454
- /** @type {object} */
20455
20057
  config;
20456
- /** @type {number} */
20457
20058
  id;
20458
- /** @type {string|HTMLElement} */
20459
20059
  parent;
20460
- /** @type {number} */
20461
20060
  width;
20462
- /** @type {number} */
20463
20061
  height;
20464
- /** @type {CanvasRenderer | WebGLRenderer} */
20465
20062
  renderer;
20466
- /** @type {SceneManager} */
20467
20063
  state;
20468
- /** @type {boolean} */
20469
20064
  isBooted;
20470
- /** @type {boolean} */
20471
20065
  paused;
20472
- /** @type {RequestAnimationFrame} */
20473
20066
  raf;
20474
- /** @type {GameObjectFactory} */
20475
20067
  add;
20476
- /** @type {Cache} */
20477
20068
  cache;
20478
- /** @type {Input} */
20479
20069
  input;
20480
- /** @type {Loader} */
20481
20070
  load;
20482
- /** @type {ScaleManager} */
20483
20071
  scale;
20484
- /** @type {SoundManager} */
20485
20072
  sound;
20486
- /** @type {Stage} */
20487
20073
  stage;
20488
- /** @type {Time} */
20489
20074
  time;
20490
- /** @type {TweenManager} */
20491
20075
  tweens;
20492
- /** @type {World} */
20493
20076
  world;
20494
- /** @type {Device} */
20495
20077
  device;
20496
- /** @type {Logger} */
20497
20078
  logger;
20498
- /** @type {HTMLCanvasElement} */
20499
20079
  canvas;
20500
- /** @type {CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext} */
20501
20080
  context;
20502
- /** @type {Signal} */
20503
20081
  onPause;
20504
- /** @type {Signal} */
20505
20082
  onResume;
20506
- /** @type {Signal} */
20507
20083
  onBoot;
20508
- /** @type {boolean} */
20509
20084
  isPaused;
20085
+ contextLostBinded;
20086
+ contextRestoredBinded;
20510
20087
  /**
20511
20088
  * Creates a new Game instance.
20512
20089
  * @param {object} gameConfig - The configuration object for the game.