@vpmedia/phaser 1.105.0 → 1.107.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 +238 -244
- package/dist/index.js.map +1 -1
- package/dist/phaser/core/animation.d.ts +2 -2
- package/dist/phaser/core/animation.d.ts.map +1 -1
- package/dist/phaser/core/animation_manager.d.ts +2 -2
- 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.map +1 -1
- package/dist/phaser/core/cache.d.ts +6 -6
- 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.map +1 -1
- package/dist/phaser/core/dom.d.ts +2 -2
- package/dist/phaser/core/dom.d.ts.map +1 -1
- package/dist/phaser/core/event_manager.d.ts.map +1 -1
- package/dist/phaser/core/factory.d.ts +1 -1
- package/dist/phaser/core/factory.d.ts.map +1 -1
- package/dist/phaser/core/frame.d.ts.map +1 -1
- package/dist/phaser/core/frame_data.d.ts.map +1 -1
- package/dist/phaser/core/frame_util.d.ts.map +1 -1
- package/dist/phaser/core/game.d.ts +1 -1
- package/dist/phaser/core/game.d.ts.map +1 -1
- package/dist/phaser/core/input.d.ts +3 -3
- package/dist/phaser/core/input.d.ts.map +1 -1
- package/dist/phaser/core/input_handler.d.ts +8 -8
- package/dist/phaser/core/input_handler.d.ts.map +1 -1
- package/dist/phaser/core/input_mouse.d.ts +8 -8
- package/dist/phaser/core/input_mouse.d.ts.map +1 -1
- package/dist/phaser/core/input_mspointer.d.ts +6 -6
- package/dist/phaser/core/input_mspointer.d.ts.map +1 -1
- package/dist/phaser/core/input_pointer.d.ts +3 -3
- package/dist/phaser/core/input_pointer.d.ts.map +1 -1
- package/dist/phaser/core/input_touch.d.ts +7 -7
- package/dist/phaser/core/input_touch.d.ts.map +1 -1
- package/dist/phaser/core/loader.d.ts +16 -6
- 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.map +1 -1
- package/dist/phaser/core/scale_manager.d.ts +5 -5
- package/dist/phaser/core/scale_manager.d.ts.map +1 -1
- package/dist/phaser/core/scene.d.ts +3 -3
- package/dist/phaser/core/scene.d.ts.map +1 -1
- package/dist/phaser/core/scene_manager.d.ts.map +1 -1
- package/dist/phaser/core/signal.d.ts +7 -7
- package/dist/phaser/core/signal.d.ts.map +1 -1
- package/dist/phaser/core/signal_binding.d.ts +1 -1
- package/dist/phaser/core/signal_binding.d.ts.map +1 -1
- package/dist/phaser/core/sound.d.ts +3 -3
- package/dist/phaser/core/sound.d.ts.map +1 -1
- package/dist/phaser/core/sound_manager.d.ts +1 -1
- package/dist/phaser/core/sound_manager.d.ts.map +1 -1
- package/dist/phaser/core/sound_sprite.d.ts.map +1 -1
- package/dist/phaser/core/stage.d.ts.map +1 -1
- package/dist/phaser/core/time.d.ts.map +1 -1
- package/dist/phaser/core/timer.d.ts +5 -5
- package/dist/phaser/core/timer.d.ts.map +1 -1
- package/dist/phaser/core/timer_event.d.ts.map +1 -1
- package/dist/phaser/core/tween.d.ts +1 -1
- package/dist/phaser/core/tween.d.ts.map +1 -1
- package/dist/phaser/core/tween_data.d.ts +1 -1
- package/dist/phaser/core/tween_data.d.ts.map +1 -1
- package/dist/phaser/core/tween_easing.d.ts.map +1 -1
- package/dist/phaser/core/tween_manager.d.ts +1 -1
- package/dist/phaser/core/tween_manager.d.ts.map +1 -1
- package/dist/phaser/core/world.d.ts.map +1 -1
- package/dist/phaser/display/bitmap_text.d.ts +3 -3
- package/dist/phaser/display/bitmap_text.d.ts.map +1 -1
- package/dist/phaser/display/button.d.ts +12 -11
- package/dist/phaser/display/button.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/phaser/display/canvas/renderer.d.ts +2 -2
- package/dist/phaser/display/canvas/renderer.d.ts.map +1 -1
- package/dist/phaser/display/canvas/tinter.d.ts +1 -1
- package/dist/phaser/display/canvas/tinter.d.ts.map +1 -1
- package/dist/phaser/display/canvas/util.d.ts +1 -1
- package/dist/phaser/display/canvas/util.d.ts.map +1 -1
- package/dist/phaser/display/display_object.d.ts +12 -21
- package/dist/phaser/display/display_object.d.ts.map +1 -1
- package/dist/phaser/display/graphics.d.ts +1 -1
- package/dist/phaser/display/graphics.d.ts.map +1 -1
- package/dist/phaser/display/graphics_data.d.ts.map +1 -1
- package/dist/phaser/display/graphics_data_util.d.ts.map +1 -1
- package/dist/phaser/display/group.d.ts +3 -3
- package/dist/phaser/display/group.d.ts.map +1 -1
- package/dist/phaser/display/image.d.ts +8 -8
- package/dist/phaser/display/image.d.ts.map +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 +8 -7
- package/dist/phaser/display/text.d.ts.map +1 -1
- package/dist/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
- package/dist/phaser/display/webgl/base_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/blend_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/earcut.d.ts +5 -5
- package/dist/phaser/display/webgl/earcut.d.ts.map +1 -1
- package/dist/phaser/display/webgl/earcut_node.d.ts.map +1 -1
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts +3 -2
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/webgl/filter_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/filter_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/graphics.d.ts +4 -3
- package/dist/phaser/display/webgl/graphics.d.ts.map +1 -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 -2
- package/dist/phaser/display/webgl/render_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/renderer.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/complex.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/fast.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/normal.d.ts +1 -1
- package/dist/phaser/display/webgl/shader/normal.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/strip.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader_manager.d.ts +2 -1
- package/dist/phaser/display/webgl/shader_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/sprite_batch.d.ts +2 -1
- package/dist/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/texture_util.d.ts.map +1 -1
- package/dist/phaser/display/webgl/util.d.ts +8 -4
- package/dist/phaser/display/webgl/util.d.ts.map +1 -1
- package/dist/phaser/geom/circle.d.ts +1 -1
- package/dist/phaser/geom/circle.d.ts.map +1 -1
- package/dist/phaser/geom/ellipse.d.ts +1 -1
- package/dist/phaser/geom/ellipse.d.ts.map +1 -1
- package/dist/phaser/geom/line.d.ts +3 -3
- package/dist/phaser/geom/line.d.ts.map +1 -1
- package/dist/phaser/geom/matrix.d.ts +3 -3
- package/dist/phaser/geom/matrix.d.ts.map +1 -1
- package/dist/phaser/geom/point.d.ts.map +1 -1
- package/dist/phaser/geom/polygon.d.ts +1 -1
- package/dist/phaser/geom/polygon.d.ts.map +1 -1
- package/dist/phaser/geom/rectangle.d.ts +2 -2
- package/dist/phaser/geom/rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/rounded_rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/util/circle.d.ts +3 -3
- 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 +3 -3
- package/dist/phaser/geom/util/line.d.ts.map +1 -1
- package/dist/phaser/geom/util/matrix.d.ts +1 -1
- package/dist/phaser/geom/util/matrix.d.ts.map +1 -1
- package/dist/phaser/geom/util/point.d.ts +15 -15
- package/dist/phaser/geom/util/point.d.ts.map +1 -1
- package/dist/phaser/geom/util/polygon.d.ts +1 -1
- package/dist/phaser/geom/util/polygon.d.ts.map +1 -1
- package/dist/phaser/geom/util/rectangle.d.ts +5 -5
- package/dist/phaser/geom/util/rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/util/rounded_rectangle.d.ts +1 -1
- package/dist/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
- package/dist/phaser/util/math.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/index.ts +8 -0
- package/src/phaser/core/animation.ts +16 -8
- package/src/phaser/core/animation_manager.ts +11 -5
- package/src/phaser/core/cache.ts +9 -8
- package/src/phaser/core/device.ts +24 -24
- package/src/phaser/core/device_util.ts +4 -2
- package/src/phaser/core/dom.ts +2 -2
- package/src/phaser/core/factory.ts +3 -5
- package/src/phaser/core/game.ts +21 -34
- package/src/phaser/core/input.ts +9 -5
- package/src/phaser/core/input_handler.ts +22 -7
- package/src/phaser/core/input_mouse.ts +8 -84
- package/src/phaser/core/input_mspointer.ts +22 -18
- package/src/phaser/core/input_pointer.ts +48 -48
- package/src/phaser/core/input_touch.ts +7 -7
- package/src/phaser/core/loader.ts +46 -31
- package/src/phaser/core/loader_parser.ts +34 -8
- package/src/phaser/core/scale_manager.ts +5 -5
- package/src/phaser/core/scene.ts +5 -5
- package/src/phaser/core/signal.ts +15 -9
- package/src/phaser/core/signal_binding.ts +8 -1
- package/src/phaser/core/sound.ts +18 -21
- package/src/phaser/core/sound_manager.ts +3 -3
- package/src/phaser/core/sound_sprite.ts +7 -7
- package/src/phaser/core/stage.ts +6 -6
- package/src/phaser/core/time.ts +28 -28
- package/src/phaser/core/timer.ts +4 -4
- package/src/phaser/core/tween.ts +31 -9
- package/src/phaser/core/tween_data.ts +2 -2
- package/src/phaser/core/tween_manager.ts +7 -7
- package/src/phaser/display/bitmap_text.ts +6 -6
- package/src/phaser/display/button.ts +38 -19
- package/src/phaser/display/canvas/buffer.ts +4 -4
- package/src/phaser/display/canvas/renderer.ts +2 -2
- package/src/phaser/display/canvas/util.ts +21 -13
- package/src/phaser/display/display_object.ts +17 -31
- package/src/phaser/display/graphics.ts +9 -9
- package/src/phaser/display/graphics_data.ts +19 -11
- package/src/phaser/display/group.ts +8 -8
- package/src/phaser/display/image.ts +26 -20
- package/src/phaser/display/sprite_util.ts +16 -4
- package/src/phaser/display/text.ts +9 -9
- package/src/phaser/display/webgl/blend_manager.ts +2 -2
- package/src/phaser/display/webgl/earcut.ts +31 -6
- package/src/phaser/display/webgl/fast_sprite_batch.ts +19 -17
- package/src/phaser/display/webgl/filter_manager.ts +3 -3
- package/src/phaser/display/webgl/filter_texture.ts +4 -4
- package/src/phaser/display/webgl/graphics.ts +11 -3
- package/src/phaser/display/webgl/graphics_data.ts +9 -9
- package/src/phaser/display/webgl/render_texture.ts +9 -3
- package/src/phaser/display/webgl/shader/complex.ts +5 -5
- package/src/phaser/display/webgl/shader/fast.ts +6 -6
- package/src/phaser/display/webgl/shader/normal.ts +11 -11
- package/src/phaser/display/webgl/shader/primitive.ts +5 -5
- package/src/phaser/display/webgl/shader/strip.ts +5 -5
- package/src/phaser/display/webgl/shader_manager.ts +12 -11
- package/src/phaser/display/webgl/sprite_batch.ts +18 -17
- package/src/phaser/display/webgl/stencil_manager.ts +18 -6
- package/src/phaser/display/webgl/texture.ts +6 -1
- package/src/phaser/display/webgl/util.ts +17 -4
- package/src/phaser/geom/circle.ts +1 -1
- package/src/phaser/geom/ellipse.ts +1 -1
- package/src/phaser/geom/line.ts +2 -2
- package/src/phaser/geom/matrix.ts +3 -3
- package/src/phaser/geom/polygon.ts +1 -1
- package/src/phaser/geom/rectangle.ts +2 -2
- package/src/phaser/geom/util/circle.ts +8 -3
- package/src/phaser/geom/util/line.ts +9 -2
- package/src/phaser/geom/util/matrix.ts +1 -1
- package/src/phaser/geom/util/point.ts +23 -16
- package/src/phaser/geom/util/polygon.ts +1 -1
- package/src/phaser/geom/util/rectangle.ts +13 -6
- package/src/phaser/geom/util/rounded_rectangle.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circle.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/circle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"circle.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/circle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,UAAW,MAAM,WAAU,MAAM,GAAG,IAAI,WAMzD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,MAAO,MAAM,KAAK,MAAM,KAAK,MAAM,YAOvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM,MAAO,MAAM,KAAK,MAAM,YAE1C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,MAAO,MAAM,KAAK,MAAM,YAE9C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,MAC1B,MAAM,SACF,MAAM,cACF,OAAO,WACV,KAAK,GAAG,IAAI,UASrB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,MAAO,MAAM,SAAS,MAAM,cAAa,OAAO,WAAkB,KAAK,GAAG,IAAI,UAQzG,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,MAAO,MAAM,KAAK,GAAG,YAoBpD,CAAC"}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* @param {number} y - The y coordinate of the point.
|
|
6
6
|
* @returns {boolean} True if the point is contained within the ellipse, false otherwise.
|
|
7
7
|
*/
|
|
8
|
-
export declare const contains: (a: import(
|
|
8
|
+
export declare const contains: (a: import('../ellipse.js').Ellipse, x: number, y: number) => boolean;
|
|
9
9
|
//# sourceMappingURL=ellipse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ellipse.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/ellipse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"ellipse.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/ellipse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,MAAO,OAAO,eAAe,EAAE,OAAO,KAAK,MAAM,KAAK,MAAM,YAUhF,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { Point } from '../point.js';
|
|
|
6
6
|
* @param {Line} output - Optional line to store the result in.
|
|
7
7
|
* @returns {Line} The cloned line.
|
|
8
8
|
*/
|
|
9
|
-
export declare const clone: (input: Line, output?: Line) => Line;
|
|
9
|
+
export declare const clone: (input: Line, output?: Line | null) => Line;
|
|
10
10
|
/**
|
|
11
11
|
* Gets the intersection point of two lines.
|
|
12
12
|
* @param {object} a - The first line (with x1, y1, x2, y2 properties).
|
|
@@ -17,7 +17,7 @@ export declare const clone: (input: Line, output?: Line) => Line;
|
|
|
17
17
|
* @param {Point} output - Optional point to store the result in.
|
|
18
18
|
* @returns {Point} The intersection point, or null if there is no intersection.
|
|
19
19
|
*/
|
|
20
|
-
export declare const intersectsPoints: (a: any, b: any, e: any, f: any, asSegment?: boolean, output?: Point) => Point;
|
|
20
|
+
export declare const intersectsPoints: (a: any, b: any, e: any, f: any, asSegment?: boolean, output?: Point | null) => Point | null;
|
|
21
21
|
/**
|
|
22
22
|
* Gets the intersection point of two lines (alternative implementation).
|
|
23
23
|
* @param {object} a - The first line (with x1, y1, x2, y2 properties).
|
|
@@ -26,7 +26,7 @@ export declare const intersectsPoints: (a: any, b: any, e: any, f: any, asSegmen
|
|
|
26
26
|
* @param {Point} result - Optional point to store the result in.
|
|
27
27
|
* @returns {Point} The intersection point, or null if there is no intersection.
|
|
28
28
|
*/
|
|
29
|
-
export declare const intersects: (a: any, b: any, asSegment: boolean, result: Point) => Point;
|
|
29
|
+
export declare const intersects: (a: any, b: any, asSegment: boolean, result: Point) => Point | null;
|
|
30
30
|
/**
|
|
31
31
|
* Checks if a line intersects with a rectangle.
|
|
32
32
|
* @param {object} line - The line to check (with x1, y1, x2, y2 properties).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,UAAW,IAAI,WAAU,IAAI,GAAG,IAAI,SAOrD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,MACxB,GAAG,KACH,GAAG,KACH,GAAG,KACH,GAAG,cACK,OAAO,WACV,KAAK,GAAG,IAAI,iBAyBrB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,MAAO,GAAG,KAAK,GAAG,aAAa,OAAO,UAAU,KAAK,iBAE3E,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,SAAU,GAAG,QAAQ,GAAG,YA8CvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,OAAO,MAAO,GAAG,KAAK,GAAG,WAErC,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { Matrix } from '../matrix.js';
|
|
|
5
5
|
* @param {Matrix} output - Optional matrix to store the result in.
|
|
6
6
|
* @returns {Matrix} The cloned matrix.
|
|
7
7
|
*/
|
|
8
|
-
export declare const clone: (input: Matrix, output?: Matrix) => Matrix;
|
|
8
|
+
export declare const clone: (input: Matrix, output?: Matrix | null) => Matrix;
|
|
9
9
|
/**
|
|
10
10
|
* Creates a new identity matrix.
|
|
11
11
|
* @returns {Matrix} A new identity matrix.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/matrix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/matrix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,UAAW,MAAM,WAAU,MAAM,GAAG,IAAI,WASzD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WAQ7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,WAQzB,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { Point } from '../point.js';
|
|
|
6
6
|
* @param {Point} output - The point to store the result in (optional).
|
|
7
7
|
* @returns {Point} A new point containing the sum of the two points.
|
|
8
8
|
*/
|
|
9
|
-
export declare const add: (a: Point, b: Point, output?: Point) => Point;
|
|
9
|
+
export declare const add: (a: Point, b: Point, output?: Point | null) => Point;
|
|
10
10
|
/**
|
|
11
11
|
* Subtracts the second point from the first point.
|
|
12
12
|
* @param {Point} a - The first point to subtract from.
|
|
@@ -14,7 +14,7 @@ export declare const add: (a: Point, b: Point, output?: Point) => Point;
|
|
|
14
14
|
* @param {Point} output - The point to store the result in (optional).
|
|
15
15
|
* @returns {Point} A new point containing the difference of the two points.
|
|
16
16
|
*/
|
|
17
|
-
export declare const subtract: (a: Point, b: Point, output?: Point) => Point;
|
|
17
|
+
export declare const subtract: (a: Point, b: Point, output?: Point | null) => Point;
|
|
18
18
|
/**
|
|
19
19
|
* Multiplies two points together.
|
|
20
20
|
* @param {Point} a - The first point to multiply.
|
|
@@ -22,7 +22,7 @@ export declare const subtract: (a: Point, b: Point, output?: Point) => Point;
|
|
|
22
22
|
* @param {Point} output - The point to store the result in (optional).
|
|
23
23
|
* @returns {Point} A new point containing the product of the two points.
|
|
24
24
|
*/
|
|
25
|
-
export declare const multiply: (a: Point, b: Point, output?: Point) => Point;
|
|
25
|
+
export declare const multiply: (a: Point, b: Point, output?: Point | null) => Point;
|
|
26
26
|
/**
|
|
27
27
|
* Divides the first point by the second point.
|
|
28
28
|
* @param {Point} a - The first point to divide.
|
|
@@ -30,7 +30,7 @@ export declare const multiply: (a: Point, b: Point, output?: Point) => Point;
|
|
|
30
30
|
* @param {Point} output - The point to store the result in (optional).
|
|
31
31
|
* @returns {Point} A new point containing the quotient of the two points.
|
|
32
32
|
*/
|
|
33
|
-
export declare const divide: (a: Point, b: Point, output?: Point) => Point;
|
|
33
|
+
export declare const divide: (a: Point, b: Point, output?: Point | null) => Point;
|
|
34
34
|
/**
|
|
35
35
|
* Checks if two points are equal.
|
|
36
36
|
* @param {Point} a - The first point to compare.
|
|
@@ -51,7 +51,7 @@ export declare const angle: (a: Point, b: Point) => number;
|
|
|
51
51
|
* @param {Point} output - The point to store the result in (optional).
|
|
52
52
|
* @returns {Point} A new point with negated coordinates.
|
|
53
53
|
*/
|
|
54
|
-
export declare const negative: (a: Point, output?: Point) => Point;
|
|
54
|
+
export declare const negative: (a: Point, output?: Point | null) => Point;
|
|
55
55
|
/**
|
|
56
56
|
* Multiplies the second point by a scalar and adds it to the first point.
|
|
57
57
|
* @param {Point} a - The first point to add to.
|
|
@@ -60,7 +60,7 @@ export declare const negative: (a: Point, output?: Point) => Point;
|
|
|
60
60
|
* @param {Point} output - The point to store the result in (optional).
|
|
61
61
|
* @returns {Point} A new point with the result of the operation.
|
|
62
62
|
*/
|
|
63
|
-
export declare const multiplyAdd: (a: Point, b: Point, s: number, output?: Point) => Point;
|
|
63
|
+
export declare const multiplyAdd: (a: Point, b: Point, s: number, output?: Point | null) => Point;
|
|
64
64
|
/**
|
|
65
65
|
* Interpolates between two points at a given factor.
|
|
66
66
|
* @param {Point} a - The first point to interpolate from.
|
|
@@ -69,21 +69,21 @@ export declare const multiplyAdd: (a: Point, b: Point, s: number, output?: Point
|
|
|
69
69
|
* @param {Point} output - The point to store the result in (optional).
|
|
70
70
|
* @returns {Point} A new point interpolated between the two points.
|
|
71
71
|
*/
|
|
72
|
-
export declare const interpolate: (a: Point, b: Point, f: number, output?: Point) => Point;
|
|
72
|
+
export declare const interpolate: (a: Point, b: Point, f: number, output?: Point | null) => Point;
|
|
73
73
|
/**
|
|
74
74
|
* Returns a perpendicular point (rotated 90 degrees counter-clockwise).
|
|
75
75
|
* @param {Point} a - The point to calculate the perpendicular for.
|
|
76
76
|
* @param {Point} output - The point to store the result in (optional).
|
|
77
77
|
* @returns {Point} A new point that is perpendicular to the input point.
|
|
78
78
|
*/
|
|
79
|
-
export declare const perp: (a: Point, output?: Point) => Point;
|
|
79
|
+
export declare const perp: (a: Point, output?: Point | null) => Point;
|
|
80
80
|
/**
|
|
81
81
|
* Returns a perpendicular point (rotated 90 degrees clockwise).
|
|
82
82
|
* @param {Point} a - The point to calculate the perpendicular for.
|
|
83
83
|
* @param {Point} output - The point to store the result in (optional).
|
|
84
84
|
* @returns {Point} A new point that is perpendicular to the input point (rotated clockwise).
|
|
85
85
|
*/
|
|
86
|
-
export declare const rperp: (a: Point, output?: Point) => Point;
|
|
86
|
+
export declare const rperp: (a: Point, output?: Point | null) => Point;
|
|
87
87
|
/**
|
|
88
88
|
* Calculates the distance between two points.
|
|
89
89
|
* @param {Point} a - The first point to calculate the distance from.
|
|
@@ -99,7 +99,7 @@ export declare const distance: (a: Point, b: Point, round?: boolean) => number;
|
|
|
99
99
|
* @param {Point} output - The point to store the result in (optional).
|
|
100
100
|
* @returns {Point} A new point with the projected result.
|
|
101
101
|
*/
|
|
102
|
-
export declare const project: (a: Point, b: Point, output?: Point) => Point;
|
|
102
|
+
export declare const project: (a: Point, b: Point, output?: Point | null) => Point;
|
|
103
103
|
/**
|
|
104
104
|
* Projects the first point onto the unit vector of the second point.
|
|
105
105
|
* @param {Point} a - The point to project.
|
|
@@ -107,21 +107,21 @@ export declare const project: (a: Point, b: Point, output?: Point) => Point;
|
|
|
107
107
|
* @param {Point} output - The point to store the result in (optional).
|
|
108
108
|
* @returns {Point} A new point with the projected result.
|
|
109
109
|
*/
|
|
110
|
-
export declare const projectUnit: (a: Point, b: Point, output?: Point) => Point;
|
|
110
|
+
export declare const projectUnit: (a: Point, b: Point, output?: Point | null) => Point;
|
|
111
111
|
/**
|
|
112
112
|
* Returns a point with the same direction as the input point but with y coordinate negated.
|
|
113
113
|
* @param {Point} a - The point to calculate the normal for.
|
|
114
114
|
* @param {Point} output - The point to store the result in (optional).
|
|
115
115
|
* @returns {Point} A new point with the same x coordinate but negated y coordinate.
|
|
116
116
|
*/
|
|
117
|
-
export declare const normalRightHand: (a: Point, output?: Point) => Point;
|
|
117
|
+
export declare const normalRightHand: (a: Point, output?: Point | null) => Point;
|
|
118
118
|
/**
|
|
119
119
|
* Normalizes the input point to have a magnitude of 1 while preserving its direction.
|
|
120
120
|
* @param {Point} a - The point to normalize.
|
|
121
121
|
* @param {Point} output - The point to store the result in (optional).
|
|
122
122
|
* @returns {Point} A new normalized point.
|
|
123
123
|
*/
|
|
124
|
-
export declare const normalize: (a: Point, output?: Point) => Point;
|
|
124
|
+
export declare const normalize: (a: Point, output?: Point | null) => Point;
|
|
125
125
|
/**
|
|
126
126
|
* Rotates a point around another point by a given angle.
|
|
127
127
|
* @param {Point} a - The point to rotate.
|
|
@@ -140,7 +140,7 @@ export declare const rotate: (a: Point, x: number, y: number, ang: number, asDeg
|
|
|
140
140
|
* @returns {Point} A new point representing the centroid of the input points.
|
|
141
141
|
* @throws {Error} If the points array is empty.
|
|
142
142
|
*/
|
|
143
|
-
export declare const centroid: (points: Point[], output?: Point) => Point;
|
|
143
|
+
export declare const centroid: (points: Point[], output?: Point | null) => Point;
|
|
144
144
|
/**
|
|
145
145
|
* Parses an object with x and y properties into a Point.
|
|
146
146
|
* @param {object} obj - The object to parse (must have x and y properties).
|
|
@@ -155,5 +155,5 @@ export declare const parse: (obj: any, xProp?: string, yProp?: string) => Point;
|
|
|
155
155
|
* @param {Point} output - The point to store the result in (optional).
|
|
156
156
|
* @returns {Point} A new point with the same coordinates as the input.
|
|
157
157
|
*/
|
|
158
|
-
export declare const clone: (input: Point, output?: Point) => Point;
|
|
158
|
+
export declare const clone: (input: Point, output?: Point | null) => Point;
|
|
159
159
|
//# sourceMappingURL=point.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,MAAO,KAAK,KAAK,KAAK,WAAU,KAAK,GAAG,IAAI,UAK3D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,MAAO,KAAK,KAAK,KAAK,WAAU,KAAK,GAAG,IAAI,UAKhE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,MAAO,KAAK,KAAK,KAAK,WAAU,KAAK,GAAG,IAAI,UAKhE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,MAAO,KAAK,KAAK,KAAK,WAAU,KAAK,GAAG,IAAI,UAK9D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM,MAAO,KAAK,KAAK,KAAK,YAExC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,MAAO,KAAK,KAAK,KAAK,WAEvC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,MAAO,KAAK,WAAU,KAAK,GAAG,IAAI,UAGtD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,MAAO,KAAK,KAAK,KAAK,KAAK,MAAM,WAAU,KAAK,GAAG,IAAI,UAG9E,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,MAAO,KAAK,KAAK,KAAK,KAAK,MAAM,WAAU,KAAK,GAAG,IAAI,UAG9E,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,IAAI,MAAO,KAAK,WAAU,KAAK,GAAG,IAAI,UAGlD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,MAAO,KAAK,WAAU,KAAK,GAAG,IAAI,UAGnD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,MAAO,KAAK,KAAK,KAAK,UAAS,OAAO,WAK1D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,MAAO,KAAK,KAAK,KAAK,WAAU,KAAK,GAAG,IAAI,UAO/D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,MAAO,KAAK,KAAK,KAAK,WAAU,KAAK,GAAG,IAAI,UAOnE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,MAAO,KAAK,WAAU,KAAK,GAAG,IAAI,UAG7D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,MAAO,KAAK,WAAU,KAAK,GAAG,IAAI,UAOvD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,MACd,KAAK,KACL,MAAM,KACN,MAAM,OACJ,MAAM,aACA,OAAO,QACZ,MAAM,GAAG,IAAI,GAAG,SAAS,UAmBhC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,WAAY,KAAK,EAAE,WAAU,KAAK,GAAG,IAAI,UAe7D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,QAAS,GAAG,UAAS,MAAM,UAAe,MAAM,UASjE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,UAAW,KAAK,WAAU,KAAK,GAAG,IAAI,UAIvD,CAAC"}
|
|
@@ -5,5 +5,5 @@ import { Polygon } from '../polygon.js';
|
|
|
5
5
|
* @param {Polygon} output - Optional polygon to store the result in.
|
|
6
6
|
* @returns {Polygon} The cloned polygon.
|
|
7
7
|
*/
|
|
8
|
-
export declare const clone: (input: Polygon, output?: Polygon) => Polygon;
|
|
8
|
+
export declare const clone: (input: Polygon, output?: Polygon | null) => Polygon;
|
|
9
9
|
//# sourceMappingURL=polygon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/polygon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/polygon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,UAAW,OAAO,WAAU,OAAO,GAAG,IAAI,YAI3D,CAAC"}
|
|
@@ -21,14 +21,14 @@ export declare const inflatePoint: (a: Rectangle, point: any) => Rectangle;
|
|
|
21
21
|
* @param {Point} output - Optional point to store the result in.
|
|
22
22
|
* @returns {Point} The size of the rectangle as a point (width, height).
|
|
23
23
|
*/
|
|
24
|
-
export declare const size: (a: Rectangle, output?: Point) => Point;
|
|
24
|
+
export declare const size: (a: Rectangle, output?: Point | null) => Point;
|
|
25
25
|
/**
|
|
26
26
|
* Clones a rectangle.
|
|
27
27
|
* @param {Rectangle} input - The rectangle to clone.
|
|
28
28
|
* @param {Rectangle} output - Optional rectangle to store the result in.
|
|
29
29
|
* @returns {Rectangle} The cloned rectangle.
|
|
30
30
|
*/
|
|
31
|
-
export declare const clone: (input: Rectangle, output?: Rectangle) => Rectangle;
|
|
31
|
+
export declare const clone: (input: Rectangle, output?: Rectangle | null) => Rectangle;
|
|
32
32
|
/**
|
|
33
33
|
* Checks if a point is contained within the rectangle.
|
|
34
34
|
* @param {Rectangle} a - The rectangle to check.
|
|
@@ -90,7 +90,7 @@ export declare const intersects: (a: Rectangle, b: Rectangle) => boolean;
|
|
|
90
90
|
* @param {Rectangle} output - Optional rectangle to store the result in.
|
|
91
91
|
* @returns {Rectangle} The intersection of the rectangles, or an empty rectangle if they don't intersect.
|
|
92
92
|
*/
|
|
93
|
-
export declare const intersection: (a: Rectangle, b: Rectangle, output?: Rectangle) => Rectangle;
|
|
93
|
+
export declare const intersection: (a: Rectangle, b: Rectangle, output?: Rectangle | null) => Rectangle;
|
|
94
94
|
/**
|
|
95
95
|
* Checks if a rectangle intersects with a set of raw coordinates.
|
|
96
96
|
* @param {Rectangle} a - The rectangle to check.
|
|
@@ -109,14 +109,14 @@ export declare const intersectsRaw: (a: Rectangle, left: number, right: number,
|
|
|
109
109
|
* @param {Rectangle} output - Optional rectangle to store the result in.
|
|
110
110
|
* @returns {Rectangle} The union of the rectangles.
|
|
111
111
|
*/
|
|
112
|
-
export declare const union: (a: Rectangle, b: Rectangle, output?: Rectangle) => Rectangle;
|
|
112
|
+
export declare const union: (a: Rectangle, b: Rectangle, output?: Rectangle | null) => Rectangle;
|
|
113
113
|
/**
|
|
114
114
|
* Gets the axis-aligned bounding box (AABB) of a set of points.
|
|
115
115
|
* @param {Point[]} points - The array of points to calculate the AABB for.
|
|
116
116
|
* @param {Rectangle} output - Optional rectangle to store the result in.
|
|
117
117
|
* @returns {Rectangle} The AABB of the points.
|
|
118
118
|
*/
|
|
119
|
-
export declare const aabb: (points: Point[], output?: Rectangle) => Rectangle;
|
|
119
|
+
export declare const aabb: (points: Point[], output?: Rectangle | null) => Rectangle;
|
|
120
120
|
/**
|
|
121
121
|
* Gets an empty rectangle instance.
|
|
122
122
|
* @returns {Rectangle} An empty rectangle.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rectangle.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/rectangle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"rectangle.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/rectangle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,MAAO,SAAS,MAAM,MAAM,MAAM,MAAM,cAM3D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,MAAO,SAAS,SAAS,GAAG,cAEpD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,IAAI,MAAO,SAAS,WAAU,KAAK,GAAG,IAAI,UAItD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,UAAW,SAAS,WAAU,SAAS,GAAG,IAAI,cAI/D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,MAAO,SAAS,KAAK,MAAM,KAAK,MAAM,YAK1D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,OAAQ,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK,MAAM,KAAK,MAAM,YAE/F,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,MAAO,SAAS,SAAS,KAAK,YAEvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,MAAO,SAAS,KAAK,SAAS,YAKtD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM,MAAO,SAAS,KAAK,SAAS,YAEhD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,MAAO,SAAS,KAAK,SAAS,YAExD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,MAAO,SAAS,KAAK,SAAS,YAKpD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,MAAO,SAAS,KAAK,SAAS,WAAU,SAAS,GAAG,IAAI,cAShF,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,MACrB,SAAS,QACN,MAAM,SACL,MAAM,OACR,MAAM,UACH,MAAM,cACH,MAAM,YAQlB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,MAAO,SAAS,KAAK,SAAS,WAAU,SAAS,GAAG,IAAI,cAQzE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,IAAI,WAAY,KAAK,EAAE,WAAU,SAAS,GAAG,IAAI,cAsB7D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WAQ7B,CAAC"}
|
|
@@ -5,5 +5,5 @@ import { RoundedRectangle } from '../rounded_rectangle.js';
|
|
|
5
5
|
* @param {RoundedRectangle} output - Optional rounded rectangle to store the result in.
|
|
6
6
|
* @returns {RoundedRectangle} The cloned rounded rectangle.
|
|
7
7
|
*/
|
|
8
|
-
export declare const clone: (input: RoundedRectangle, output?: RoundedRectangle) => RoundedRectangle;
|
|
8
|
+
export declare const clone: (input: RoundedRectangle, output?: RoundedRectangle | null) => RoundedRectangle;
|
|
9
9
|
//# sourceMappingURL=rounded_rectangle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rounded_rectangle.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/rounded_rectangle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"rounded_rectangle.d.ts","sourceRoot":"","sources":["../../../../src/phaser/geom/util/rounded_rectangle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,KAAK,UAAW,gBAAgB,WAAU,gBAAgB,GAAG,IAAI,qBAQ7E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../src/phaser/util/math.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAAgB,CAAC;AACxC,eAAO,MAAM,UAAU,QAAgB,CAAC;AACxC,eAAO,MAAM,IAAI,QAAc,CAAC;AAEhC,MAAM,WAAW,WAAW;IAC1B,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,4DAA4D;AAC5D,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../src/phaser/util/math.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAAgB,CAAC;AACxC,eAAO,MAAM,UAAU,QAAgB,CAAC;AACxC,eAAO,MAAM,IAAI,QAAc,CAAC;AAEhC,MAAM,WAAW,WAAW;IAC1B,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,4DAA4D;AAC5D,eAAO,MAAM,OAAO,QAAS,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAE5D,CAAC;AAEF,4DAA4D;AAC5D,eAAO,MAAM,OAAO,QAAS,MAAM,EAAE,KAAG,MAEvC,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,iBAAiB,UAAW,MAAM,KAAG,MASjD,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,YAAY,UAAW,MAAM,UAAU,MAAM,KAAG,OAE5D,CAAC;AAEF,mCAAmC;AACnC,eAAO,MAAM,QAAQ,YAAa,MAAM,KAAG,MAE1C,CAAC;AAEF,mCAAmC;AACnC,eAAO,MAAM,QAAQ,YAAa,MAAM,KAAG,MAE1C,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,OAAO,QAAS,MAAM,OAAO,MAAM,KAAG,MAElD,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,UAAU,UAAW,MAAM,QAAO,MAAM,UAAa,MAAM,KAAO,MAO9E,CAAC;AAEF,oCAAoC;AACpC,eAAO,MAAM,IAAI,UAAW,MAAM,OAAO,MAAM,OAAO,MAAM,KAAG,MAU9D,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,MAAM,OAAQ,MAAM,MAAM,MAAM,KAAK,MAAM,KAAG,MAE1D,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,UAAU,MAAO,MAAM,KAAK,MAAM,KAAG,MAEjD,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,mBAAmB,MAAO,MAAM,EAAE,KAAK,MAAM,KAAG,MAW5D,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,QAAQ,OAAQ,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,KAAG,MAIzE,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,MAAM,MAAO,MAAM,KAAK,MAAM,aAAa,MAAM,KAAG,OAEhE,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,UAAU,MAAO,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAG,MAEvE,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,QAAQ,MAAO,MAAM,KAAK,MAAM,KAAK,MAAM,KAAG,MAE1D,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,UAAU,UAAW,MAAM,OAAO,WAAW,KAAG,IAQ5D,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,UAAU,UAAW,MAAM,OAAO,WAAW,KAAG,IAQ5D,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,MAAM,UAAW,MAAM,KAAG,eAuBtC,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,YAAY,UAAW,MAAM,GAAG,MAAM,OAAO,WAAW,KAAG,WAmBvE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vpmedia/phaser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.107.0",
|
|
4
4
|
"description": "@vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2",
|
|
5
5
|
"author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,22 +34,22 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@vpmedia/simplify": "^1.
|
|
38
|
-
"uuid": "^14.0.
|
|
37
|
+
"@vpmedia/simplify": "^1.77.0",
|
|
38
|
+
"uuid": "^14.0.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@commitlint/cli": "^21.
|
|
42
|
-
"@commitlint/config-conventional": "^21.
|
|
43
|
-
"@commitlint/types": "^21.
|
|
44
|
-
"@types/node": "^
|
|
45
|
-
"@vitest/coverage-v8": "^4.1.
|
|
46
|
-
"
|
|
47
|
-
"oxfmt": "^0.
|
|
48
|
-
"oxlint": "^1.
|
|
49
|
-
"oxlint-tsgolint": "^0.
|
|
50
|
-
"rolldown": "1.
|
|
51
|
-
"typescript": "^
|
|
52
|
-
"vitest": "^4.1.
|
|
41
|
+
"@commitlint/cli": "^21.2.2",
|
|
42
|
+
"@commitlint/config-conventional": "^21.2.2",
|
|
43
|
+
"@commitlint/types": "^21.2.0",
|
|
44
|
+
"@types/node": "^26.2.0",
|
|
45
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
46
|
+
"happy-dom": "^20.11.2",
|
|
47
|
+
"oxfmt": "^0.63.0",
|
|
48
|
+
"oxlint": "^1.78.0",
|
|
49
|
+
"oxlint-tsgolint": "^7.0.2001",
|
|
50
|
+
"rolldown": "^1.2.4",
|
|
51
|
+
"typescript": "^7.0.2",
|
|
52
|
+
"vitest": "^4.1.10"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "rolldown -c && tsc",
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,14 @@ export { GameObjectFactory } from './phaser/core/factory.js';
|
|
|
4
4
|
export { Game } from './phaser/core/game.js';
|
|
5
5
|
export { Signal } from './phaser/core/signal.js';
|
|
6
6
|
export * as MathUtils from './phaser/util/math.js';
|
|
7
|
+
// cache
|
|
8
|
+
export { Cache } from './phaser/core/cache.js';
|
|
9
|
+
// input
|
|
10
|
+
export { Input } from './phaser/core/input.js';
|
|
11
|
+
export { Pointer } from './phaser/core/input_pointer.js';
|
|
12
|
+
// loader
|
|
13
|
+
export { Loader } from './phaser/core/loader.js';
|
|
14
|
+
export type { LoaderFile } from './phaser/core/loader.js';
|
|
7
15
|
// scale
|
|
8
16
|
export { ScaleManager } from './phaser/core/scale_manager.js';
|
|
9
17
|
// scene
|
|
@@ -16,7 +16,7 @@ export class Animation {
|
|
|
16
16
|
_frameIndex!: number;
|
|
17
17
|
_frameDiff!: number;
|
|
18
18
|
_frameSkip!: number;
|
|
19
|
-
currentFrame!: import('./frame.js').Frame;
|
|
19
|
+
currentFrame!: import('./frame.js').Frame | null;
|
|
20
20
|
onStart!: Signal;
|
|
21
21
|
onUpdate!: Signal | null;
|
|
22
22
|
onComplete!: Signal;
|
|
@@ -34,7 +34,15 @@ export class Animation {
|
|
|
34
34
|
* @param {number} frameRate - The frame rate at which this animation should play (frames per second).
|
|
35
35
|
* @param {boolean} loop - Whether the animation should loop when it completes.
|
|
36
36
|
*/
|
|
37
|
-
constructor(
|
|
37
|
+
constructor(
|
|
38
|
+
game: import('./game.js').Game,
|
|
39
|
+
parent: import('../display/image.js').Image,
|
|
40
|
+
name: string,
|
|
41
|
+
frameData: import('./frame_data.js').FrameData,
|
|
42
|
+
frames: string[] | number[],
|
|
43
|
+
frameRate: number,
|
|
44
|
+
loop: boolean = false
|
|
45
|
+
) {
|
|
38
46
|
/** @type {import('./game.js').Game} */
|
|
39
47
|
this.game = game;
|
|
40
48
|
this._parent = parent;
|
|
@@ -86,7 +94,7 @@ export class Animation {
|
|
|
86
94
|
* @param {boolean} loop - Whether to loop this animation (if null, uses the original loop setting).
|
|
87
95
|
* @returns {Animation} This Animation instance for chaining.
|
|
88
96
|
*/
|
|
89
|
-
play(frameRate: number = null, loop: boolean = null) {
|
|
97
|
+
play(frameRate: number | null = null, loop: boolean | null = null) {
|
|
90
98
|
if (typeof frameRate === 'number') {
|
|
91
99
|
// If they set a new frame rate then use it, otherwise use the one set on creation
|
|
92
100
|
this.delay = 1000 / frameRate;
|
|
@@ -152,7 +160,7 @@ export class Animation {
|
|
|
152
160
|
* @param {string|number} frameId - The identifier (name or index) of the frame to set.
|
|
153
161
|
* @param {boolean} useLocalFrameIndex - If true, treats frameId as an index into the local frames array.
|
|
154
162
|
*/
|
|
155
|
-
setFrame(frameId: string|number, useLocalFrameIndex: boolean = false) {
|
|
163
|
+
setFrame(frameId: string | number, useLocalFrameIndex: boolean = false) {
|
|
156
164
|
let frameIndex;
|
|
157
165
|
// Find the index to the desired frame.
|
|
158
166
|
if (typeof frameId === 'string') {
|
|
@@ -363,11 +371,11 @@ export class Animation {
|
|
|
363
371
|
}
|
|
364
372
|
this.game.onPause.remove(this.onPause, this);
|
|
365
373
|
this.game.onResume.remove(this.onResume, this);
|
|
366
|
-
this.game = null
|
|
367
|
-
this._parent = null
|
|
374
|
+
this.game = null!;
|
|
375
|
+
this._parent = null!;
|
|
368
376
|
this._frames = null;
|
|
369
|
-
this._frameData = null
|
|
370
|
-
this.currentFrame = null
|
|
377
|
+
this._frameData = null!;
|
|
378
|
+
this.currentFrame = null!;
|
|
371
379
|
this.isPlaying = false;
|
|
372
380
|
this.onStart.dispose();
|
|
373
381
|
this.onLoop.dispose();
|
|
@@ -56,7 +56,7 @@ export class AnimationManager {
|
|
|
56
56
|
* @param {string|number} frame - The frame index or name to set as current.
|
|
57
57
|
* @returns {boolean} True if the frame data was loaded successfully, false otherwise.
|
|
58
58
|
*/
|
|
59
|
-
loadFrameData(frameData: import('./frame_data.js').FrameData, frame: string|number) {
|
|
59
|
+
loadFrameData(frameData: import('./frame_data.js').FrameData, frame: string | number) {
|
|
60
60
|
if (!frameData) {
|
|
61
61
|
return false;
|
|
62
62
|
}
|
|
@@ -86,7 +86,7 @@ export class AnimationManager {
|
|
|
86
86
|
* @param {string|number} frame - The frame index or name to set as current.
|
|
87
87
|
* @returns {boolean} True if the frame data was copied successfully, false otherwise.
|
|
88
88
|
*/
|
|
89
|
-
copyFrameData(frameData: import('./frame_data.js').FrameData, frame: string|number) {
|
|
89
|
+
copyFrameData(frameData: import('./frame_data.js').FrameData, frame: string | number) {
|
|
90
90
|
this._frameData = frameData.clone();
|
|
91
91
|
if (this.isLoaded) {
|
|
92
92
|
// We need to update the frameData that the animations are using
|
|
@@ -116,7 +116,13 @@ export class AnimationManager {
|
|
|
116
116
|
* @param {boolean | undefined} useNumericIndex - Whether to treat frameList as numeric indices.
|
|
117
117
|
* @returns {Animation} The created Animation object.
|
|
118
118
|
*/
|
|
119
|
-
add(
|
|
119
|
+
add(
|
|
120
|
+
name: string,
|
|
121
|
+
frameList: number[] | string[] | null | undefined,
|
|
122
|
+
frameRate: number = 60,
|
|
123
|
+
loop: boolean = false,
|
|
124
|
+
useNumericIndex: boolean | undefined = undefined
|
|
125
|
+
) {
|
|
120
126
|
const frames = frameList || [];
|
|
121
127
|
// If they didn't set the useNumericIndex then let's at least try and guess it
|
|
122
128
|
if (useNumericIndex === undefined) {
|
|
@@ -170,7 +176,7 @@ export class AnimationManager {
|
|
|
170
176
|
* @param {boolean} loop - Whether the animation should loop, or null to use the animation's default.
|
|
171
177
|
* @returns {Animation} The Animation object that was played, or null if not found.
|
|
172
178
|
*/
|
|
173
|
-
play(name: string, frameRate: number = null, loop: boolean = null) {
|
|
179
|
+
play(name: string, frameRate: number | null = null, loop: boolean | null = null) {
|
|
174
180
|
if (this._anims[name]) {
|
|
175
181
|
if (this.currentAnim === this._anims[name]) {
|
|
176
182
|
if (this.currentAnim.isPlaying === false) {
|
|
@@ -195,7 +201,7 @@ export class AnimationManager {
|
|
|
195
201
|
* @param {string} name - The name of the animation to stop, or null to stop the current animation.
|
|
196
202
|
* @param {boolean} resetFrame - Whether to reset the frame to the first frame of the animation.
|
|
197
203
|
*/
|
|
198
|
-
stop(name: string = null, resetFrame: boolean = false) {
|
|
204
|
+
stop(name: string | null = null, resetFrame: boolean = false) {
|
|
199
205
|
if (this.currentAnim && (typeof name !== 'string' || name === this.currentAnim.name)) {
|
|
200
206
|
this.currentAnim.stop(resetFrame);
|
|
201
207
|
}
|
package/src/phaser/core/cache.ts
CHANGED
|
@@ -94,7 +94,8 @@ export class Cache {
|
|
|
94
94
|
* @param {HTMLImageElement} data - The image data to cache.
|
|
95
95
|
* @returns {object} The cached image object.
|
|
96
96
|
*/
|
|
97
|
-
addImage(key: string, url: string, data: HTMLImageElement) {
|
|
97
|
+
addImage(key: string, url: string | null, data: HTMLImageElement) {
|
|
98
|
+
const resolvedUrl = url ?? '';
|
|
98
99
|
if (this.checkImageKey(key)) {
|
|
99
100
|
this.removeImage(key);
|
|
100
101
|
}
|
|
@@ -103,15 +104,15 @@ export class Cache {
|
|
|
103
104
|
} */
|
|
104
105
|
const img = {
|
|
105
106
|
key,
|
|
106
|
-
url,
|
|
107
|
+
url: resolvedUrl,
|
|
107
108
|
data,
|
|
108
109
|
base: new BaseTexture(data),
|
|
109
110
|
frame: new Frame(0, 0, 0, data.width, data.height, key),
|
|
110
111
|
frameData: new FrameData(),
|
|
111
112
|
};
|
|
112
|
-
img.frameData.addFrame(new Frame(0, 0, 0, data.width, data.height,
|
|
113
|
+
img.frameData.addFrame(new Frame(0, 0, 0, data.width, data.height, resolvedUrl));
|
|
113
114
|
this._cache.image[key] = img;
|
|
114
|
-
this._resolveURL(
|
|
115
|
+
this._resolveURL(resolvedUrl, img);
|
|
115
116
|
return img;
|
|
116
117
|
}
|
|
117
118
|
|
|
@@ -180,7 +181,7 @@ export class Cache {
|
|
|
180
181
|
xSpacing: number = 0,
|
|
181
182
|
ySpacing: number = 0
|
|
182
183
|
) {
|
|
183
|
-
const obj = {
|
|
184
|
+
const obj: { url: string; data: unknown; font: object | null; base: BaseTexture } = {
|
|
184
185
|
url,
|
|
185
186
|
data,
|
|
186
187
|
font: null,
|
|
@@ -384,11 +385,11 @@ export class Cache {
|
|
|
384
385
|
* TBD.
|
|
385
386
|
* @param {string} key - TBD.
|
|
386
387
|
* @param {number} cache - TBD.
|
|
387
|
-
* @param {string}
|
|
388
|
+
* @param {string} _method - TBD.
|
|
388
389
|
* @param {string} property - TBD.
|
|
389
390
|
* @returns {*} TBD.
|
|
390
391
|
*/
|
|
391
|
-
getItem(key: string, cache: number,
|
|
392
|
+
getItem(key: string, cache: number, _method: string, property: string | null = null) {
|
|
392
393
|
if (this.checkKey(cache, key)) {
|
|
393
394
|
if (!property) {
|
|
394
395
|
return this._cacheMap[cache][key];
|
|
@@ -750,7 +751,7 @@ export class Cache {
|
|
|
750
751
|
* @param {object} data - The data to associate with the resolved URL.
|
|
751
752
|
* @returns {string} The resolved URL or null if not enabled.
|
|
752
753
|
*/
|
|
753
|
-
_resolveURL(url: string, data: any = null) {
|
|
754
|
+
_resolveURL(url: string, data: any | null = null) {
|
|
754
755
|
if (!this.autoResolveURL) {
|
|
755
756
|
return null;
|
|
756
757
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
export class Device {
|
|
2
|
-
desktop!: any;
|
|
3
|
-
iOS!: any;
|
|
4
|
-
android!: any;
|
|
5
|
-
chromeOS!: any;
|
|
6
|
-
linux!: any;
|
|
7
|
-
macOS!: any;
|
|
8
|
-
windows!: any;
|
|
9
|
-
windowsPhone!: any;
|
|
10
|
-
canvas!: any;
|
|
11
|
-
touch!: any;
|
|
12
|
-
mspointer!: any;
|
|
13
|
-
wheelEvent!: any;
|
|
14
|
-
chrome!: any;
|
|
15
|
-
firefox!: any;
|
|
16
|
-
edge!: any;
|
|
17
|
-
safari!: any;
|
|
18
|
-
fullscreen!: any;
|
|
19
|
-
requestFullscreen!: any;
|
|
20
|
-
cancelFullscreen!: any;
|
|
21
|
-
fullscreenKeyboard!: any;
|
|
22
|
-
noAudioFormat!: any;
|
|
23
|
-
supportedAudioFormats!: any;
|
|
24
|
-
supportedImageFormats!: any;
|
|
2
|
+
desktop!: any;
|
|
3
|
+
iOS!: any;
|
|
4
|
+
android!: any;
|
|
5
|
+
chromeOS!: any;
|
|
6
|
+
linux!: any;
|
|
7
|
+
macOS!: any;
|
|
8
|
+
windows!: any;
|
|
9
|
+
windowsPhone!: any;
|
|
10
|
+
canvas!: any;
|
|
11
|
+
touch!: any;
|
|
12
|
+
mspointer!: any;
|
|
13
|
+
wheelEvent!: any;
|
|
14
|
+
chrome!: any;
|
|
15
|
+
firefox!: any;
|
|
16
|
+
edge!: any;
|
|
17
|
+
safari!: any;
|
|
18
|
+
fullscreen!: any;
|
|
19
|
+
requestFullscreen!: any;
|
|
20
|
+
cancelFullscreen!: any;
|
|
21
|
+
fullscreenKeyboard!: any;
|
|
22
|
+
noAudioFormat!: any;
|
|
23
|
+
supportedAudioFormats!: any;
|
|
24
|
+
supportedImageFormats!: any;
|
|
25
25
|
/**
|
|
26
26
|
* Creates a new Device instance.
|
|
27
27
|
* This class provides information about the current device and browser capabilities.
|
|
@@ -117,4 +117,4 @@ supportedImageFormats!: any;
|
|
|
117
117
|
*/
|
|
118
118
|
this.supportedImageFormats = {};
|
|
119
119
|
}
|
|
120
|
-
}
|
|
120
|
+
}
|
|
@@ -96,16 +96,18 @@ export const checkFullScreenSupport = (device: Device) => {
|
|
|
96
96
|
'mozExitFullscreen',
|
|
97
97
|
];
|
|
98
98
|
const element = document.createElement('div');
|
|
99
|
+
const elementApi = element as unknown as Record<string, unknown>;
|
|
99
100
|
for (let i = 0; i < fs.length; i += 1) {
|
|
100
|
-
if (
|
|
101
|
+
if (elementApi[fs[i]]) {
|
|
101
102
|
device.fullscreen = true;
|
|
102
103
|
device.requestFullscreen = fs[i];
|
|
103
104
|
break;
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
if (device.fullscreen) {
|
|
108
|
+
const documentApi = document as unknown as Record<string, unknown>;
|
|
107
109
|
for (let i = 0; i < cfs.length; i += 1) {
|
|
108
|
-
if (
|
|
110
|
+
if (documentApi[cfs[i]]) {
|
|
109
111
|
device.cancelFullscreen = cfs[i];
|
|
110
112
|
break;
|
|
111
113
|
}
|