@vpmedia/phaser 1.106.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.js +225 -226
- 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 +6 -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 +13 -13
- package/src/phaser/core/animation.ts +6 -6
- package/src/phaser/core/animation_manager.ts +2 -2
- package/src/phaser/core/cache.ts +9 -8
- 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 +2 -2
- package/src/phaser/core/input_handler.ts +6 -5
- package/src/phaser/core/input_mouse.ts +8 -84
- package/src/phaser/core/input_mspointer.ts +12 -8
- package/src/phaser/core/input_touch.ts +7 -7
- package/src/phaser/core/loader.ts +35 -31
- package/src/phaser/core/loader_parser.ts +12 -4
- package/src/phaser/core/scale_manager.ts +5 -5
- package/src/phaser/core/scene.ts +3 -3
- package/src/phaser/core/signal.ts +9 -9
- package/src/phaser/core/signal_binding.ts +1 -1
- package/src/phaser/core/sound.ts +12 -21
- package/src/phaser/core/sound_manager.ts +3 -3
- package/src/phaser/core/stage.ts +6 -6
- package/src/phaser/core/timer.ts +4 -4
- package/src/phaser/core/tween.ts +7 -5
- package/src/phaser/core/tween_data.ts +2 -2
- package/src/phaser/core/tween_manager.ts +2 -2
- package/src/phaser/display/bitmap_text.ts +6 -6
- package/src/phaser/display/button.ts +33 -26
- package/src/phaser/display/canvas/renderer.ts +2 -2
- package/src/phaser/display/canvas/util.ts +12 -12
- package/src/phaser/display/display_object.ts +17 -31
- package/src/phaser/display/graphics.ts +9 -9
- package/src/phaser/display/group.ts +8 -8
- package/src/phaser/display/image.ts +21 -21
- package/src/phaser/display/sprite_util.ts +1 -1
- package/src/phaser/display/text.ts +9 -9
- package/src/phaser/display/webgl/earcut.ts +12 -4
- package/src/phaser/display/webgl/fast_sprite_batch.ts +4 -2
- package/src/phaser/display/webgl/graphics.ts +3 -2
- package/src/phaser/display/webgl/render_texture.ts +2 -2
- package/src/phaser/display/webgl/shader/normal.ts +1 -1
- package/src/phaser/display/webgl/shader_manager.ts +2 -1
- package/src/phaser/display/webgl/sprite_batch.ts +2 -1
- package/src/phaser/display/webgl/util.ts +9 -0
- 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 +15 -15
- package/src/phaser/geom/util/polygon.ts +1 -1
- package/src/phaser/geom/util/rectangle.ts +5 -5
- 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;AAE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;;;;;;;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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AEF,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.
|
|
37
|
+
"@vpmedia/simplify": "^1.77.0",
|
|
38
38
|
"uuid": "^14.0.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@commitlint/cli": "^21.2.
|
|
42
|
-
"@commitlint/config-conventional": "^21.2.
|
|
41
|
+
"@commitlint/cli": "^21.2.2",
|
|
42
|
+
"@commitlint/config-conventional": "^21.2.2",
|
|
43
43
|
"@commitlint/types": "^21.2.0",
|
|
44
|
-
"@types/node": "^26.
|
|
45
|
-
"@vitest/coverage-v8": "^4.1.
|
|
46
|
-
"happy-dom": "^20.
|
|
47
|
-
"oxfmt": "^0.
|
|
48
|
-
"oxlint": "^1.
|
|
49
|
-
"oxlint-tsgolint": "^0.
|
|
50
|
-
"rolldown": "^1.
|
|
51
|
-
"typescript": "^
|
|
52
|
-
"vitest": "^4.1.
|
|
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",
|
|
@@ -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;
|
|
@@ -94,7 +94,7 @@ export class Animation {
|
|
|
94
94
|
* @param {boolean} loop - Whether to loop this animation (if null, uses the original loop setting).
|
|
95
95
|
* @returns {Animation} This Animation instance for chaining.
|
|
96
96
|
*/
|
|
97
|
-
play(frameRate: number = null, loop: boolean = null) {
|
|
97
|
+
play(frameRate: number | null = null, loop: boolean | null = null) {
|
|
98
98
|
if (typeof frameRate === 'number') {
|
|
99
99
|
// If they set a new frame rate then use it, otherwise use the one set on creation
|
|
100
100
|
this.delay = 1000 / frameRate;
|
|
@@ -371,11 +371,11 @@ export class Animation {
|
|
|
371
371
|
}
|
|
372
372
|
this.game.onPause.remove(this.onPause, this);
|
|
373
373
|
this.game.onResume.remove(this.onResume, this);
|
|
374
|
-
this.game = null
|
|
375
|
-
this._parent = null
|
|
374
|
+
this.game = null!;
|
|
375
|
+
this._parent = null!;
|
|
376
376
|
this._frames = null;
|
|
377
|
-
this._frameData = null
|
|
378
|
-
this.currentFrame = null
|
|
377
|
+
this._frameData = null!;
|
|
378
|
+
this.currentFrame = null!;
|
|
379
379
|
this.isPlaying = false;
|
|
380
380
|
this.onStart.dispose();
|
|
381
381
|
this.onLoop.dispose();
|
|
@@ -176,7 +176,7 @@ export class AnimationManager {
|
|
|
176
176
|
* @param {boolean} loop - Whether the animation should loop, or null to use the animation's default.
|
|
177
177
|
* @returns {Animation} The Animation object that was played, or null if not found.
|
|
178
178
|
*/
|
|
179
|
-
play(name: string, frameRate: number = null, loop: boolean = null) {
|
|
179
|
+
play(name: string, frameRate: number | null = null, loop: boolean | null = null) {
|
|
180
180
|
if (this._anims[name]) {
|
|
181
181
|
if (this.currentAnim === this._anims[name]) {
|
|
182
182
|
if (this.currentAnim.isPlaying === false) {
|
|
@@ -201,7 +201,7 @@ export class AnimationManager {
|
|
|
201
201
|
* @param {string} name - The name of the animation to stop, or null to stop the current animation.
|
|
202
202
|
* @param {boolean} resetFrame - Whether to reset the frame to the first frame of the animation.
|
|
203
203
|
*/
|
|
204
|
-
stop(name: string = null, resetFrame: boolean = false) {
|
|
204
|
+
stop(name: string | null = null, resetFrame: boolean = false) {
|
|
205
205
|
if (this.currentAnim && (typeof name !== 'string' || name === this.currentAnim.name)) {
|
|
206
206
|
this.currentAnim.stop(resetFrame);
|
|
207
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
|
}
|
|
@@ -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
|
}
|
package/src/phaser/core/dom.ts
CHANGED
|
@@ -211,7 +211,7 @@ export class DOM {
|
|
|
211
211
|
* @param {Point} point - Optional Point object to store the result.
|
|
212
212
|
* @returns {Point} The offset position of the element.
|
|
213
213
|
*/
|
|
214
|
-
getOffset(element: HTMLCanvasElement, point: Point = null) {
|
|
214
|
+
getOffset(element: HTMLCanvasElement, point: Point | null = null) {
|
|
215
215
|
point = point || new Point();
|
|
216
216
|
const box = element.getBoundingClientRect();
|
|
217
217
|
const scrollTop = this.scrollY;
|
|
@@ -230,7 +230,7 @@ export class DOM {
|
|
|
230
230
|
* @returns {boolean} True if bounds were successfully retrieved, false otherwise.
|
|
231
231
|
*/
|
|
232
232
|
getBounds(element: HTMLCanvasElement, cushion: number = 0) {
|
|
233
|
-
element = element && !element.nodeType ? element[0] : element;
|
|
233
|
+
element = element && !element.nodeType ? (element as unknown as HTMLCanvasElement[])[0] : element;
|
|
234
234
|
if (!element || element.nodeType !== 1) {
|
|
235
235
|
return false;
|
|
236
236
|
}
|
|
@@ -24,11 +24,9 @@ export class GameObjectFactory {
|
|
|
24
24
|
* @param {Group} group - The parent group for the image.
|
|
25
25
|
* @returns {Image} The created Image object.
|
|
26
26
|
*/
|
|
27
|
-
image(x: number, y: number, key: string, frame: any, group: Group = null) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
return group.add(new Image(this.game, x, y, key, frame));
|
|
27
|
+
image(x: number, y: number, key: string, frame: any, group: Group | null = null) {
|
|
28
|
+
const target = group ?? this.game.world;
|
|
29
|
+
return target.add(new Image(this.game, x, y, key, frame));
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
/**
|
package/src/phaser/core/game.ts
CHANGED
|
@@ -43,7 +43,12 @@ export class Game {
|
|
|
43
43
|
device!: Device;
|
|
44
44
|
logger!: Logger;
|
|
45
45
|
canvas!: HTMLCanvasElement;
|
|
46
|
-
context!:
|
|
46
|
+
context!:
|
|
47
|
+
| CanvasRenderingContext2D
|
|
48
|
+
| ImageBitmapRenderingContext
|
|
49
|
+
| WebGLRenderingContext
|
|
50
|
+
| WebGL2RenderingContext
|
|
51
|
+
| null;
|
|
47
52
|
onPause!: Signal;
|
|
48
53
|
onResume!: Signal;
|
|
49
54
|
onBoot!: Signal;
|
|
@@ -79,27 +84,9 @@ export class Game {
|
|
|
79
84
|
this.parent = '';
|
|
80
85
|
this.width = 800;
|
|
81
86
|
this.height = 600;
|
|
82
|
-
this.renderer = null;
|
|
83
|
-
this.state = null;
|
|
84
87
|
this.isBooted = false;
|
|
85
88
|
this.paused = false;
|
|
86
|
-
this.raf = null;
|
|
87
|
-
this.add = null;
|
|
88
|
-
this.cache = null;
|
|
89
|
-
this.input = null;
|
|
90
|
-
this.load = null;
|
|
91
|
-
this.scale = null;
|
|
92
|
-
this.sound = null;
|
|
93
|
-
this.stage = null;
|
|
94
|
-
this.time = null;
|
|
95
|
-
this.tweens = null;
|
|
96
|
-
this.world = null;
|
|
97
89
|
this.device = new Device();
|
|
98
|
-
/** @type {Logger} */
|
|
99
|
-
this.logger = null;
|
|
100
|
-
/** @type {HTMLCanvasElement} */
|
|
101
|
-
this.canvas = null;
|
|
102
|
-
/** @type {CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext} */
|
|
103
90
|
this.context = null;
|
|
104
91
|
this.onPause = new Signal();
|
|
105
92
|
this.onResume = new Signal();
|
|
@@ -172,12 +159,12 @@ export class Game {
|
|
|
172
159
|
this.canvas = create(this, this.width, this.height, this.config.canvasID, true);
|
|
173
160
|
}
|
|
174
161
|
if (this.config.canvasStyle) {
|
|
175
|
-
const
|
|
176
|
-
for (const property of
|
|
177
|
-
this.canvas.style
|
|
162
|
+
const canvasStyle = this.config.canvasStyle as Record<string, string>;
|
|
163
|
+
for (const property of Object.keys(canvasStyle)) {
|
|
164
|
+
this.canvas.style.setProperty(property, canvasStyle[property]);
|
|
178
165
|
}
|
|
179
166
|
} else {
|
|
180
|
-
this.canvas.style
|
|
167
|
+
this.canvas.style.setProperty('-webkit-full-screen', 'width: 100%; height: 100%');
|
|
181
168
|
}
|
|
182
169
|
}
|
|
183
170
|
|
|
@@ -355,16 +342,16 @@ export class Game {
|
|
|
355
342
|
this.renderer.destroy(false);
|
|
356
343
|
removeFromDOM(this.canvas);
|
|
357
344
|
|
|
358
|
-
this.cache = null
|
|
359
|
-
this.load = null
|
|
360
|
-
this.time = null
|
|
361
|
-
this.world = null
|
|
362
|
-
this.state = null
|
|
363
|
-
this.sound = null
|
|
364
|
-
this.scale = null
|
|
365
|
-
this.stage = null
|
|
366
|
-
this.input = null
|
|
367
|
-
this.canvas = null
|
|
368
|
-
this.renderer = null
|
|
345
|
+
this.cache = null!;
|
|
346
|
+
this.load = null!;
|
|
347
|
+
this.time = null!;
|
|
348
|
+
this.world = null!;
|
|
349
|
+
this.state = null!;
|
|
350
|
+
this.sound = null!;
|
|
351
|
+
this.scale = null!;
|
|
352
|
+
this.stage = null!;
|
|
353
|
+
this.input = null!;
|
|
354
|
+
this.canvas = null!;
|
|
355
|
+
this.renderer = null!;
|
|
369
356
|
}
|
|
370
357
|
}
|