@vpmedia/phaser 1.104.0 → 1.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +164 -592
- package/dist/index.js.map +1 -1
- package/dist/phaser/core/animation.d.ts +35 -57
- package/dist/phaser/core/animation.d.ts.map +1 -1
- package/dist/phaser/core/animation_manager.d.ts +11 -10
- package/dist/phaser/core/animation_manager.d.ts.map +1 -1
- package/dist/phaser/core/animation_parser.d.ts +2 -2
- package/dist/phaser/core/animation_parser.d.ts.map +1 -1
- package/dist/phaser/core/array_set.d.ts +3 -3
- package/dist/phaser/core/array_set.d.ts.map +1 -1
- package/dist/phaser/core/cache.d.ts +60 -60
- package/dist/phaser/core/cache.d.ts.map +1 -1
- package/dist/phaser/core/device.d.ts.map +1 -1
- package/dist/phaser/core/device_util.d.ts +10 -10
- package/dist/phaser/core/device_util.d.ts.map +1 -1
- package/dist/phaser/core/dom.d.ts +6 -5
- package/dist/phaser/core/dom.d.ts.map +1 -1
- package/dist/phaser/core/event_manager.d.ts +49 -174
- package/dist/phaser/core/event_manager.d.ts.map +1 -1
- package/dist/phaser/core/factory.d.ts +7 -7
- package/dist/phaser/core/factory.d.ts.map +1 -1
- package/dist/phaser/core/frame.d.ts +27 -48
- package/dist/phaser/core/frame.d.ts.map +1 -1
- package/dist/phaser/core/frame_data.d.ts +11 -60
- package/dist/phaser/core/frame_data.d.ts.map +1 -1
- package/dist/phaser/core/frame_util.d.ts +4 -14
- package/dist/phaser/core/frame_util.d.ts.map +1 -1
- package/dist/phaser/core/game.d.ts +49 -58
- package/dist/phaser/core/game.d.ts.map +1 -1
- package/dist/phaser/core/input.d.ts +15 -13
- package/dist/phaser/core/input.d.ts.map +1 -1
- package/dist/phaser/core/input_handler.d.ts +23 -20
- package/dist/phaser/core/input_handler.d.ts.map +1 -1
- package/dist/phaser/core/input_mouse.d.ts +26 -1
- package/dist/phaser/core/input_mouse.d.ts.map +1 -1
- package/dist/phaser/core/input_mspointer.d.ts +2 -2
- package/dist/phaser/core/input_mspointer.d.ts.map +1 -1
- package/dist/phaser/core/input_pointer.d.ts +9 -9
- package/dist/phaser/core/input_pointer.d.ts.map +1 -1
- package/dist/phaser/core/input_touch.d.ts +2 -1
- package/dist/phaser/core/input_touch.d.ts.map +1 -1
- package/dist/phaser/core/loader.d.ts +38 -28
- package/dist/phaser/core/loader.d.ts.map +1 -1
- package/dist/phaser/core/loader_parser.d.ts +4 -4
- package/dist/phaser/core/loader_parser.d.ts.map +1 -1
- package/dist/phaser/core/raf.d.ts +2 -2
- package/dist/phaser/core/raf.d.ts.map +1 -1
- package/dist/phaser/core/scale_manager.d.ts +22 -17
- package/dist/phaser/core/scale_manager.d.ts.map +1 -1
- package/dist/phaser/core/scene.d.ts +1 -1
- package/dist/phaser/core/scene.d.ts.map +1 -1
- package/dist/phaser/core/scene_manager.d.ts +10 -9
- package/dist/phaser/core/scene_manager.d.ts.map +1 -1
- package/dist/phaser/core/signal.d.ts +9 -8
- package/dist/phaser/core/signal.d.ts.map +1 -1
- package/dist/phaser/core/signal_binding.d.ts +2 -2
- package/dist/phaser/core/signal_binding.d.ts.map +1 -1
- package/dist/phaser/core/sound.d.ts +56 -101
- package/dist/phaser/core/sound.d.ts.map +1 -1
- package/dist/phaser/core/sound_manager.d.ts +11 -9
- package/dist/phaser/core/sound_manager.d.ts.map +1 -1
- package/dist/phaser/core/sound_sprite.d.ts +4 -4
- package/dist/phaser/core/sound_sprite.d.ts.map +1 -1
- package/dist/phaser/core/stage.d.ts +3 -3
- package/dist/phaser/core/stage.d.ts.map +1 -1
- package/dist/phaser/core/time.d.ts +5 -5
- package/dist/phaser/core/time.d.ts.map +1 -1
- package/dist/phaser/core/timer.d.ts +10 -10
- package/dist/phaser/core/timer.d.ts.map +1 -1
- package/dist/phaser/core/timer_event.d.ts +11 -21
- package/dist/phaser/core/timer_event.d.ts.map +1 -1
- package/dist/phaser/core/tween.d.ts +37 -59
- package/dist/phaser/core/tween.d.ts.map +1 -1
- package/dist/phaser/core/tween_data.d.ts +6 -5
- package/dist/phaser/core/tween_data.d.ts.map +1 -1
- package/dist/phaser/core/tween_easing.d.ts +31 -31
- package/dist/phaser/core/tween_easing.d.ts.map +1 -1
- package/dist/phaser/core/tween_manager.d.ts +4 -4
- package/dist/phaser/core/tween_manager.d.ts.map +1 -1
- package/dist/phaser/core/world.d.ts +1 -1
- package/dist/phaser/core/world.d.ts.map +1 -1
- package/dist/phaser/display/bitmap_text.d.ts +22 -20
- package/dist/phaser/display/bitmap_text.d.ts.map +1 -1
- package/dist/phaser/display/button.d.ts +23 -35
- package/dist/phaser/display/button.d.ts.map +1 -1
- package/dist/phaser/display/canvas/buffer.d.ts +2 -2
- package/dist/phaser/display/canvas/buffer.d.ts.map +1 -1
- package/dist/phaser/display/canvas/graphics.d.ts +3 -3
- package/dist/phaser/display/canvas/graphics.d.ts.map +1 -1
- package/dist/phaser/display/canvas/masker.d.ts.map +1 -1
- package/dist/phaser/display/canvas/pool.d.ts +2 -2
- package/dist/phaser/display/canvas/pool.d.ts.map +1 -1
- package/dist/phaser/display/canvas/renderer.d.ts +5 -5
- package/dist/phaser/display/canvas/renderer.d.ts.map +1 -1
- package/dist/phaser/display/canvas/tinter.d.ts +3 -3
- package/dist/phaser/display/canvas/tinter.d.ts.map +1 -1
- package/dist/phaser/display/canvas/util.d.ts +9 -9
- package/dist/phaser/display/canvas/util.d.ts.map +1 -1
- package/dist/phaser/display/display_object.d.ts +45 -42
- package/dist/phaser/display/display_object.d.ts.map +1 -1
- package/dist/phaser/display/graphics.d.ts +24 -16
- package/dist/phaser/display/graphics.d.ts.map +1 -1
- package/dist/phaser/display/graphics_data.d.ts +1 -1
- package/dist/phaser/display/graphics_data.d.ts.map +1 -1
- package/dist/phaser/display/graphics_data_util.d.ts +1 -1
- package/dist/phaser/display/graphics_data_util.d.ts.map +1 -1
- package/dist/phaser/display/group.d.ts +24 -37
- package/dist/phaser/display/group.d.ts.map +1 -1
- package/dist/phaser/display/image.d.ts +34 -49
- package/dist/phaser/display/image.d.ts.map +1 -1
- package/dist/phaser/display/sprite_batch.d.ts +1 -1
- package/dist/phaser/display/sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/sprite_util.d.ts +5 -5
- package/dist/phaser/display/sprite_util.d.ts.map +1 -1
- package/dist/phaser/display/text.d.ts +86 -66
- package/dist/phaser/display/text.d.ts.map +1 -1
- package/dist/phaser/display/webgl/abstract_filter.d.ts +2 -1
- package/dist/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
- package/dist/phaser/display/webgl/base_texture.d.ts +2 -2
- package/dist/phaser/display/webgl/base_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/blend_manager.d.ts +3 -2
- package/dist/phaser/display/webgl/blend_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/earcut.d.ts +10 -10
- package/dist/phaser/display/webgl/earcut.d.ts.map +1 -1
- package/dist/phaser/display/webgl/earcut_node.d.ts +1 -1
- package/dist/phaser/display/webgl/earcut_node.d.ts.map +1 -1
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts +2 -1
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/webgl/filter_manager.d.ts +2 -1
- package/dist/phaser/display/webgl/filter_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/filter_texture.d.ts +3 -2
- package/dist/phaser/display/webgl/filter_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/graphics.d.ts +11 -10
- package/dist/phaser/display/webgl/graphics.d.ts.map +1 -1
- package/dist/phaser/display/webgl/graphics_data.d.ts +2 -1
- package/dist/phaser/display/webgl/graphics_data.d.ts.map +1 -1
- package/dist/phaser/display/webgl/mask_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/render_texture.d.ts +2 -1
- package/dist/phaser/display/webgl/render_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/renderer.d.ts +8 -6
- package/dist/phaser/display/webgl/renderer.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/complex.d.ts +2 -1
- package/dist/phaser/display/webgl/shader/complex.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/fast.d.ts +2 -1
- package/dist/phaser/display/webgl/shader/fast.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/normal.d.ts +1 -0
- package/dist/phaser/display/webgl/shader/normal.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/primitive.d.ts +2 -1
- package/dist/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/strip.d.ts +2 -1
- package/dist/phaser/display/webgl/shader/strip.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader_manager.d.ts +4 -2
- package/dist/phaser/display/webgl/shader_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/sprite_batch.d.ts +3 -2
- package/dist/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/webgl/stencil_manager.d.ts +5 -4
- package/dist/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/texture.d.ts +15 -2
- package/dist/phaser/display/webgl/texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/texture_util.d.ts +2 -2
- package/dist/phaser/display/webgl/texture_util.d.ts.map +1 -1
- package/dist/phaser/display/webgl/util.d.ts +6 -6
- package/dist/phaser/display/webgl/util.d.ts.map +1 -1
- package/dist/phaser/geom/circle.d.ts +11 -10
- package/dist/phaser/geom/circle.d.ts.map +1 -1
- package/dist/phaser/geom/ellipse.d.ts +6 -5
- package/dist/phaser/geom/ellipse.d.ts.map +1 -1
- package/dist/phaser/geom/line.d.ts +14 -14
- package/dist/phaser/geom/line.d.ts.map +1 -1
- package/dist/phaser/geom/matrix.d.ts +13 -12
- package/dist/phaser/geom/matrix.d.ts.map +1 -1
- package/dist/phaser/geom/point.d.ts +19 -19
- package/dist/phaser/geom/point.d.ts.map +1 -1
- package/dist/phaser/geom/polygon.d.ts +6 -6
- package/dist/phaser/geom/polygon.d.ts.map +1 -1
- package/dist/phaser/geom/rectangle.d.ts +20 -20
- package/dist/phaser/geom/rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/rounded_rectangle.d.ts +2 -2
- package/dist/phaser/geom/rounded_rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/util/circle.d.ts +9 -7
- package/dist/phaser/geom/util/circle.d.ts.map +1 -1
- package/dist/phaser/geom/util/ellipse.d.ts +1 -1
- package/dist/phaser/geom/util/ellipse.d.ts.map +1 -1
- package/dist/phaser/geom/util/line.d.ts +5 -3
- package/dist/phaser/geom/util/line.d.ts.map +1 -1
- package/dist/phaser/geom/util/matrix.d.ts +2 -1
- package/dist/phaser/geom/util/matrix.d.ts.map +1 -1
- package/dist/phaser/geom/util/point.d.ts +19 -19
- package/dist/phaser/geom/util/point.d.ts.map +1 -1
- package/dist/phaser/geom/util/polygon.d.ts +2 -1
- package/dist/phaser/geom/util/polygon.d.ts.map +1 -1
- package/dist/phaser/geom/util/rectangle.d.ts +17 -15
- package/dist/phaser/geom/util/rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/util/rounded_rectangle.d.ts +2 -1
- package/dist/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
- package/dist/phaser/util/math.d.ts +51 -142
- package/dist/phaser/util/math.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/index.ts +8 -0
- package/src/phaser/core/animation.ts +46 -61
- package/src/phaser/core/animation_manager.ts +27 -21
- package/src/phaser/core/animation_parser.ts +11 -3
- package/src/phaser/core/array_set.ts +8 -8
- package/src/phaser/core/cache.ts +75 -68
- package/src/phaser/core/device.ts +24 -25
- package/src/phaser/core/device_util.ts +10 -10
- package/src/phaser/core/dom.ts +5 -5
- package/src/phaser/core/event_manager.ts +52 -193
- package/src/phaser/core/factory.ts +25 -18
- package/src/phaser/core/frame.ts +37 -51
- package/src/phaser/core/frame_data.ts +29 -76
- package/src/phaser/core/frame_util.ts +3 -16
- package/src/phaser/core/game.ts +36 -63
- package/src/phaser/core/input.ts +72 -68
- package/src/phaser/core/input_handler.ts +93 -84
- package/src/phaser/core/input_mouse.ts +42 -36
- package/src/phaser/core/input_mspointer.ts +24 -25
- package/src/phaser/core/input_pointer.ts +55 -56
- package/src/phaser/core/input_touch.ts +26 -26
- package/src/phaser/core/loader.ts +108 -70
- package/src/phaser/core/loader_parser.ts +24 -7
- package/src/phaser/core/raf.ts +2 -2
- package/src/phaser/core/scale_manager.ts +85 -82
- package/src/phaser/core/scene.ts +3 -4
- package/src/phaser/core/scene_manager.ts +26 -26
- package/src/phaser/core/signal.ts +16 -10
- package/src/phaser/core/signal_binding.ts +9 -2
- package/src/phaser/core/sound.ts +71 -112
- package/src/phaser/core/sound_manager.ts +31 -30
- package/src/phaser/core/sound_sprite.ts +11 -12
- package/src/phaser/core/stage.ts +8 -8
- package/src/phaser/core/time.ts +34 -35
- package/src/phaser/core/timer.ts +40 -34
- package/src/phaser/core/timer_event.ts +23 -23
- package/src/phaser/core/tween.ts +62 -68
- package/src/phaser/core/tween_data.ts +31 -31
- package/src/phaser/core/tween_easing.ts +31 -31
- package/src/phaser/core/tween_manager.ts +11 -12
- package/src/phaser/core/world.ts +1 -2
- package/src/phaser/display/bitmap_text.ts +41 -31
- package/src/phaser/display/button.ts +34 -49
- package/src/phaser/display/canvas/buffer.ts +6 -7
- package/src/phaser/display/canvas/graphics.ts +3 -4
- package/src/phaser/display/canvas/masker.ts +2 -3
- package/src/phaser/display/canvas/pool.ts +3 -4
- package/src/phaser/display/canvas/renderer.ts +19 -20
- package/src/phaser/display/canvas/tinter.ts +4 -5
- package/src/phaser/display/canvas/util.ts +17 -9
- package/src/phaser/display/display_object.ts +49 -50
- package/src/phaser/display/graphics.ts +56 -43
- package/src/phaser/display/graphics_data.ts +19 -12
- package/src/phaser/display/graphics_data_util.ts +1 -2
- package/src/phaser/display/group.ts +32 -42
- package/src/phaser/display/image.ts +38 -52
- package/src/phaser/display/sprite_batch.ts +1 -2
- package/src/phaser/display/sprite_util.ts +17 -6
- package/src/phaser/display/text.ts +82 -56
- package/src/phaser/display/webgl/abstract_filter.ts +8 -8
- package/src/phaser/display/webgl/base_texture.ts +14 -15
- package/src/phaser/display/webgl/blend_manager.ts +5 -5
- package/src/phaser/display/webgl/earcut.ts +44 -27
- package/src/phaser/display/webgl/earcut_node.ts +1 -1
- package/src/phaser/display/webgl/fast_sprite_batch.ts +19 -19
- package/src/phaser/display/webgl/filter_manager.ts +5 -5
- package/src/phaser/display/webgl/filter_texture.ts +7 -7
- package/src/phaser/display/webgl/graphics.ts +17 -11
- package/src/phaser/display/webgl/graphics_data.ts +11 -11
- package/src/phaser/display/webgl/mask_manager.ts +2 -3
- package/src/phaser/display/webgl/render_texture.ts +18 -12
- package/src/phaser/display/webgl/renderer.ts +24 -24
- package/src/phaser/display/webgl/shader/complex.ts +7 -7
- package/src/phaser/display/webgl/shader/fast.ts +8 -8
- package/src/phaser/display/webgl/shader/normal.ts +12 -12
- package/src/phaser/display/webgl/shader/primitive.ts +7 -7
- package/src/phaser/display/webgl/shader/strip.ts +7 -7
- package/src/phaser/display/webgl/shader_manager.ts +13 -13
- package/src/phaser/display/webgl/sprite_batch.ts +20 -20
- package/src/phaser/display/webgl/stencil_manager.ts +20 -8
- package/src/phaser/display/webgl/texture.ts +40 -24
- package/src/phaser/display/webgl/texture_util.ts +2 -3
- package/src/phaser/display/webgl/util.ts +10 -6
- package/src/phaser/geom/circle.ts +10 -10
- package/src/phaser/geom/ellipse.ts +6 -6
- package/src/phaser/geom/line.ts +14 -14
- package/src/phaser/geom/matrix.ts +12 -12
- package/src/phaser/geom/point.ts +19 -19
- package/src/phaser/geom/polygon.ts +5 -5
- package/src/phaser/geom/rectangle.ts +21 -21
- package/src/phaser/geom/rounded_rectangle.ts +2 -2
- package/src/phaser/geom/util/circle.ts +7 -7
- package/src/phaser/geom/util/ellipse.ts +1 -1
- package/src/phaser/geom/util/line.ts +5 -5
- package/src/phaser/geom/util/matrix.ts +1 -1
- package/src/phaser/geom/util/point.ts +27 -20
- package/src/phaser/geom/util/polygon.ts +1 -1
- package/src/phaser/geom/util/rectangle.ts +22 -15
- package/src/phaser/geom/util/rounded_rectangle.ts +1 -1
- package/src/phaser/util/math.ts +65 -151
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Point } from '../point.js';
|
|
2
|
+
import { Rectangle } from '../rectangle.js';
|
|
1
3
|
/**
|
|
2
4
|
* Inflates the rectangle by the specified amounts on each axis.
|
|
3
5
|
* @param {Rectangle} a - The rectangle to inflate.
|
|
@@ -5,28 +7,28 @@
|
|
|
5
7
|
* @param {number} dy - The amount to inflate the rectangle vertically.
|
|
6
8
|
* @returns {Rectangle} The inflated rectangle.
|
|
7
9
|
*/
|
|
8
|
-
export declare const inflate: (a:
|
|
10
|
+
export declare const inflate: (a: Rectangle, dx: number, dy: number) => Rectangle;
|
|
9
11
|
/**
|
|
10
12
|
* Inflates the rectangle by the specified point values on each axis.
|
|
11
13
|
* @param {Rectangle} a - The rectangle to inflate.
|
|
12
14
|
* @param {object} point - The point containing x and y values to inflate the rectangle by.
|
|
13
15
|
* @returns {Rectangle} The inflated rectangle.
|
|
14
16
|
*/
|
|
15
|
-
export declare const inflatePoint: (a:
|
|
17
|
+
export declare const inflatePoint: (a: Rectangle, point: any) => Rectangle;
|
|
16
18
|
/**
|
|
17
19
|
* Gets the size of the rectangle as a point.
|
|
18
20
|
* @param {Rectangle} a - The rectangle to get the size of.
|
|
19
21
|
* @param {Point} output - Optional point to store the result in.
|
|
20
22
|
* @returns {Point} The size of the rectangle as a point (width, height).
|
|
21
23
|
*/
|
|
22
|
-
export declare const size: (a:
|
|
24
|
+
export declare const size: (a: Rectangle, output?: Point) => Point;
|
|
23
25
|
/**
|
|
24
26
|
* Clones a rectangle.
|
|
25
27
|
* @param {Rectangle} input - The rectangle to clone.
|
|
26
28
|
* @param {Rectangle} output - Optional rectangle to store the result in.
|
|
27
29
|
* @returns {Rectangle} The cloned rectangle.
|
|
28
30
|
*/
|
|
29
|
-
export declare const clone: (input:
|
|
31
|
+
export declare const clone: (input: Rectangle, output?: Rectangle) => Rectangle;
|
|
30
32
|
/**
|
|
31
33
|
* Checks if a point is contained within the rectangle.
|
|
32
34
|
* @param {Rectangle} a - The rectangle to check.
|
|
@@ -34,7 +36,7 @@ export declare const clone: (input: any, output?: any) => any;
|
|
|
34
36
|
* @param {number} y - The y coordinate of the point.
|
|
35
37
|
* @returns {boolean} True if the point is contained within the rectangle, false otherwise.
|
|
36
38
|
*/
|
|
37
|
-
export declare const contains: (a:
|
|
39
|
+
export declare const contains: (a: Rectangle, x: number, y: number) => boolean;
|
|
38
40
|
/**
|
|
39
41
|
* Checks if a point is contained within the rectangle (raw version).
|
|
40
42
|
* @param {number} rx - The x coordinate of the rectangle.
|
|
@@ -45,42 +47,42 @@ export declare const contains: (a: any, x: any, y: any) => boolean;
|
|
|
45
47
|
* @param {number} y - The y coordinate of the point.
|
|
46
48
|
* @returns {boolean} True if the point is contained within the rectangle, false otherwise.
|
|
47
49
|
*/
|
|
48
|
-
export declare const containsRaw: (rx:
|
|
50
|
+
export declare const containsRaw: (rx: number, ry: number, rw: number, rh: number, x: number, y: number) => boolean;
|
|
49
51
|
/**
|
|
50
52
|
* Checks if a point is contained within the rectangle.
|
|
51
53
|
* @param {Rectangle} a - The rectangle to check.
|
|
52
54
|
* @param {Point} point - The point to check.
|
|
53
55
|
* @returns {boolean} True if the point is contained within the rectangle, false otherwise.
|
|
54
56
|
*/
|
|
55
|
-
export declare const containsPoint: (a:
|
|
57
|
+
export declare const containsPoint: (a: Rectangle, point: Point) => boolean;
|
|
56
58
|
/**
|
|
57
59
|
* Checks if rectangle a contains rectangle b.
|
|
58
60
|
* @param {Rectangle} a - The first rectangle to check.
|
|
59
61
|
* @param {Rectangle} b - The second rectangle to check.
|
|
60
62
|
* @returns {boolean} True if rectangle a contains rectangle b, false otherwise.
|
|
61
63
|
*/
|
|
62
|
-
export declare const containsRect: (a:
|
|
64
|
+
export declare const containsRect: (a: Rectangle, b: Rectangle) => boolean;
|
|
63
65
|
/**
|
|
64
66
|
* Checks if two rectangles are equal.
|
|
65
67
|
* @param {Rectangle} a - The first rectangle to compare.
|
|
66
68
|
* @param {Rectangle} b - The second rectangle to compare.
|
|
67
69
|
* @returns {boolean} True if the rectangles are equal, false otherwise.
|
|
68
70
|
*/
|
|
69
|
-
export declare const equals: (a:
|
|
71
|
+
export declare const equals: (a: Rectangle, b: Rectangle) => boolean;
|
|
70
72
|
/**
|
|
71
73
|
* Checks if two rectangles have the same dimensions.
|
|
72
74
|
* @param {Rectangle} a - The first rectangle to compare.
|
|
73
75
|
* @param {Rectangle} b - The second rectangle to compare.
|
|
74
76
|
* @returns {boolean} True if the rectangles have the same dimensions, false otherwise.
|
|
75
77
|
*/
|
|
76
|
-
export declare const sameDimensions: (a:
|
|
78
|
+
export declare const sameDimensions: (a: Rectangle, b: Rectangle) => boolean;
|
|
77
79
|
/**
|
|
78
80
|
* Checks if two rectangles intersect.
|
|
79
81
|
* @param {Rectangle} a - The first rectangle to check.
|
|
80
82
|
* @param {Rectangle} b - The second rectangle to check.
|
|
81
83
|
* @returns {boolean} True if the rectangles intersect, false otherwise.
|
|
82
84
|
*/
|
|
83
|
-
export declare const intersects: (a:
|
|
85
|
+
export declare const intersects: (a: Rectangle, b: Rectangle) => boolean;
|
|
84
86
|
/**
|
|
85
87
|
* Gets the intersection of two rectangles.
|
|
86
88
|
* @param {Rectangle} a - The first rectangle.
|
|
@@ -88,7 +90,7 @@ export declare const intersects: (a: any, b: any) => boolean;
|
|
|
88
90
|
* @param {Rectangle} output - Optional rectangle to store the result in.
|
|
89
91
|
* @returns {Rectangle} The intersection of the rectangles, or an empty rectangle if they don't intersect.
|
|
90
92
|
*/
|
|
91
|
-
export declare const intersection: (a:
|
|
93
|
+
export declare const intersection: (a: Rectangle, b: Rectangle, output?: Rectangle) => Rectangle;
|
|
92
94
|
/**
|
|
93
95
|
* Checks if a rectangle intersects with a set of raw coordinates.
|
|
94
96
|
* @param {Rectangle} a - The rectangle to check.
|
|
@@ -99,7 +101,7 @@ export declare const intersection: (a: any, b: any, output?: any) => any;
|
|
|
99
101
|
* @param {number} tolerance - Optional tolerance value for intersection.
|
|
100
102
|
* @returns {boolean} True if the rectangle intersects with the area, false otherwise.
|
|
101
103
|
*/
|
|
102
|
-
export declare const intersectsRaw: (a:
|
|
104
|
+
export declare const intersectsRaw: (a: Rectangle, left: number, right: number, top: number, bottom: number, tolerance?: number) => boolean;
|
|
103
105
|
/**
|
|
104
106
|
* Gets the union of two rectangles.
|
|
105
107
|
* @param {Rectangle} a - The first rectangle.
|
|
@@ -107,14 +109,14 @@ export declare const intersectsRaw: (a: any, left: any, right: any, top: any, bo
|
|
|
107
109
|
* @param {Rectangle} output - Optional rectangle to store the result in.
|
|
108
110
|
* @returns {Rectangle} The union of the rectangles.
|
|
109
111
|
*/
|
|
110
|
-
export declare const union: (a:
|
|
112
|
+
export declare const union: (a: Rectangle, b: Rectangle, output?: Rectangle) => Rectangle;
|
|
111
113
|
/**
|
|
112
114
|
* Gets the axis-aligned bounding box (AABB) of a set of points.
|
|
113
115
|
* @param {Point[]} points - The array of points to calculate the AABB for.
|
|
114
116
|
* @param {Rectangle} output - Optional rectangle to store the result in.
|
|
115
117
|
* @returns {Rectangle} The AABB of the points.
|
|
116
118
|
*/
|
|
117
|
-
export declare const aabb: (points:
|
|
119
|
+
export declare const aabb: (points: Point[], output?: Rectangle) => Rectangle;
|
|
118
120
|
/**
|
|
119
121
|
* Gets an empty rectangle instance.
|
|
120
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":"
|
|
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,GAAI,GAAG,SAAS,EAAE,IAAI,MAAM,EAAE,IAAI,MAAM,cAM3D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,GAAG,SAAS,EAAE,OAAO,GAAG,cAEpD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,GAAG,SAAS,EAAE,SAAQ,KAAY,UAItD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,EAAE,SAAQ,SAAgB,cAI/D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,GAAG,SAAS,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,YAK1D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,GAAI,IAAI,MAAM,EAAE,IAAI,MAAM,EAAE,IAAI,MAAM,EAAE,IAAI,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,YAE/F,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,GAAG,SAAS,EAAE,OAAO,KAAK,YAEvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,GAAG,SAAS,EAAE,GAAG,SAAS,YAKtD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAI,GAAG,SAAS,EAAE,GAAG,SAAS,YAEhD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,SAAS,EAAE,GAAG,SAAS,YAExD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,SAAS,EAAE,GAAG,SAAS,YAKpD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,GAAG,SAAS,EAAE,GAAG,SAAS,EAAE,SAAQ,SAAgB,cAShF,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GACxB,GAAG,SAAS,EACZ,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,KAAK,MAAM,EACX,QAAQ,MAAM,EACd,YAAW,MAAU,YAQtB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,GAAG,SAAS,EAAE,GAAG,SAAS,EAAE,SAAQ,SAAgB,cAQzE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,QAAQ,KAAK,EAAE,EAAE,SAAQ,SAAgB,cAsB7D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WAQ7B,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { RoundedRectangle } from '../rounded_rectangle.js';
|
|
1
2
|
/**
|
|
2
3
|
* Clones a rounded rectangle.
|
|
3
4
|
* @param {RoundedRectangle} input - The rounded rectangle to clone.
|
|
4
5
|
* @param {RoundedRectangle} output - Optional rounded rectangle to store the result in.
|
|
5
6
|
* @returns {RoundedRectangle} The cloned rounded rectangle.
|
|
6
7
|
*/
|
|
7
|
-
export declare const clone: (input:
|
|
8
|
+
export declare const clone: (input: RoundedRectangle, output?: RoundedRectangle) => RoundedRectangle;
|
|
8
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":"
|
|
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,GAAI,OAAO,gBAAgB,EAAE,SAAQ,gBAAuB,qBAQ7E,CAAC"}
|
|
@@ -1,140 +1,16 @@
|
|
|
1
1
|
export declare const DEG_TO_RAD: number;
|
|
2
2
|
export declare const RAD_TO_DEG: number;
|
|
3
3
|
export declare const PI_2: number;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
export declare const rgb2hex: (rgb: any) => number;
|
|
16
|
-
/**
|
|
17
|
-
* Gets the next power of two greater than or equal to a value.
|
|
18
|
-
* @param {number} value - The input value.
|
|
19
|
-
* @returns {number} The next power of two.
|
|
20
|
-
*/
|
|
21
|
-
export declare const getNextPowerOfTwo: (value: any) => any;
|
|
22
|
-
/**
|
|
23
|
-
* Checks if both width and height are powers of two.
|
|
24
|
-
* @param {number} width - The width to check.
|
|
25
|
-
* @param {number} height - The height to check.
|
|
26
|
-
* @returns {boolean} True if both width and height are powers of two, false otherwise.
|
|
27
|
-
*/
|
|
28
|
-
export declare const isPowerOfTwo: (width: any, height: any) => boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Converts degrees to radians.
|
|
31
|
-
* @param {number} degrees - The angle in degrees.
|
|
32
|
-
* @returns {number} The angle in radians.
|
|
33
|
-
*/
|
|
34
|
-
export declare const degToRad: (degrees: any) => number;
|
|
35
|
-
/**
|
|
36
|
-
* Converts radians to degrees.
|
|
37
|
-
* @param {number} radians - The angle in radians.
|
|
38
|
-
* @returns {number} The angle in degrees.
|
|
39
|
-
*/
|
|
40
|
-
export declare const radToDeg: (radians: any) => number;
|
|
41
|
-
/**
|
|
42
|
-
* Gets a random integer between min and max (inclusive).
|
|
43
|
-
* @param {number} min - The minimum value.
|
|
44
|
-
* @param {number} max - The maximum value.
|
|
45
|
-
* @returns {number} A random integer between min and max.
|
|
46
|
-
*/
|
|
47
|
-
export declare const between: (min: any, max: any) => number;
|
|
48
|
-
/**
|
|
49
|
-
* Snaps a value to the nearest multiple of gap, starting from start.
|
|
50
|
-
* @param {number} input - The value to snap.
|
|
51
|
-
* @param {number} gap - The gap size to snap to.
|
|
52
|
-
* @param {number} start - The starting offset for snapping.
|
|
53
|
-
* @returns {number} The snapped value.
|
|
54
|
-
*/
|
|
55
|
-
export declare const snapToCeil: (input: any, gap?: number, start?: number) => any;
|
|
56
|
-
/**
|
|
57
|
-
* Wraps a value within a range.
|
|
58
|
-
* @param {number} value - The value to wrap.
|
|
59
|
-
* @param {number} min - The minimum value of the range.
|
|
60
|
-
* @param {number} max - The maximum value of the range.
|
|
61
|
-
* @returns {number} The wrapped value.
|
|
62
|
-
*/
|
|
63
|
-
export declare const wrap: (value: any, min: any, max: any) => any;
|
|
64
|
-
/**
|
|
65
|
-
* Performs linear interpolation between two values.
|
|
66
|
-
* @param {number} p0 - The first point.
|
|
67
|
-
* @param {number} p1 - The second point.
|
|
68
|
-
* @param {number} t - The interpolation factor (0 to 1).
|
|
69
|
-
* @returns {number} The interpolated value.
|
|
70
|
-
*/
|
|
71
|
-
export declare const linear: (p0: any, p1: any, t: any) => any;
|
|
72
|
-
/**
|
|
73
|
-
* Calculates the absolute difference between two numbers.
|
|
74
|
-
* @param {number} a - The first number.
|
|
75
|
-
* @param {number} b - The second number.
|
|
76
|
-
* @returns {number} The absolute difference between a and b.
|
|
77
|
-
*/
|
|
78
|
-
export declare const difference: (a: any, b: any) => number;
|
|
79
|
-
/**
|
|
80
|
-
* Performs linear interpolation on an array of values.
|
|
81
|
-
* @param {number[]} v - The array of values.
|
|
82
|
-
* @param {number} k - The interpolation factor (0 to 1).
|
|
83
|
-
* @returns {number} The interpolated value.
|
|
84
|
-
*/
|
|
85
|
-
export declare const linearInterpolation: (v: any, k: any) => any;
|
|
86
|
-
/**
|
|
87
|
-
* Calculates the distance between two points.
|
|
88
|
-
* @param {number} x1 - The x-coordinate of the first point.
|
|
89
|
-
* @param {number} y1 - The y-coordinate of the first point.
|
|
90
|
-
* @param {number} x2 - The x-coordinate of the second point.
|
|
91
|
-
* @param {number} y2 - The y-coordinate of the second point.
|
|
92
|
-
* @returns {number} The distance between the two points.
|
|
93
|
-
*/
|
|
94
|
-
export declare const distance: (x1: any, y1: any, x2: any, y2: any) => number;
|
|
95
|
-
/**
|
|
96
|
-
* Checks if two numbers are within a tolerance of each other.
|
|
97
|
-
* @param {number} a - The first number.
|
|
98
|
-
* @param {number} b - The second number.
|
|
99
|
-
* @param {number} tolerance - The tolerance value.
|
|
100
|
-
* @returns {boolean} True if the numbers are within tolerance, false otherwise.
|
|
101
|
-
*/
|
|
102
|
-
export declare const within: (a: any, b: any, tolerance: any) => boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Creates a 32-bit color value from alpha, red, green, and blue components.
|
|
105
|
-
* @param {number} a - The alpha component (0-255).
|
|
106
|
-
* @param {number} r - The red component (0-255).
|
|
107
|
-
* @param {number} g - The green component (0-255).
|
|
108
|
-
* @param {number} b - The blue component (0-255).
|
|
109
|
-
* @returns {number} The 32-bit color value.
|
|
110
|
-
*/
|
|
111
|
-
export declare const getColor32: (a: any, r: any, g: any, b: any) => number;
|
|
112
|
-
/**
|
|
113
|
-
* Creates a 24-bit color value from red, green, and blue components.
|
|
114
|
-
* @param {number} r - The red component (0-255).
|
|
115
|
-
* @param {number} g - The green component (0-255).
|
|
116
|
-
* @param {number} b - The blue component (0-255).
|
|
117
|
-
* @returns {number} The 24-bit color value.
|
|
118
|
-
*/
|
|
119
|
-
export declare const getColor: (r: any, g: any, b: any) => number;
|
|
120
|
-
/**
|
|
121
|
-
* Converts a hex color string to RGB components.
|
|
122
|
-
* @param {string} value - The hex color string (e.g. "#FF0000").
|
|
123
|
-
* @param {{r?: number, g?: number, b?: number}} out - The object to store the result in.
|
|
124
|
-
*/
|
|
125
|
-
export declare const hexToColor: (value: any, out: any) => void;
|
|
126
|
-
/**
|
|
127
|
-
* Converts a web color string (e.g. "rgb(255, 0, 0)") to RGB components with alpha.
|
|
128
|
-
* @param {string} value - The web color string (e.g. "rgba(255, 0, 0, 0.5)").
|
|
129
|
-
* @param {{r?: number, g?: number, b?: number, a?: number}} out - The object to store the result in.
|
|
130
|
-
*/
|
|
131
|
-
export declare const webToColor: (value: any, out: any) => void;
|
|
132
|
-
/**
|
|
133
|
-
* Extracts RGB components from a 32-bit color value.
|
|
134
|
-
* @param {number} color - The 32-bit color value.
|
|
135
|
-
* @returns {{ alpha: number, red: number, green: number, blue: number, a: number, r: number, g: number, b: number}} An object containing the color components.
|
|
136
|
-
*/
|
|
137
|
-
export declare const getRGB: (color: any) => {
|
|
4
|
+
export interface ColorTarget {
|
|
5
|
+
r?: number;
|
|
6
|
+
g?: number;
|
|
7
|
+
b?: number;
|
|
8
|
+
a?: number;
|
|
9
|
+
rgba?: string;
|
|
10
|
+
color?: number;
|
|
11
|
+
color32?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ColorComponents {
|
|
138
14
|
alpha: number;
|
|
139
15
|
red: number;
|
|
140
16
|
green: number;
|
|
@@ -143,12 +19,45 @@ export declare const getRGB: (color: any) => {
|
|
|
143
19
|
r: number;
|
|
144
20
|
g: number;
|
|
145
21
|
b: number;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
22
|
+
}
|
|
23
|
+
/** Converts a hexadecimal color value to RGB components. */
|
|
24
|
+
export declare const hex2rgb: (hex: number) => [number, number, number];
|
|
25
|
+
/** Converts RGB components to a hexadecimal color value. */
|
|
26
|
+
export declare const rgb2hex: (rgb: number[]) => number;
|
|
27
|
+
/** Gets the next power of two greater than or equal to a value. */
|
|
28
|
+
export declare const getNextPowerOfTwo: (value: number) => number;
|
|
29
|
+
/** Checks if both width and height are powers of two. */
|
|
30
|
+
export declare const isPowerOfTwo: (width: number, height: number) => boolean;
|
|
31
|
+
/** Converts degrees to radians. */
|
|
32
|
+
export declare const degToRad: (degrees: number) => number;
|
|
33
|
+
/** Converts radians to degrees. */
|
|
34
|
+
export declare const radToDeg: (radians: number) => number;
|
|
35
|
+
/** Gets a random integer between min and max (inclusive). */
|
|
36
|
+
export declare const between: (min: number, max: number) => number;
|
|
37
|
+
/** Snaps a value to the nearest multiple of gap, starting from start. */
|
|
38
|
+
export declare const snapToCeil: (input: number, gap?: number, start?: number) => number;
|
|
39
|
+
/** Wraps a value within a range. */
|
|
40
|
+
export declare const wrap: (value: number, min: number, max: number) => number;
|
|
41
|
+
/** Performs linear interpolation between two values. */
|
|
42
|
+
export declare const linear: (p0: number, p1: number, t: number) => number;
|
|
43
|
+
/** Calculates the absolute difference between two numbers. */
|
|
44
|
+
export declare const difference: (a: number, b: number) => number;
|
|
45
|
+
/** Performs linear interpolation on an array of values. */
|
|
46
|
+
export declare const linearInterpolation: (v: number[], k: number) => number;
|
|
47
|
+
/** Calculates the distance between two points. */
|
|
48
|
+
export declare const distance: (x1: number, y1: number, x2: number, y2: number) => number;
|
|
49
|
+
/** Checks if two numbers are within a tolerance of each other. */
|
|
50
|
+
export declare const within: (a: number, b: number, tolerance: number) => boolean;
|
|
51
|
+
/** Creates a 32-bit color value from alpha, red, green, and blue components. */
|
|
52
|
+
export declare const getColor32: (a: number, r: number, g: number, b: number) => number;
|
|
53
|
+
/** Creates a 24-bit color value from red, green, and blue components. */
|
|
54
|
+
export declare const getColor: (r: number, g: number, b: number) => number;
|
|
55
|
+
/** Converts a hex color string to RGB components. */
|
|
56
|
+
export declare const hexToColor: (value: string, out: ColorTarget) => void;
|
|
57
|
+
/** Converts a web color string (e.g. "rgb(255, 0, 0)") to RGB components with alpha. */
|
|
58
|
+
export declare const webToColor: (value: string, out: ColorTarget) => void;
|
|
59
|
+
/** Extracts RGB components from a 32-bit color value. */
|
|
60
|
+
export declare const getRGB: (color: number) => ColorComponents;
|
|
61
|
+
/** Converts a color value (string or number) to an object with various color formats. */
|
|
62
|
+
export declare const valueToColor: (value: string | number, out: ColorTarget) => ColorTarget;
|
|
154
63
|
//# sourceMappingURL=math.d.ts.map
|
|
@@ -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
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../src/phaser/util/math.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vpmedia/phaser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.106.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",
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@vpmedia/simplify": "^1.76.0",
|
|
38
|
-
"uuid": "^14.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.
|
|
41
|
+
"@commitlint/cli": "^21.2.0",
|
|
42
|
+
"@commitlint/config-conventional": "^21.2.0",
|
|
43
|
+
"@commitlint/types": "^21.2.0",
|
|
44
|
+
"@types/node": "^26.1.0",
|
|
45
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
46
|
+
"happy-dom": "^20.10.6",
|
|
47
|
+
"oxfmt": "^0.57.0",
|
|
48
|
+
"oxlint": "^1.72.0",
|
|
49
|
+
"oxlint-tsgolint": "^0.24.0",
|
|
50
|
+
"rolldown": "^1.1.4",
|
|
51
51
|
"typescript": "^6.0.3",
|
|
52
|
-
"vitest": "^4.1.
|
|
52
|
+
"vitest": "^4.1.9"
|
|
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
|
|
@@ -1,53 +1,29 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import { Signal } from './signal.js';
|
|
3
2
|
|
|
4
3
|
export class Animation {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
_pauseStartTime;
|
|
29
|
-
/** @type {number} */
|
|
30
|
-
_frameIndex;
|
|
31
|
-
/** @type {number} */
|
|
32
|
-
_frameDiff;
|
|
33
|
-
/** @type {number} */
|
|
34
|
-
_frameSkip;
|
|
35
|
-
/** @type {import('./frame.js').Frame} */
|
|
36
|
-
currentFrame;
|
|
37
|
-
/** @type {Signal} */
|
|
38
|
-
onStart;
|
|
39
|
-
/** @type {Signal | null} */
|
|
40
|
-
onUpdate;
|
|
41
|
-
/** @type {Signal} */
|
|
42
|
-
onComplete;
|
|
43
|
-
/** @type {Signal} */
|
|
44
|
-
onLoop;
|
|
45
|
-
/** @type {boolean} */
|
|
46
|
-
isReversed;
|
|
47
|
-
/** @type {number} */
|
|
48
|
-
_timeLastFrame;
|
|
49
|
-
/** @type {number} */
|
|
50
|
-
_timeNextFrame;
|
|
4
|
+
game!: import('./game.js').Game;
|
|
5
|
+
_parent!: import('../display/image.js').Image;
|
|
6
|
+
_frameData!: import('./frame_data.js').FrameData;
|
|
7
|
+
name!: string;
|
|
8
|
+
_frames!: any;
|
|
9
|
+
delay!: number;
|
|
10
|
+
loop!: boolean;
|
|
11
|
+
loopCount!: number;
|
|
12
|
+
isFinished!: boolean;
|
|
13
|
+
isPlaying!: boolean;
|
|
14
|
+
isPaused!: boolean;
|
|
15
|
+
_pauseStartTime!: number;
|
|
16
|
+
_frameIndex!: number;
|
|
17
|
+
_frameDiff!: number;
|
|
18
|
+
_frameSkip!: number;
|
|
19
|
+
currentFrame!: import('./frame.js').Frame;
|
|
20
|
+
onStart!: Signal;
|
|
21
|
+
onUpdate!: Signal | null;
|
|
22
|
+
onComplete!: Signal;
|
|
23
|
+
onLoop!: Signal;
|
|
24
|
+
isReversed!: boolean;
|
|
25
|
+
_timeLastFrame!: number;
|
|
26
|
+
_timeNextFrame!: number;
|
|
51
27
|
/**
|
|
52
28
|
* Creates a new Animation instance.
|
|
53
29
|
* @param {import('./game.js').Game} game - The game instance this animation belongs to.
|
|
@@ -58,7 +34,15 @@ export class Animation {
|
|
|
58
34
|
* @param {number} frameRate - The frame rate at which this animation should play (frames per second).
|
|
59
35
|
* @param {boolean} loop - Whether the animation should loop when it completes.
|
|
60
36
|
*/
|
|
61
|
-
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
|
+
) {
|
|
62
46
|
/** @type {import('./game.js').Game} */
|
|
63
47
|
this.game = game;
|
|
64
48
|
this._parent = parent;
|
|
@@ -110,7 +94,7 @@ export class Animation {
|
|
|
110
94
|
* @param {boolean} loop - Whether to loop this animation (if null, uses the original loop setting).
|
|
111
95
|
* @returns {Animation} This Animation instance for chaining.
|
|
112
96
|
*/
|
|
113
|
-
play(frameRate = null, loop = null) {
|
|
97
|
+
play(frameRate: number = null, loop: boolean = null) {
|
|
114
98
|
if (typeof frameRate === 'number') {
|
|
115
99
|
// If they set a new frame rate then use it, otherwise use the one set on creation
|
|
116
100
|
this.delay = 1000 / frameRate;
|
|
@@ -167,7 +151,8 @@ export class Animation {
|
|
|
167
151
|
*/
|
|
168
152
|
reverseOnce() {
|
|
169
153
|
this.onComplete.addOnce(this.reverse, this);
|
|
170
|
-
|
|
154
|
+
this.reverse();
|
|
155
|
+
return this;
|
|
171
156
|
}
|
|
172
157
|
|
|
173
158
|
/**
|
|
@@ -175,7 +160,7 @@ export class Animation {
|
|
|
175
160
|
* @param {string|number} frameId - The identifier (name or index) of the frame to set.
|
|
176
161
|
* @param {boolean} useLocalFrameIndex - If true, treats frameId as an index into the local frames array.
|
|
177
162
|
*/
|
|
178
|
-
setFrame(frameId, useLocalFrameIndex = false) {
|
|
163
|
+
setFrame(frameId: string | number, useLocalFrameIndex: boolean = false) {
|
|
179
164
|
let frameIndex;
|
|
180
165
|
// Find the index to the desired frame.
|
|
181
166
|
if (typeof frameId === 'string') {
|
|
@@ -209,7 +194,7 @@ export class Animation {
|
|
|
209
194
|
* @param {boolean} resetFrame - If true, resets to the first frame.
|
|
210
195
|
* @param {boolean} dispatchComplete - If true, dispatches the onComplete signal.
|
|
211
196
|
*/
|
|
212
|
-
stop(resetFrame = false, dispatchComplete = false) {
|
|
197
|
+
stop(resetFrame: boolean = false, dispatchComplete: boolean = false) {
|
|
213
198
|
this.isPlaying = false;
|
|
214
199
|
this.isFinished = true;
|
|
215
200
|
this.paused = false;
|
|
@@ -308,7 +293,7 @@ export class Animation {
|
|
|
308
293
|
* @param {boolean} fromPlay - Whether this call is from play().
|
|
309
294
|
* @returns {boolean} True if the frame was updated, false otherwise.
|
|
310
295
|
*/
|
|
311
|
-
updateCurrentFrame(signalUpdate, fromPlay = false) {
|
|
296
|
+
updateCurrentFrame(signalUpdate: boolean, fromPlay: boolean = false) {
|
|
312
297
|
if (!this._frameData || !this.currentFrame) {
|
|
313
298
|
// The animation is already destroyed, probably from a callback
|
|
314
299
|
return false;
|
|
@@ -331,7 +316,7 @@ export class Animation {
|
|
|
331
316
|
* Advances the animation to the next frame(s).
|
|
332
317
|
* @param {number} quantity - The number of frames to advance by.
|
|
333
318
|
*/
|
|
334
|
-
next(quantity = 1) {
|
|
319
|
+
next(quantity: number = 1) {
|
|
335
320
|
let frame = this._frameIndex + quantity;
|
|
336
321
|
if (frame >= this._frames.length) {
|
|
337
322
|
if (this.loop) {
|
|
@@ -350,7 +335,7 @@ export class Animation {
|
|
|
350
335
|
* Moves the animation to the previous frame(s).
|
|
351
336
|
* @param {number} quantity - The number of frames to move back by.
|
|
352
337
|
*/
|
|
353
|
-
previous(quantity = 1) {
|
|
338
|
+
previous(quantity: number = 1) {
|
|
354
339
|
let frame = this._frameIndex - quantity;
|
|
355
340
|
if (frame < 0) {
|
|
356
341
|
if (this.loop) {
|
|
@@ -369,7 +354,7 @@ export class Animation {
|
|
|
369
354
|
* Updates the frame data used by this animation.
|
|
370
355
|
* @param {import('./frame_data.js').FrameData} frameData - The new FrameData object to use.
|
|
371
356
|
*/
|
|
372
|
-
updateFrameData(frameData) {
|
|
357
|
+
updateFrameData(frameData: import('./frame_data.js').FrameData) {
|
|
373
358
|
this._frameData = frameData;
|
|
374
359
|
this.currentFrame = this._frameData
|
|
375
360
|
? this._frameData.getFrame(this._frames[this._frameIndex % this._frames.length])
|
|
@@ -425,7 +410,7 @@ export class Animation {
|
|
|
425
410
|
* Sets whether this animation is currently paused.
|
|
426
411
|
* @param {boolean} value - True to pause the animation, false to resume it.
|
|
427
412
|
*/
|
|
428
|
-
set paused(value) {
|
|
413
|
+
set paused(value: boolean) {
|
|
429
414
|
this.isPaused = value;
|
|
430
415
|
if (value) {
|
|
431
416
|
this._pauseStartTime = this.game.time.time;
|
|
@@ -446,7 +431,7 @@ export class Animation {
|
|
|
446
431
|
* Sets whether this animation is currently reversed.
|
|
447
432
|
* @param {boolean} value - True to reverse the animation, false to normal direction.
|
|
448
433
|
*/
|
|
449
|
-
set reversed(value) {
|
|
434
|
+
set reversed(value: boolean) {
|
|
450
435
|
this.isReversed = value;
|
|
451
436
|
}
|
|
452
437
|
|
|
@@ -473,7 +458,7 @@ export class Animation {
|
|
|
473
458
|
* Sets the current frame index.
|
|
474
459
|
* @param {number} value - The new frame index to set.
|
|
475
460
|
*/
|
|
476
|
-
set frame(value) {
|
|
461
|
+
set frame(value: number) {
|
|
477
462
|
this.currentFrame = this._frameData.getFrame(this._frames[value]);
|
|
478
463
|
if (this.currentFrame !== null) {
|
|
479
464
|
this._frameIndex = value;
|
|
@@ -496,7 +481,7 @@ export class Animation {
|
|
|
496
481
|
* Sets the animation speed (frame rate).
|
|
497
482
|
* @param {number} value - The new frame rate in frames per second.
|
|
498
483
|
*/
|
|
499
|
-
set speed(value) {
|
|
484
|
+
set speed(value: number) {
|
|
500
485
|
if (value > 0) {
|
|
501
486
|
this.delay = 1000 / value;
|
|
502
487
|
}
|
|
@@ -514,7 +499,7 @@ export class Animation {
|
|
|
514
499
|
* Sets whether the update signal is enabled.
|
|
515
500
|
* @param {boolean} value - True to enable the update signal, false to disable it.
|
|
516
501
|
*/
|
|
517
|
-
set enableUpdate(value) {
|
|
502
|
+
set enableUpdate(value: boolean) {
|
|
518
503
|
if (value && this.onUpdate === null) {
|
|
519
504
|
this.onUpdate = new Signal();
|
|
520
505
|
} else if (!value && this.onUpdate !== null) {
|