@vpmedia/phaser 1.104.0 → 1.106.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.
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +164 -592
- package/dist/index.js.map +1 -1
- package/dist/phaser/core/animation.d.ts +35 -57
- package/dist/phaser/core/animation.d.ts.map +1 -1
- package/dist/phaser/core/animation_manager.d.ts +11 -10
- package/dist/phaser/core/animation_manager.d.ts.map +1 -1
- package/dist/phaser/core/animation_parser.d.ts +2 -2
- package/dist/phaser/core/animation_parser.d.ts.map +1 -1
- package/dist/phaser/core/array_set.d.ts +3 -3
- package/dist/phaser/core/array_set.d.ts.map +1 -1
- package/dist/phaser/core/cache.d.ts +60 -60
- package/dist/phaser/core/cache.d.ts.map +1 -1
- package/dist/phaser/core/device.d.ts.map +1 -1
- package/dist/phaser/core/device_util.d.ts +10 -10
- package/dist/phaser/core/device_util.d.ts.map +1 -1
- package/dist/phaser/core/dom.d.ts +6 -5
- package/dist/phaser/core/dom.d.ts.map +1 -1
- package/dist/phaser/core/event_manager.d.ts +49 -174
- package/dist/phaser/core/event_manager.d.ts.map +1 -1
- package/dist/phaser/core/factory.d.ts +7 -7
- package/dist/phaser/core/factory.d.ts.map +1 -1
- package/dist/phaser/core/frame.d.ts +27 -48
- package/dist/phaser/core/frame.d.ts.map +1 -1
- package/dist/phaser/core/frame_data.d.ts +11 -60
- package/dist/phaser/core/frame_data.d.ts.map +1 -1
- package/dist/phaser/core/frame_util.d.ts +4 -14
- package/dist/phaser/core/frame_util.d.ts.map +1 -1
- package/dist/phaser/core/game.d.ts +49 -58
- package/dist/phaser/core/game.d.ts.map +1 -1
- package/dist/phaser/core/input.d.ts +15 -13
- package/dist/phaser/core/input.d.ts.map +1 -1
- package/dist/phaser/core/input_handler.d.ts +23 -20
- package/dist/phaser/core/input_handler.d.ts.map +1 -1
- package/dist/phaser/core/input_mouse.d.ts +26 -1
- package/dist/phaser/core/input_mouse.d.ts.map +1 -1
- package/dist/phaser/core/input_mspointer.d.ts +2 -2
- package/dist/phaser/core/input_mspointer.d.ts.map +1 -1
- package/dist/phaser/core/input_pointer.d.ts +9 -9
- package/dist/phaser/core/input_pointer.d.ts.map +1 -1
- package/dist/phaser/core/input_touch.d.ts +2 -1
- package/dist/phaser/core/input_touch.d.ts.map +1 -1
- package/dist/phaser/core/loader.d.ts +38 -28
- package/dist/phaser/core/loader.d.ts.map +1 -1
- package/dist/phaser/core/loader_parser.d.ts +4 -4
- package/dist/phaser/core/loader_parser.d.ts.map +1 -1
- package/dist/phaser/core/raf.d.ts +2 -2
- package/dist/phaser/core/raf.d.ts.map +1 -1
- package/dist/phaser/core/scale_manager.d.ts +22 -17
- package/dist/phaser/core/scale_manager.d.ts.map +1 -1
- package/dist/phaser/core/scene.d.ts +1 -1
- package/dist/phaser/core/scene.d.ts.map +1 -1
- package/dist/phaser/core/scene_manager.d.ts +10 -9
- package/dist/phaser/core/scene_manager.d.ts.map +1 -1
- package/dist/phaser/core/signal.d.ts +9 -8
- package/dist/phaser/core/signal.d.ts.map +1 -1
- package/dist/phaser/core/signal_binding.d.ts +2 -2
- package/dist/phaser/core/signal_binding.d.ts.map +1 -1
- package/dist/phaser/core/sound.d.ts +56 -101
- package/dist/phaser/core/sound.d.ts.map +1 -1
- package/dist/phaser/core/sound_manager.d.ts +11 -9
- package/dist/phaser/core/sound_manager.d.ts.map +1 -1
- package/dist/phaser/core/sound_sprite.d.ts +4 -4
- package/dist/phaser/core/sound_sprite.d.ts.map +1 -1
- package/dist/phaser/core/stage.d.ts +3 -3
- package/dist/phaser/core/stage.d.ts.map +1 -1
- package/dist/phaser/core/time.d.ts +5 -5
- package/dist/phaser/core/time.d.ts.map +1 -1
- package/dist/phaser/core/timer.d.ts +10 -10
- package/dist/phaser/core/timer.d.ts.map +1 -1
- package/dist/phaser/core/timer_event.d.ts +11 -21
- package/dist/phaser/core/timer_event.d.ts.map +1 -1
- package/dist/phaser/core/tween.d.ts +37 -59
- package/dist/phaser/core/tween.d.ts.map +1 -1
- package/dist/phaser/core/tween_data.d.ts +6 -5
- package/dist/phaser/core/tween_data.d.ts.map +1 -1
- package/dist/phaser/core/tween_easing.d.ts +31 -31
- package/dist/phaser/core/tween_easing.d.ts.map +1 -1
- package/dist/phaser/core/tween_manager.d.ts +4 -4
- package/dist/phaser/core/tween_manager.d.ts.map +1 -1
- package/dist/phaser/core/world.d.ts +1 -1
- package/dist/phaser/core/world.d.ts.map +1 -1
- package/dist/phaser/display/bitmap_text.d.ts +22 -20
- package/dist/phaser/display/bitmap_text.d.ts.map +1 -1
- package/dist/phaser/display/button.d.ts +23 -35
- package/dist/phaser/display/button.d.ts.map +1 -1
- package/dist/phaser/display/canvas/buffer.d.ts +2 -2
- package/dist/phaser/display/canvas/buffer.d.ts.map +1 -1
- package/dist/phaser/display/canvas/graphics.d.ts +3 -3
- package/dist/phaser/display/canvas/graphics.d.ts.map +1 -1
- package/dist/phaser/display/canvas/masker.d.ts.map +1 -1
- package/dist/phaser/display/canvas/pool.d.ts +2 -2
- package/dist/phaser/display/canvas/pool.d.ts.map +1 -1
- package/dist/phaser/display/canvas/renderer.d.ts +5 -5
- package/dist/phaser/display/canvas/renderer.d.ts.map +1 -1
- package/dist/phaser/display/canvas/tinter.d.ts +3 -3
- package/dist/phaser/display/canvas/tinter.d.ts.map +1 -1
- package/dist/phaser/display/canvas/util.d.ts +9 -9
- package/dist/phaser/display/canvas/util.d.ts.map +1 -1
- package/dist/phaser/display/display_object.d.ts +45 -42
- package/dist/phaser/display/display_object.d.ts.map +1 -1
- package/dist/phaser/display/graphics.d.ts +24 -16
- package/dist/phaser/display/graphics.d.ts.map +1 -1
- package/dist/phaser/display/graphics_data.d.ts +1 -1
- package/dist/phaser/display/graphics_data.d.ts.map +1 -1
- package/dist/phaser/display/graphics_data_util.d.ts +1 -1
- package/dist/phaser/display/graphics_data_util.d.ts.map +1 -1
- package/dist/phaser/display/group.d.ts +24 -37
- package/dist/phaser/display/group.d.ts.map +1 -1
- package/dist/phaser/display/image.d.ts +34 -49
- package/dist/phaser/display/image.d.ts.map +1 -1
- package/dist/phaser/display/sprite_batch.d.ts +1 -1
- package/dist/phaser/display/sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/sprite_util.d.ts +5 -5
- package/dist/phaser/display/sprite_util.d.ts.map +1 -1
- package/dist/phaser/display/text.d.ts +86 -66
- package/dist/phaser/display/text.d.ts.map +1 -1
- package/dist/phaser/display/webgl/abstract_filter.d.ts +2 -1
- package/dist/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
- package/dist/phaser/display/webgl/base_texture.d.ts +2 -2
- package/dist/phaser/display/webgl/base_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/blend_manager.d.ts +3 -2
- package/dist/phaser/display/webgl/blend_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/earcut.d.ts +10 -10
- package/dist/phaser/display/webgl/earcut.d.ts.map +1 -1
- package/dist/phaser/display/webgl/earcut_node.d.ts +1 -1
- package/dist/phaser/display/webgl/earcut_node.d.ts.map +1 -1
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts +2 -1
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/webgl/filter_manager.d.ts +2 -1
- package/dist/phaser/display/webgl/filter_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/filter_texture.d.ts +3 -2
- package/dist/phaser/display/webgl/filter_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/graphics.d.ts +11 -10
- package/dist/phaser/display/webgl/graphics.d.ts.map +1 -1
- package/dist/phaser/display/webgl/graphics_data.d.ts +2 -1
- package/dist/phaser/display/webgl/graphics_data.d.ts.map +1 -1
- package/dist/phaser/display/webgl/mask_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/render_texture.d.ts +2 -1
- package/dist/phaser/display/webgl/render_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/renderer.d.ts +8 -6
- package/dist/phaser/display/webgl/renderer.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/complex.d.ts +2 -1
- package/dist/phaser/display/webgl/shader/complex.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/fast.d.ts +2 -1
- package/dist/phaser/display/webgl/shader/fast.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/normal.d.ts +1 -0
- package/dist/phaser/display/webgl/shader/normal.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/primitive.d.ts +2 -1
- package/dist/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/strip.d.ts +2 -1
- package/dist/phaser/display/webgl/shader/strip.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader_manager.d.ts +4 -2
- package/dist/phaser/display/webgl/shader_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/sprite_batch.d.ts +3 -2
- package/dist/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/webgl/stencil_manager.d.ts +5 -4
- package/dist/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/texture.d.ts +15 -2
- package/dist/phaser/display/webgl/texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/texture_util.d.ts +2 -2
- package/dist/phaser/display/webgl/texture_util.d.ts.map +1 -1
- package/dist/phaser/display/webgl/util.d.ts +6 -6
- package/dist/phaser/display/webgl/util.d.ts.map +1 -1
- package/dist/phaser/geom/circle.d.ts +11 -10
- package/dist/phaser/geom/circle.d.ts.map +1 -1
- package/dist/phaser/geom/ellipse.d.ts +6 -5
- package/dist/phaser/geom/ellipse.d.ts.map +1 -1
- package/dist/phaser/geom/line.d.ts +14 -14
- package/dist/phaser/geom/line.d.ts.map +1 -1
- package/dist/phaser/geom/matrix.d.ts +13 -12
- package/dist/phaser/geom/matrix.d.ts.map +1 -1
- package/dist/phaser/geom/point.d.ts +19 -19
- package/dist/phaser/geom/point.d.ts.map +1 -1
- package/dist/phaser/geom/polygon.d.ts +6 -6
- package/dist/phaser/geom/polygon.d.ts.map +1 -1
- package/dist/phaser/geom/rectangle.d.ts +20 -20
- package/dist/phaser/geom/rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/rounded_rectangle.d.ts +2 -2
- package/dist/phaser/geom/rounded_rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/util/circle.d.ts +9 -7
- package/dist/phaser/geom/util/circle.d.ts.map +1 -1
- package/dist/phaser/geom/util/ellipse.d.ts +1 -1
- package/dist/phaser/geom/util/ellipse.d.ts.map +1 -1
- package/dist/phaser/geom/util/line.d.ts +5 -3
- package/dist/phaser/geom/util/line.d.ts.map +1 -1
- package/dist/phaser/geom/util/matrix.d.ts +2 -1
- package/dist/phaser/geom/util/matrix.d.ts.map +1 -1
- package/dist/phaser/geom/util/point.d.ts +19 -19
- package/dist/phaser/geom/util/point.d.ts.map +1 -1
- package/dist/phaser/geom/util/polygon.d.ts +2 -1
- package/dist/phaser/geom/util/polygon.d.ts.map +1 -1
- package/dist/phaser/geom/util/rectangle.d.ts +17 -15
- package/dist/phaser/geom/util/rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/util/rounded_rectangle.d.ts +2 -1
- package/dist/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
- package/dist/phaser/util/math.d.ts +51 -142
- package/dist/phaser/util/math.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/index.ts +8 -0
- package/src/phaser/core/animation.ts +46 -61
- package/src/phaser/core/animation_manager.ts +27 -21
- package/src/phaser/core/animation_parser.ts +11 -3
- package/src/phaser/core/array_set.ts +8 -8
- package/src/phaser/core/cache.ts +75 -68
- package/src/phaser/core/device.ts +24 -25
- package/src/phaser/core/device_util.ts +10 -10
- package/src/phaser/core/dom.ts +5 -5
- package/src/phaser/core/event_manager.ts +52 -193
- package/src/phaser/core/factory.ts +25 -18
- package/src/phaser/core/frame.ts +37 -51
- package/src/phaser/core/frame_data.ts +29 -76
- package/src/phaser/core/frame_util.ts +3 -16
- package/src/phaser/core/game.ts +36 -63
- package/src/phaser/core/input.ts +72 -68
- package/src/phaser/core/input_handler.ts +93 -84
- package/src/phaser/core/input_mouse.ts +42 -36
- package/src/phaser/core/input_mspointer.ts +24 -25
- package/src/phaser/core/input_pointer.ts +55 -56
- package/src/phaser/core/input_touch.ts +26 -26
- package/src/phaser/core/loader.ts +108 -70
- package/src/phaser/core/loader_parser.ts +24 -7
- package/src/phaser/core/raf.ts +2 -2
- package/src/phaser/core/scale_manager.ts +85 -82
- package/src/phaser/core/scene.ts +3 -4
- package/src/phaser/core/scene_manager.ts +26 -26
- package/src/phaser/core/signal.ts +16 -10
- package/src/phaser/core/signal_binding.ts +9 -2
- package/src/phaser/core/sound.ts +71 -112
- package/src/phaser/core/sound_manager.ts +31 -30
- package/src/phaser/core/sound_sprite.ts +11 -12
- package/src/phaser/core/stage.ts +8 -8
- package/src/phaser/core/time.ts +34 -35
- package/src/phaser/core/timer.ts +40 -34
- package/src/phaser/core/timer_event.ts +23 -23
- package/src/phaser/core/tween.ts +62 -68
- package/src/phaser/core/tween_data.ts +31 -31
- package/src/phaser/core/tween_easing.ts +31 -31
- package/src/phaser/core/tween_manager.ts +11 -12
- package/src/phaser/core/world.ts +1 -2
- package/src/phaser/display/bitmap_text.ts +41 -31
- package/src/phaser/display/button.ts +34 -49
- package/src/phaser/display/canvas/buffer.ts +6 -7
- package/src/phaser/display/canvas/graphics.ts +3 -4
- package/src/phaser/display/canvas/masker.ts +2 -3
- package/src/phaser/display/canvas/pool.ts +3 -4
- package/src/phaser/display/canvas/renderer.ts +19 -20
- package/src/phaser/display/canvas/tinter.ts +4 -5
- package/src/phaser/display/canvas/util.ts +17 -9
- package/src/phaser/display/display_object.ts +49 -50
- package/src/phaser/display/graphics.ts +56 -43
- package/src/phaser/display/graphics_data.ts +19 -12
- package/src/phaser/display/graphics_data_util.ts +1 -2
- package/src/phaser/display/group.ts +32 -42
- package/src/phaser/display/image.ts +38 -52
- package/src/phaser/display/sprite_batch.ts +1 -2
- package/src/phaser/display/sprite_util.ts +17 -6
- package/src/phaser/display/text.ts +82 -56
- package/src/phaser/display/webgl/abstract_filter.ts +8 -8
- package/src/phaser/display/webgl/base_texture.ts +14 -15
- package/src/phaser/display/webgl/blend_manager.ts +5 -5
- package/src/phaser/display/webgl/earcut.ts +44 -27
- package/src/phaser/display/webgl/earcut_node.ts +1 -1
- package/src/phaser/display/webgl/fast_sprite_batch.ts +19 -19
- package/src/phaser/display/webgl/filter_manager.ts +5 -5
- package/src/phaser/display/webgl/filter_texture.ts +7 -7
- package/src/phaser/display/webgl/graphics.ts +17 -11
- package/src/phaser/display/webgl/graphics_data.ts +11 -11
- package/src/phaser/display/webgl/mask_manager.ts +2 -3
- package/src/phaser/display/webgl/render_texture.ts +18 -12
- package/src/phaser/display/webgl/renderer.ts +24 -24
- package/src/phaser/display/webgl/shader/complex.ts +7 -7
- package/src/phaser/display/webgl/shader/fast.ts +8 -8
- package/src/phaser/display/webgl/shader/normal.ts +12 -12
- package/src/phaser/display/webgl/shader/primitive.ts +7 -7
- package/src/phaser/display/webgl/shader/strip.ts +7 -7
- package/src/phaser/display/webgl/shader_manager.ts +13 -13
- package/src/phaser/display/webgl/sprite_batch.ts +20 -20
- package/src/phaser/display/webgl/stencil_manager.ts +20 -8
- package/src/phaser/display/webgl/texture.ts +40 -24
- package/src/phaser/display/webgl/texture_util.ts +2 -3
- package/src/phaser/display/webgl/util.ts +10 -6
- package/src/phaser/geom/circle.ts +10 -10
- package/src/phaser/geom/ellipse.ts +6 -6
- package/src/phaser/geom/line.ts +14 -14
- package/src/phaser/geom/matrix.ts +12 -12
- package/src/phaser/geom/point.ts +19 -19
- package/src/phaser/geom/polygon.ts +5 -5
- package/src/phaser/geom/rectangle.ts +21 -21
- package/src/phaser/geom/rounded_rectangle.ts +2 -2
- package/src/phaser/geom/util/circle.ts +7 -7
- package/src/phaser/geom/util/ellipse.ts +1 -1
- package/src/phaser/geom/util/line.ts +5 -5
- package/src/phaser/geom/util/matrix.ts +1 -1
- package/src/phaser/geom/util/point.ts +27 -20
- package/src/phaser/geom/util/polygon.ts +1 -1
- package/src/phaser/geom/util/rectangle.ts +22 -15
- package/src/phaser/geom/util/rounded_rectangle.ts +1 -1
- package/src/phaser/util/math.ts +65 -151
package/dist/index.js
CHANGED
|
@@ -567,7 +567,7 @@ var Matrix = class {
|
|
|
567
567
|
* @returns {Float32Array} A Float32Array containing the matrix elements.
|
|
568
568
|
*/
|
|
569
569
|
toArray(transpose = false, output = null) {
|
|
570
|
-
const result = output || new Float32Array(9);
|
|
570
|
+
const result = output || /* @__PURE__ */ new Float32Array(9);
|
|
571
571
|
if (transpose) {
|
|
572
572
|
result[0] = this.a;
|
|
573
573
|
result[1] = this.b;
|
|
@@ -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, (
|
|
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
|
-
|
|
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.
|
|
@@ -3684,7 +3562,7 @@ var AnimationManager = class {
|
|
|
3684
3562
|
if (typeof value === "number" && this._frameData && this._frameData.getFrame(value) !== null) {
|
|
3685
3563
|
this.currentFrame = this._frameData.getFrame(value);
|
|
3686
3564
|
if (this.currentFrame) this.sprite.setFrame(this.currentFrame);
|
|
3687
|
-
} else this.game.logger.exception("AnimationManager", new Error(ENGINE_ERROR_CANNOT_SET_FRAME), { tags: { "asset.key": value } });
|
|
3565
|
+
} else this.game.logger.exception("AnimationManager", /* @__PURE__ */ new Error(ENGINE_ERROR_CANNOT_SET_FRAME), { tags: { "asset.key": value } });
|
|
3688
3566
|
}
|
|
3689
3567
|
/**
|
|
3690
3568
|
* Gets the current frame name.
|
|
@@ -3704,7 +3582,7 @@ var AnimationManager = class {
|
|
|
3704
3582
|
this._frameIndex = this.currentFrame.index;
|
|
3705
3583
|
this.sprite.setFrame(this.currentFrame);
|
|
3706
3584
|
}
|
|
3707
|
-
} else this.game.logger.exception("AnimationManager", new Error(ENGINE_ERROR_CANNOT_SET_FRAME_NAME), { tags: { "asset.key": value } });
|
|
3585
|
+
} else this.game.logger.exception("AnimationManager", /* @__PURE__ */ new Error(ENGINE_ERROR_CANNOT_SET_FRAME_NAME), { tags: { "asset.key": value } });
|
|
3708
3586
|
}
|
|
3709
3587
|
};
|
|
3710
3588
|
//#endregion
|
|
@@ -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.
|
|
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
|
-
|
|
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.
|
|
@@ -7822,8 +7552,7 @@ const buildCircle = (graphicsData, webGLData) => {
|
|
|
7822
7552
|
width = circleData.width;
|
|
7823
7553
|
height = circleData.height;
|
|
7824
7554
|
}
|
|
7825
|
-
const
|
|
7826
|
-
const seg = Math.PI * 2 / totalSegs;
|
|
7555
|
+
const seg = Math.PI * 2 / 40;
|
|
7827
7556
|
if (graphicsData.fill) {
|
|
7828
7557
|
const color = hex2rgb(graphicsData.fillColor);
|
|
7829
7558
|
const alpha = graphicsData.fillAlpha;
|
|
@@ -7834,7 +7563,7 @@ const buildCircle = (graphicsData, webGLData) => {
|
|
|
7834
7563
|
const indices = webGLData.indices;
|
|
7835
7564
|
let vecPos = verts.length / 6;
|
|
7836
7565
|
indices.push(vecPos);
|
|
7837
|
-
for (let i = 0; i <
|
|
7566
|
+
for (let i = 0; i < 41; i += 1) {
|
|
7838
7567
|
verts.push(x, y, r, g, b, alpha);
|
|
7839
7568
|
verts.push(x + Math.sin(seg * i) * width, y + Math.cos(seg * i) * height, r, g, b, alpha);
|
|
7840
7569
|
indices.push(vecPos, vecPos + 1);
|
|
@@ -7845,7 +7574,7 @@ const buildCircle = (graphicsData, webGLData) => {
|
|
|
7845
7574
|
if (graphicsData.lineWidth) {
|
|
7846
7575
|
const tempPoints = graphicsData.points;
|
|
7847
7576
|
graphicsData.points = [];
|
|
7848
|
-
for (let i = 0; i <
|
|
7577
|
+
for (let i = 0; i < 41; i += 1) graphicsData.points.push(x + Math.sin(seg * i) * width, y + Math.cos(seg * i) * height);
|
|
7849
7578
|
buildLine(graphicsData, webGLData);
|
|
7850
7579
|
graphicsData.points = tempPoints;
|
|
7851
7580
|
}
|
|
@@ -8122,13 +7851,11 @@ const textureFromCanvas = (canvas, scaleMode) => {
|
|
|
8122
7851
|
//#endregion
|
|
8123
7852
|
//#region src/phaser/display/graphics.ts
|
|
8124
7853
|
var Graphics = class extends DisplayObject {
|
|
8125
|
-
type;
|
|
8126
|
-
renderable;
|
|
8127
7854
|
fillAlpha;
|
|
8128
7855
|
lineWidth;
|
|
8129
7856
|
lineColor;
|
|
7857
|
+
lineAlpha;
|
|
8130
7858
|
graphicsData;
|
|
8131
|
-
tint;
|
|
8132
7859
|
blendMode;
|
|
8133
7860
|
currentPath;
|
|
8134
7861
|
_webGL;
|
|
@@ -8136,10 +7863,14 @@ var Graphics = class extends DisplayObject {
|
|
|
8136
7863
|
boundsPadding;
|
|
8137
7864
|
_localBounds;
|
|
8138
7865
|
dirty;
|
|
7866
|
+
clearDirty;
|
|
8139
7867
|
_boundsDirty;
|
|
8140
7868
|
_cacheAsBitmap;
|
|
8141
7869
|
webGLDirty;
|
|
8142
7870
|
cachedSpriteDirty;
|
|
7871
|
+
filling;
|
|
7872
|
+
fillColor;
|
|
7873
|
+
_prevTint;
|
|
8143
7874
|
/**
|
|
8144
7875
|
* Creates a new Graphics object.
|
|
8145
7876
|
* @param {import('../core/game.js').Game} game - The game instance.
|
|
@@ -8879,33 +8610,18 @@ var Graphics = class extends DisplayObject {
|
|
|
8879
8610
|
//#endregion
|
|
8880
8611
|
//#region src/phaser/display/group.ts
|
|
8881
8612
|
var Group = class extends DisplayObject {
|
|
8882
|
-
/** @type {number} */
|
|
8883
|
-
z;
|
|
8884
|
-
/** @type {boolean} */
|
|
8885
8613
|
ignoreDestroy;
|
|
8886
|
-
/** @type {boolean} */
|
|
8887
8614
|
pendingDestroy;
|
|
8888
|
-
/** @type {Function} */
|
|
8889
8615
|
classType;
|
|
8890
|
-
/** @type {DisplayObject | null} */
|
|
8891
8616
|
cursor;
|
|
8892
|
-
/** @type {boolean} */
|
|
8893
8617
|
inputEnableChildren;
|
|
8894
|
-
/** @type {Signal} */
|
|
8895
8618
|
onChildInputDown;
|
|
8896
|
-
/** @type {Signal} */
|
|
8897
8619
|
onChildInputUp;
|
|
8898
|
-
/** @type {Signal} */
|
|
8899
8620
|
onChildInputOver;
|
|
8900
|
-
/** @type {Signal} */
|
|
8901
8621
|
onChildInputOut;
|
|
8902
|
-
/** @type {Signal} */
|
|
8903
8622
|
onDestroy;
|
|
8904
|
-
/** @type {number} */
|
|
8905
8623
|
cursorIndex;
|
|
8906
|
-
/** @type {string} */
|
|
8907
8624
|
_sortProperty;
|
|
8908
|
-
/** @type {object[] | null} */
|
|
8909
8625
|
filters;
|
|
8910
8626
|
/**
|
|
8911
8627
|
* Creates a new Group object.
|
|
@@ -9159,6 +8875,23 @@ var Group = class extends DisplayObject {
|
|
|
9159
8875
|
//#endregion
|
|
9160
8876
|
//#region src/phaser/display/text.ts
|
|
9161
8877
|
var Text = class extends Image$1 {
|
|
8878
|
+
canvas;
|
|
8879
|
+
context;
|
|
8880
|
+
padding;
|
|
8881
|
+
textBounds;
|
|
8882
|
+
style;
|
|
8883
|
+
colors;
|
|
8884
|
+
strokeColors;
|
|
8885
|
+
fontStyles;
|
|
8886
|
+
fontWeights;
|
|
8887
|
+
autoRound;
|
|
8888
|
+
useAdvancedWrap;
|
|
8889
|
+
_res;
|
|
8890
|
+
_text;
|
|
8891
|
+
_fontComponents;
|
|
8892
|
+
_lineSpacing;
|
|
8893
|
+
_charCount;
|
|
8894
|
+
dirty;
|
|
9162
8895
|
/**
|
|
9163
8896
|
* Creates a new Text object.
|
|
9164
8897
|
* @param {import('../core/game.js').Game} game - The game instance this text belongs to.
|
|
@@ -9832,12 +9565,10 @@ var Text = class extends Image$1 {
|
|
|
9832
9565
|
determineFontProperties(font) {
|
|
9833
9566
|
let properties = this.getFontPropertiesCache()[font];
|
|
9834
9567
|
if (properties) return properties;
|
|
9835
|
-
const METRICS_STRING = "|ÉqÅ";
|
|
9836
|
-
const BASELINE_SYMBOL = "M";
|
|
9837
9568
|
/** @type {CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D} */
|
|
9838
9569
|
const context = this.getFontPropertiesContext();
|
|
9839
9570
|
context.font = font;
|
|
9840
|
-
const metrics = context.measureText(
|
|
9571
|
+
const metrics = context.measureText("|ÉqÅM");
|
|
9841
9572
|
properties = {
|
|
9842
9573
|
ascent: Math.ceil(metrics.actualBoundingBoxAscent),
|
|
9843
9574
|
descent: Math.ceil(metrics.actualBoundingBoxDescent),
|
|
@@ -9988,7 +9719,7 @@ var Text = class extends Image$1 {
|
|
|
9988
9719
|
*/
|
|
9989
9720
|
set fontSize(value) {
|
|
9990
9721
|
let mutatedValue = value || "0";
|
|
9991
|
-
if (typeof mutatedValue === "number") mutatedValue
|
|
9722
|
+
if (typeof mutatedValue === "number") mutatedValue = `${mutatedValue}px`;
|
|
9992
9723
|
this._fontComponents.fontSize = mutatedValue;
|
|
9993
9724
|
this.updateFont(this._fontComponents);
|
|
9994
9725
|
}
|
|
@@ -12223,127 +11954,64 @@ var WebGLRenderer = class {
|
|
|
12223
11954
|
var FrameData = class {
|
|
12224
11955
|
_frames;
|
|
12225
11956
|
_frameNames;
|
|
12226
|
-
/**
|
|
12227
|
-
* Creates a new FrameData instance.
|
|
12228
|
-
* This class holds data about frames in a texture atlas or sprite sheet.
|
|
12229
|
-
*/
|
|
12230
11957
|
constructor() {
|
|
12231
|
-
/**
|
|
12232
|
-
* @type {import('./frame.js').Frame[]}
|
|
12233
|
-
*/
|
|
12234
11958
|
this._frames = [];
|
|
12235
|
-
|
|
12236
|
-
* @type {string[]}
|
|
12237
|
-
*/
|
|
12238
|
-
this._frameNames = [];
|
|
11959
|
+
this._frameNames = {};
|
|
12239
11960
|
}
|
|
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
11961
|
addFrame(frame) {
|
|
12246
11962
|
frame.index = this._frames.length;
|
|
12247
11963
|
this._frames.push(frame);
|
|
12248
11964
|
if (frame.name !== "") this._frameNames[frame.name] = frame.index;
|
|
12249
11965
|
return frame;
|
|
12250
11966
|
}
|
|
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
11967
|
getFrame(index = 0) {
|
|
12257
11968
|
if (index >= this._frames.length) index = 0;
|
|
12258
11969
|
return this._frames[index];
|
|
12259
11970
|
}
|
|
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
11971
|
getFrameByName(name) {
|
|
12266
11972
|
if (typeof this._frameNames[name] === "number") return this._frames[this._frameNames[name]];
|
|
12267
11973
|
return null;
|
|
12268
11974
|
}
|
|
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
11975
|
checkFrameName(name) {
|
|
12275
11976
|
if (this._frameNames[name] == null) return false;
|
|
12276
11977
|
return true;
|
|
12277
11978
|
}
|
|
12278
|
-
/**
|
|
12279
|
-
* Create a clone of this FrameData instance.
|
|
12280
|
-
* @returns {FrameData} A new FrameData instance with cloned frames.
|
|
12281
|
-
*/
|
|
12282
11979
|
clone() {
|
|
12283
11980
|
return cloneFrameData(this);
|
|
12284
11981
|
}
|
|
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
11982
|
getFrameRange(start, end, output = null) {
|
|
12293
11983
|
const result = output || [];
|
|
12294
11984
|
for (let i = start; i <= end; i += 1) result.push(this._frames[i]);
|
|
12295
11985
|
return result;
|
|
12296
11986
|
}
|
|
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
11987
|
getFrameIndexes(frames, useNumericIndex = true, output = null) {
|
|
12305
11988
|
const result = output || [];
|
|
12306
|
-
if (frames && frames.length > 0) {
|
|
12307
|
-
|
|
12308
|
-
|
|
12309
|
-
|
|
11989
|
+
if (frames && frames.length > 0) for (let i = 0; i < frames.length; i += 1) {
|
|
11990
|
+
const f = frames[i];
|
|
11991
|
+
if (useNumericIndex && this._frames[f]) result.push(this._frames[f].index);
|
|
11992
|
+
else {
|
|
11993
|
+
const found = this.getFrameByName(f);
|
|
11994
|
+
if (found) result.push(found.index);
|
|
11995
|
+
}
|
|
11996
|
+
}
|
|
11997
|
+
else for (let i = 0; i < this._frames.length; i += 1) result.push(this._frames[i].index);
|
|
12310
11998
|
return result;
|
|
12311
11999
|
}
|
|
12312
|
-
/**
|
|
12313
|
-
* Destroy this FrameData instance and clean up resources.
|
|
12314
|
-
* This method clears internal arrays and releases references to frames.
|
|
12315
|
-
*/
|
|
12316
12000
|
destroy() {
|
|
12317
12001
|
this._frames = null;
|
|
12318
12002
|
this._frameNames = null;
|
|
12319
12003
|
}
|
|
12320
|
-
/**
|
|
12321
|
-
* Get the total number of frames in this FrameData instance.
|
|
12322
|
-
* @returns {number} The total number of frames.
|
|
12323
|
-
*/
|
|
12324
12004
|
get total() {
|
|
12325
12005
|
return this._frames.length;
|
|
12326
12006
|
}
|
|
12327
12007
|
};
|
|
12328
12008
|
//#endregion
|
|
12329
12009
|
//#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
12010
|
const cloneFrame = (frame, output = null) => {
|
|
12337
12011
|
const result = output || new Frame(frame.index, frame.x, frame.y, frame.width, frame.height);
|
|
12338
12012
|
result.initialize(frame.index, frame.x, frame.y, frame.width, frame.height);
|
|
12339
12013
|
return result;
|
|
12340
12014
|
};
|
|
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
12015
|
const cloneFrameData = (frameData, output = null) => {
|
|
12348
12016
|
const result = output || new FrameData();
|
|
12349
12017
|
for (let i = 0; i < frameData.total; i += 1) result.addFrame(frameData.getFrame(i).clone());
|
|
@@ -12352,27 +12020,29 @@ const cloneFrameData = (frameData, output = null) => {
|
|
|
12352
12020
|
//#endregion
|
|
12353
12021
|
//#region src/phaser/core/frame.ts
|
|
12354
12022
|
var Frame = class {
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12023
|
+
index;
|
|
12024
|
+
x;
|
|
12025
|
+
y;
|
|
12026
|
+
width;
|
|
12027
|
+
height;
|
|
12028
|
+
name;
|
|
12029
|
+
centerX;
|
|
12030
|
+
centerY;
|
|
12031
|
+
distance;
|
|
12032
|
+
rotated;
|
|
12033
|
+
rotationDirection;
|
|
12034
|
+
trimmed;
|
|
12035
|
+
sourceSizeW;
|
|
12036
|
+
sourceSizeH;
|
|
12037
|
+
spriteSourceSizeX;
|
|
12038
|
+
spriteSourceSizeY;
|
|
12039
|
+
spriteSourceSizeW;
|
|
12040
|
+
spriteSourceSizeH;
|
|
12041
|
+
right;
|
|
12042
|
+
bottom;
|
|
12364
12043
|
constructor(index, x, y, width, height, name) {
|
|
12365
12044
|
this.initialize(index, x, y, width, height, name);
|
|
12366
12045
|
}
|
|
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
12046
|
initialize(index, x, y, width, height, name) {
|
|
12377
12047
|
this.index = index;
|
|
12378
12048
|
this.x = x;
|
|
@@ -12395,11 +12065,6 @@ var Frame = class {
|
|
|
12395
12065
|
this.right = this.x + this.width;
|
|
12396
12066
|
this.bottom = this.y + this.height;
|
|
12397
12067
|
}
|
|
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
12068
|
resize(width, height) {
|
|
12404
12069
|
this.width = width;
|
|
12405
12070
|
this.height = height;
|
|
@@ -12411,16 +12076,6 @@ var Frame = class {
|
|
|
12411
12076
|
this.right = this.x + width;
|
|
12412
12077
|
this.bottom = this.y + height;
|
|
12413
12078
|
}
|
|
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
12079
|
setTrim(trimmed, actualWidth, actualHeight, destX, destY, destWidth, destHeight) {
|
|
12425
12080
|
this.trimmed = trimmed;
|
|
12426
12081
|
if (trimmed) {
|
|
@@ -12434,18 +12089,9 @@ var Frame = class {
|
|
|
12434
12089
|
this.spriteSourceSizeH = destHeight;
|
|
12435
12090
|
}
|
|
12436
12091
|
}
|
|
12437
|
-
/**
|
|
12438
|
-
* Creates a clone of this frame.
|
|
12439
|
-
* @returns {Frame} A new Frame instance with the same properties.
|
|
12440
|
-
*/
|
|
12441
12092
|
clone() {
|
|
12442
12093
|
return cloneFrame(this);
|
|
12443
12094
|
}
|
|
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
12095
|
getRect(output = null) {
|
|
12450
12096
|
const result = output || new Rectangle();
|
|
12451
12097
|
result.setTo(this.x, this.y, this.width, this.height);
|
|
@@ -12460,7 +12106,7 @@ var Frame = class {
|
|
|
12460
12106
|
* @param {object} json - TBD.
|
|
12461
12107
|
* @returns {FrameData} TBD.
|
|
12462
12108
|
*/
|
|
12463
|
-
const JSONDataHash = (game, json) => {
|
|
12109
|
+
const JSONDataHash = (game, json, _key) => {
|
|
12464
12110
|
if (!json.frames) {
|
|
12465
12111
|
game.logger.warn("JSONDataHash: Invalid Texture Atlas JSON given, missing frames object", json);
|
|
12466
12112
|
return null;
|
|
@@ -13190,7 +12836,7 @@ var Cache = class {
|
|
|
13190
12836
|
* @param {object} data - The data to associate with the resolved URL.
|
|
13191
12837
|
* @returns {string} The resolved URL or null if not enabled.
|
|
13192
12838
|
*/
|
|
13193
|
-
_resolveURL(url, data) {
|
|
12839
|
+
_resolveURL(url, data = null) {
|
|
13194
12840
|
if (!this.autoResolveURL) return null;
|
|
13195
12841
|
this._urlResolver.src = this.game.load.baseURL + url;
|
|
13196
12842
|
this._urlTemp = this._urlResolver.src;
|
|
@@ -13674,6 +13320,31 @@ var ArraySet = class {
|
|
|
13674
13320
|
//#endregion
|
|
13675
13321
|
//#region src/phaser/core/input_mouse.ts
|
|
13676
13322
|
var Mouse = class {
|
|
13323
|
+
game;
|
|
13324
|
+
input;
|
|
13325
|
+
callbackContext;
|
|
13326
|
+
mouseDownCallback;
|
|
13327
|
+
mouseUpCallback;
|
|
13328
|
+
mouseOutCallback;
|
|
13329
|
+
mouseOverCallback;
|
|
13330
|
+
mouseWheelCallback;
|
|
13331
|
+
mouseMoveCallback;
|
|
13332
|
+
capture;
|
|
13333
|
+
button;
|
|
13334
|
+
wheelDelta;
|
|
13335
|
+
enabled;
|
|
13336
|
+
locked;
|
|
13337
|
+
stopOnGameOut;
|
|
13338
|
+
event;
|
|
13339
|
+
_onMouseDown;
|
|
13340
|
+
_onMouseMove;
|
|
13341
|
+
_onMouseUp;
|
|
13342
|
+
_onMouseOut;
|
|
13343
|
+
_onMouseOver;
|
|
13344
|
+
_onMouseWheel;
|
|
13345
|
+
_onMouseUpGlobal;
|
|
13346
|
+
_onMouseOutGlobal;
|
|
13347
|
+
_wheelEvent;
|
|
13677
13348
|
/**
|
|
13678
13349
|
* TBD.
|
|
13679
13350
|
* @param {import('./game.js').Game} game - TBD.
|
|
@@ -14503,6 +14174,7 @@ var Touch = class {
|
|
|
14503
14174
|
_onTouchEnter;
|
|
14504
14175
|
_onTouchLeave;
|
|
14505
14176
|
_onTouchCancel;
|
|
14177
|
+
_documentTouchMove;
|
|
14506
14178
|
/**
|
|
14507
14179
|
* TBD.
|
|
14508
14180
|
* @param {import('./game.js').Game} game - TBD.
|
|
@@ -14691,6 +14363,7 @@ var Input = class {
|
|
|
14691
14363
|
_localPoint;
|
|
14692
14364
|
_pollCounter;
|
|
14693
14365
|
_oldPosition;
|
|
14366
|
+
_onClickTrampoline;
|
|
14694
14367
|
_x;
|
|
14695
14368
|
_y;
|
|
14696
14369
|
/**
|
|
@@ -15542,7 +15215,7 @@ var Loader = class {
|
|
|
15542
15215
|
removeFile(type, key) {
|
|
15543
15216
|
const asset = this.getAsset(type, key);
|
|
15544
15217
|
if (asset) {
|
|
15545
|
-
if (!asset.loaded && !asset.loading) this._fileList.splice(asset.index, 1);
|
|
15218
|
+
if (!asset.file.loaded && !asset.file.loading) this._fileList.splice(asset.index, 1);
|
|
15546
15219
|
}
|
|
15547
15220
|
}
|
|
15548
15221
|
/**
|
|
@@ -15811,7 +15484,7 @@ var Loader = class {
|
|
|
15811
15484
|
return onload.call(scope, file, xhr);
|
|
15812
15485
|
} catch (error) {
|
|
15813
15486
|
const typedError = error instanceof Error ? error : new Error(String(error));
|
|
15814
|
-
if (!scope.hasLoaded) scope.asyncComplete(file,
|
|
15487
|
+
if (!scope.hasLoaded) scope.asyncComplete(file, typedError.message || "Exception");
|
|
15815
15488
|
else scope.game.logger.exception("Loader", typedError);
|
|
15816
15489
|
}
|
|
15817
15490
|
return null;
|
|
@@ -15825,7 +15498,7 @@ var Loader = class {
|
|
|
15825
15498
|
return onerror.call(scope, file, xhr);
|
|
15826
15499
|
} catch (error) {
|
|
15827
15500
|
const typedError = error instanceof Error ? error : new Error(String(error));
|
|
15828
|
-
if (!scope.hasLoaded) scope.asyncComplete(file,
|
|
15501
|
+
if (!scope.hasLoaded) scope.asyncComplete(file, typedError.message || "Exception");
|
|
15829
15502
|
else scope.game.logger.exception("Loader", typedError);
|
|
15830
15503
|
}
|
|
15831
15504
|
return null;
|
|
@@ -16424,6 +16097,10 @@ var ScaleManager = class {
|
|
|
16424
16097
|
_lastReportedCanvasSize;
|
|
16425
16098
|
_lastReportedGameSize;
|
|
16426
16099
|
_booted;
|
|
16100
|
+
_orientationChange;
|
|
16101
|
+
_windowResize;
|
|
16102
|
+
_fullScreenChange;
|
|
16103
|
+
_fullScreenError;
|
|
16427
16104
|
/**
|
|
16428
16105
|
* TBD.
|
|
16429
16106
|
* @param {import('./game.js').Game} game - TBD.
|
|
@@ -16995,7 +16672,7 @@ var ScaleManager = class {
|
|
|
16995
16672
|
if (!this.compatibility.supportsFullScreen) {
|
|
16996
16673
|
const scope = this;
|
|
16997
16674
|
setTimeout(() => {
|
|
16998
|
-
scope.fullScreenError();
|
|
16675
|
+
scope.fullScreenError({});
|
|
16999
16676
|
}, 10);
|
|
17000
16677
|
return false;
|
|
17001
16678
|
}
|
|
@@ -17288,6 +16965,7 @@ var SceneManager = class {
|
|
|
17288
16965
|
onResizeCallback;
|
|
17289
16966
|
onPauseUpdateCallback;
|
|
17290
16967
|
onShutDownCallback;
|
|
16968
|
+
callbackContext;
|
|
17291
16969
|
/**
|
|
17292
16970
|
* Creates a new SceneManager instance.
|
|
17293
16971
|
* @param {import('./game.js').Game} game - The game instance this manager belongs to.
|
|
@@ -17541,97 +17219,51 @@ var SceneManager = class {
|
|
|
17541
17219
|
//#region src/phaser/core/sound.ts
|
|
17542
17220
|
var Sound = class {
|
|
17543
17221
|
_paused;
|
|
17544
|
-
/** @type {import('./game.js').Game} */
|
|
17545
17222
|
game;
|
|
17546
|
-
/** @type {string} */
|
|
17547
17223
|
name;
|
|
17548
|
-
/** @type {string} */
|
|
17549
17224
|
key;
|
|
17550
|
-
/** @type {boolean} */
|
|
17551
17225
|
loop;
|
|
17552
|
-
/** @type {object} */
|
|
17553
17226
|
markers;
|
|
17554
|
-
/** @type {AudioContext} */
|
|
17555
17227
|
context;
|
|
17556
|
-
/** @type {boolean} */
|
|
17557
17228
|
autoplay;
|
|
17558
|
-
/** @type {number} */
|
|
17559
17229
|
totalDuration;
|
|
17560
|
-
/** @type {number} */
|
|
17561
17230
|
startTime;
|
|
17562
|
-
/** @type {number} */
|
|
17563
17231
|
currentTime;
|
|
17564
|
-
/** @type {number} */
|
|
17565
17232
|
duration;
|
|
17566
|
-
/** @type {number} */
|
|
17567
17233
|
durationMS;
|
|
17568
|
-
/** @type {number} */
|
|
17569
17234
|
position;
|
|
17570
|
-
/** @type {number} */
|
|
17571
17235
|
stopTime;
|
|
17572
|
-
/** @type {boolean} */
|
|
17573
17236
|
paused;
|
|
17574
|
-
/** @type {number} */
|
|
17575
17237
|
pausedPosition;
|
|
17576
|
-
/** @type {number} */
|
|
17577
17238
|
pausedTime;
|
|
17578
|
-
/** @type {boolean} */
|
|
17579
17239
|
isPlaying;
|
|
17580
|
-
/** @type {string} */
|
|
17581
17240
|
currentMarker;
|
|
17582
|
-
/** @type {import('./tween.js').Tween | null} */
|
|
17583
17241
|
fadeTween;
|
|
17584
|
-
/** @type {boolean} */
|
|
17585
17242
|
pendingPlayback;
|
|
17586
|
-
/** @type {boolean} */
|
|
17587
17243
|
override;
|
|
17588
|
-
/** @type {boolean} */
|
|
17589
17244
|
allowMultiple;
|
|
17590
|
-
/** @type {AudioNode | null} */
|
|
17591
17245
|
externalNode;
|
|
17592
|
-
/** @type {GainNode | null} */
|
|
17593
17246
|
masterGainNode;
|
|
17594
|
-
/** @type {GainNode | null} */
|
|
17595
17247
|
gainNode;
|
|
17596
|
-
/** @type {AudioBufferSourceNode | null} */
|
|
17597
17248
|
_sound;
|
|
17598
|
-
/** @type {boolean} */
|
|
17599
17249
|
_markedToDelete;
|
|
17600
|
-
/** @type {boolean} */
|
|
17601
17250
|
_removeFromSoundManager;
|
|
17602
|
-
/** @type {Signal} */
|
|
17603
17251
|
onPlay;
|
|
17604
|
-
/** @type {Signal} */
|
|
17605
17252
|
onPause;
|
|
17606
|
-
/** @type {Signal} */
|
|
17607
17253
|
onResume;
|
|
17608
|
-
/** @type {Signal} */
|
|
17609
17254
|
onLoop;
|
|
17610
|
-
/** @type {Signal} */
|
|
17611
17255
|
onStop;
|
|
17612
|
-
/** @type {Signal} */
|
|
17613
17256
|
onMute;
|
|
17614
|
-
/** @type {Signal} */
|
|
17615
17257
|
onMarkerComplete;
|
|
17616
|
-
/** @type {Signal} */
|
|
17617
17258
|
onFadeComplete;
|
|
17618
|
-
/** @type {number} */
|
|
17619
17259
|
_volume;
|
|
17620
|
-
/** @type {AudioBuffer | null} */
|
|
17621
17260
|
_buffer;
|
|
17622
|
-
/** @type {boolean} */
|
|
17623
17261
|
_muted;
|
|
17624
|
-
/** @type {string} */
|
|
17625
17262
|
_tempMarker;
|
|
17626
|
-
/** @type {number} */
|
|
17627
17263
|
_tempPosition;
|
|
17628
|
-
/** @type {number} */
|
|
17629
17264
|
_tempVolume;
|
|
17630
|
-
/** @type {number} */
|
|
17631
17265
|
_tempPause;
|
|
17632
|
-
/** @type {number} */
|
|
17633
17266
|
_muteVolume;
|
|
17634
|
-
/** @type {boolean} */
|
|
17635
17267
|
_tempLoop;
|
|
17636
17268
|
/**
|
|
17637
17269
|
* Creates a new Sound instance.
|
|
@@ -17811,7 +17443,7 @@ var Sound = class {
|
|
|
17811
17443
|
* @param {boolean} forceRestart - Whether to force restarting the sound even if it's already playing.
|
|
17812
17444
|
* @returns {Sound} This Sound instance for chaining.
|
|
17813
17445
|
*/
|
|
17814
|
-
play(marker, position, volume, loop, forceRestart = true) {
|
|
17446
|
+
play(marker = "", position = 0, volume = 1, loop = false, forceRestart = true) {
|
|
17815
17447
|
if (marker === void 0 || marker === false || marker === null) marker = "";
|
|
17816
17448
|
if (forceRestart === void 0) forceRestart = true;
|
|
17817
17449
|
if (this.isPlaying && !this.allowMultiple && !forceRestart && !this.override) return this;
|
|
@@ -18127,6 +17759,8 @@ var SoundManager = class {
|
|
|
18127
17759
|
_watching;
|
|
18128
17760
|
_watchCallback;
|
|
18129
17761
|
_watchContext;
|
|
17762
|
+
masterGain;
|
|
17763
|
+
_muteVolume;
|
|
18130
17764
|
/**
|
|
18131
17765
|
* Creates a new SoundManager instance.
|
|
18132
17766
|
* @param {import('./game.js').Game} game - Reference to the Phaser Game instance.
|
|
@@ -18186,7 +17820,7 @@ var SoundManager = class {
|
|
|
18186
17820
|
this.game.logger.exception("SoundManager", typedError);
|
|
18187
17821
|
}
|
|
18188
17822
|
if (!this.context) {
|
|
18189
|
-
this.game.logger.exception("SoundManager", new Error(ENGINE_ERROR_CREATING_AUDIO_CONTEXT));
|
|
17823
|
+
this.game.logger.exception("SoundManager", /* @__PURE__ */ new Error(ENGINE_ERROR_CREATING_AUDIO_CONTEXT));
|
|
18190
17824
|
setAudioDisabledState();
|
|
18191
17825
|
return;
|
|
18192
17826
|
}
|
|
@@ -18521,8 +18155,6 @@ var SoundManager = class {
|
|
|
18521
18155
|
//#endregion
|
|
18522
18156
|
//#region src/phaser/core/stage.ts
|
|
18523
18157
|
var Stage = class extends DisplayObject {
|
|
18524
|
-
name;
|
|
18525
|
-
worldTransform;
|
|
18526
18158
|
currentRenderOrderID;
|
|
18527
18159
|
_bgColor;
|
|
18528
18160
|
/**
|
|
@@ -18594,6 +18226,7 @@ var Stage = class extends DisplayObject {
|
|
|
18594
18226
|
updateTransform() {
|
|
18595
18227
|
this.worldAlpha = 1;
|
|
18596
18228
|
for (let i = 0; i < this.children.length; i += 1) this.children[i].updateTransform();
|
|
18229
|
+
return this;
|
|
18597
18230
|
}
|
|
18598
18231
|
/**
|
|
18599
18232
|
* Destroys the stage and cleans up resources.
|
|
@@ -18643,17 +18276,6 @@ var TimerEvent = class {
|
|
|
18643
18276
|
callbackContext;
|
|
18644
18277
|
args;
|
|
18645
18278
|
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
18279
|
constructor(timer, delay, tick, repeatCount, loop, callback, callbackContext, args) {
|
|
18658
18280
|
this.timer = timer;
|
|
18659
18281
|
this.delay = delay;
|
|
@@ -18745,7 +18367,7 @@ var Timer = class {
|
|
|
18745
18367
|
* @param {...any} args - Arguments to pass to the callback function.
|
|
18746
18368
|
* @returns {TimerEvent} The created TimerEvent.
|
|
18747
18369
|
*/
|
|
18748
|
-
create(delay, loop, repeatCount, callback, callbackContext = null, args) {
|
|
18370
|
+
create(delay, loop, repeatCount, callback, callbackContext = null, args = []) {
|
|
18749
18371
|
const roundedDelay = Math.round(delay);
|
|
18750
18372
|
let tick = roundedDelay;
|
|
18751
18373
|
if (this._now === 0) tick += this.game.time.time;
|
|
@@ -19300,6 +18922,7 @@ var TweenData = class {
|
|
|
19300
18922
|
interpolationContext;
|
|
19301
18923
|
isRunning;
|
|
19302
18924
|
isFrom;
|
|
18925
|
+
yoyoCounter;
|
|
19303
18926
|
/**
|
|
19304
18927
|
* Creates a new TweenData instance.
|
|
19305
18928
|
* @param {import('./tween.js').Tween} parent - The parent Tween instance.
|
|
@@ -19530,51 +19153,28 @@ var TweenData = class {
|
|
|
19530
19153
|
//#endregion
|
|
19531
19154
|
//#region src/phaser/core/tween.ts
|
|
19532
19155
|
var Tween = class {
|
|
19533
|
-
/** @type {import('./game.js').Game} */
|
|
19534
19156
|
game;
|
|
19535
|
-
/** @type {import('../display/display_object.js').DisplayObject} */
|
|
19536
19157
|
target;
|
|
19537
|
-
/** @type {import('./tween_manager.js').TweenManager} */
|
|
19538
19158
|
manager;
|
|
19539
|
-
/** @type {TweenData[]} */
|
|
19540
19159
|
timeline;
|
|
19541
|
-
/** @type {boolean} */
|
|
19542
19160
|
reverse;
|
|
19543
|
-
/** @type {number} */
|
|
19544
19161
|
timeScale;
|
|
19545
|
-
/** @type {number} */
|
|
19546
19162
|
repeatCounter;
|
|
19547
|
-
/** @type {boolean} */
|
|
19548
19163
|
pendingDelete;
|
|
19549
|
-
/** @type {Signal} */
|
|
19550
19164
|
onStart;
|
|
19551
|
-
/** @type {Signal} */
|
|
19552
19165
|
onLoop;
|
|
19553
|
-
/** @type {Signal} */
|
|
19554
19166
|
onRepeat;
|
|
19555
|
-
/** @type {Signal} */
|
|
19556
19167
|
onChildComplete;
|
|
19557
|
-
/** @type {Signal} */
|
|
19558
19168
|
onComplete;
|
|
19559
|
-
/** @type {boolean} */
|
|
19560
19169
|
isRunning;
|
|
19561
|
-
/** @type {number} */
|
|
19562
19170
|
current;
|
|
19563
|
-
/** @type {object} */
|
|
19564
19171
|
properties;
|
|
19565
|
-
/** @type {Tween | null} */
|
|
19566
19172
|
chainedTween;
|
|
19567
|
-
/** @type {boolean} */
|
|
19568
19173
|
isPaused;
|
|
19569
|
-
/** @type {Function | null} */
|
|
19570
19174
|
_onUpdateCallback;
|
|
19571
|
-
/** @type {object | null} */
|
|
19572
19175
|
_onUpdateCallbackContext;
|
|
19573
|
-
/** @type {number} */
|
|
19574
19176
|
_pausedTime;
|
|
19575
|
-
/** @type {boolean} */
|
|
19576
19177
|
_codePaused;
|
|
19577
|
-
/** @type {boolean} */
|
|
19578
19178
|
_hasStarted;
|
|
19579
19179
|
/**
|
|
19580
19180
|
* Creates a new Tween instance.
|
|
@@ -20201,8 +19801,7 @@ const ElasticInOut = (k) => {
|
|
|
20201
19801
|
* @returns {number} TBD.
|
|
20202
19802
|
*/
|
|
20203
19803
|
const BackIn = (k) => {
|
|
20204
|
-
|
|
20205
|
-
return k * k * ((s + 1) * k - s);
|
|
19804
|
+
return k * k * (2.70158 * k - 1.70158);
|
|
20206
19805
|
};
|
|
20207
19806
|
/**
|
|
20208
19807
|
* TBD.
|
|
@@ -20210,8 +19809,7 @@ const BackIn = (k) => {
|
|
|
20210
19809
|
* @returns {number} TBD.
|
|
20211
19810
|
*/
|
|
20212
19811
|
const BackOut = (k) => {
|
|
20213
|
-
|
|
20214
|
-
return --k * k * ((s + 1) * k + s) + 1;
|
|
19812
|
+
return --k * k * (2.70158 * k + 1.70158) + 1;
|
|
20215
19813
|
};
|
|
20216
19814
|
/**
|
|
20217
19815
|
* TBD.
|
|
@@ -20220,8 +19818,8 @@ const BackOut = (k) => {
|
|
|
20220
19818
|
*/
|
|
20221
19819
|
const BackInOut = (k) => {
|
|
20222
19820
|
const s = 1.70158 * 1.525;
|
|
20223
|
-
if ((k *= 2) < 1) return .5 * (k * k * (
|
|
20224
|
-
return .5 * ((k -= 2) * k * (
|
|
19821
|
+
if ((k *= 2) < 1) return .5 * (k * k * (3.5949095 * k - s));
|
|
19822
|
+
return .5 * ((k -= 2) * k * (3.5949095 * k + s) + 2);
|
|
20225
19823
|
};
|
|
20226
19824
|
/**
|
|
20227
19825
|
* TBD.
|
|
@@ -20451,62 +20049,36 @@ var World = class extends Group {
|
|
|
20451
20049
|
//#endregion
|
|
20452
20050
|
//#region src/phaser/core/game.ts
|
|
20453
20051
|
var Game = class {
|
|
20454
|
-
/** @type {object} */
|
|
20455
20052
|
config;
|
|
20456
|
-
/** @type {number} */
|
|
20457
20053
|
id;
|
|
20458
|
-
/** @type {string|HTMLElement} */
|
|
20459
20054
|
parent;
|
|
20460
|
-
/** @type {number} */
|
|
20461
20055
|
width;
|
|
20462
|
-
/** @type {number} */
|
|
20463
20056
|
height;
|
|
20464
|
-
/** @type {CanvasRenderer | WebGLRenderer} */
|
|
20465
20057
|
renderer;
|
|
20466
|
-
/** @type {SceneManager} */
|
|
20467
20058
|
state;
|
|
20468
|
-
/** @type {boolean} */
|
|
20469
20059
|
isBooted;
|
|
20470
|
-
/** @type {boolean} */
|
|
20471
20060
|
paused;
|
|
20472
|
-
/** @type {RequestAnimationFrame} */
|
|
20473
20061
|
raf;
|
|
20474
|
-
/** @type {GameObjectFactory} */
|
|
20475
20062
|
add;
|
|
20476
|
-
/** @type {Cache} */
|
|
20477
20063
|
cache;
|
|
20478
|
-
/** @type {Input} */
|
|
20479
20064
|
input;
|
|
20480
|
-
/** @type {Loader} */
|
|
20481
20065
|
load;
|
|
20482
|
-
/** @type {ScaleManager} */
|
|
20483
20066
|
scale;
|
|
20484
|
-
/** @type {SoundManager} */
|
|
20485
20067
|
sound;
|
|
20486
|
-
/** @type {Stage} */
|
|
20487
20068
|
stage;
|
|
20488
|
-
/** @type {Time} */
|
|
20489
20069
|
time;
|
|
20490
|
-
/** @type {TweenManager} */
|
|
20491
20070
|
tweens;
|
|
20492
|
-
/** @type {World} */
|
|
20493
20071
|
world;
|
|
20494
|
-
/** @type {Device} */
|
|
20495
20072
|
device;
|
|
20496
|
-
/** @type {Logger} */
|
|
20497
20073
|
logger;
|
|
20498
|
-
/** @type {HTMLCanvasElement} */
|
|
20499
20074
|
canvas;
|
|
20500
|
-
/** @type {CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext} */
|
|
20501
20075
|
context;
|
|
20502
|
-
/** @type {Signal} */
|
|
20503
20076
|
onPause;
|
|
20504
|
-
/** @type {Signal} */
|
|
20505
20077
|
onResume;
|
|
20506
|
-
/** @type {Signal} */
|
|
20507
20078
|
onBoot;
|
|
20508
|
-
/** @type {boolean} */
|
|
20509
20079
|
isPaused;
|
|
20080
|
+
contextLostBinded;
|
|
20081
|
+
contextRestoredBinded;
|
|
20510
20082
|
/**
|
|
20511
20083
|
* Creates a new Game instance.
|
|
20512
20084
|
* @param {object} gameConfig - The configuration object for the game.
|
|
@@ -21124,6 +20696,6 @@ var Line = class {
|
|
|
21124
20696
|
}
|
|
21125
20697
|
};
|
|
21126
20698
|
//#endregion
|
|
21127
|
-
export { Animation, AnimationManager, BaseTexture, BitmapText, Button, Circle, const_exports as Const, DisplayObject, ENGINE_ERROR_CANNOT_SET_FRAME, ENGINE_ERROR_CANNOT_SET_FRAME_NAME, ENGINE_ERROR_CREATING_AUDIO_CONTEXT, ENGINE_ERROR_CREATING_CANVAS_2D_CONTEXT, ENGINE_ERROR_CREATING_WEBGL_CONTEXT, ENGINE_ERROR_GETTING_DOCUMENT, ENGINE_ERROR_INVALID_BITMAP_FONT_ATLAS, ENGINE_ERROR_WEBGL_CONTEXT_LOST, Ellipse, Game, GameObjectFactory, Graphics, Group, Image$1 as Image, Line, math_exports as MathUtils, Matrix, Point, Polygon, Rectangle, RoundedRectangle, ScaleManager, Scene, SceneManager, Signal, Sound, SoundManager, SoundSprite, Text, Texture, Time, Timer, TimerEvent, Tween, TweenData, TweenManager };
|
|
20699
|
+
export { Animation, AnimationManager, BaseTexture, BitmapText, Button, Cache, Circle, const_exports as Const, DisplayObject, ENGINE_ERROR_CANNOT_SET_FRAME, ENGINE_ERROR_CANNOT_SET_FRAME_NAME, ENGINE_ERROR_CREATING_AUDIO_CONTEXT, ENGINE_ERROR_CREATING_CANVAS_2D_CONTEXT, ENGINE_ERROR_CREATING_WEBGL_CONTEXT, ENGINE_ERROR_GETTING_DOCUMENT, ENGINE_ERROR_INVALID_BITMAP_FONT_ATLAS, ENGINE_ERROR_WEBGL_CONTEXT_LOST, Ellipse, Game, GameObjectFactory, Graphics, Group, Image$1 as Image, Input, Line, Loader, math_exports as MathUtils, Matrix, Point, Pointer, Polygon, Rectangle, RoundedRectangle, ScaleManager, Scene, SceneManager, Signal, Sound, SoundManager, SoundSprite, Text, Texture, Time, Timer, TimerEvent, Tween, TweenData, TweenManager };
|
|
21128
20700
|
|
|
21129
20701
|
//# sourceMappingURL=index.js.map
|