@vpmedia/phaser 1.95.0 → 1.97.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/CHANGELOG.md +51 -0
- package/package.json +10 -10
- package/src/phaser/core/animation.js +61 -56
- package/src/phaser/core/animation_manager.js +55 -55
- package/src/phaser/core/cache.js +154 -154
- package/src/phaser/core/device.js +2 -1
- package/src/phaser/core/device_util.js +27 -27
- package/src/phaser/core/dom.js +43 -43
- package/src/phaser/core/event_manager.js +63 -63
- package/src/phaser/core/factory.js +47 -47
- package/src/phaser/core/frame.js +30 -30
- package/src/phaser/core/frame_data.js +30 -28
- package/src/phaser/core/frame_util.js +8 -8
- package/src/phaser/core/game.js +34 -18
- package/src/phaser/core/loader.js +170 -170
- package/src/phaser/core/loader_parser.js +22 -22
- package/src/phaser/core/raf.js +1 -1
- package/src/phaser/core/scene.js +16 -10
- package/src/phaser/core/scene_manager.js +51 -43
- package/src/phaser/core/signal.js +68 -52
- package/src/phaser/core/signal.test.js +37 -0
- package/src/phaser/core/sound.js +54 -54
- package/src/phaser/core/sound_manager.js +49 -49
- package/src/phaser/core/stage.js +16 -16
- package/src/phaser/core/time.js +30 -30
- package/src/phaser/core/timer.js +79 -64
- package/src/phaser/core/timer_event.js +9 -9
- package/src/phaser/core/tween.js +90 -90
- package/src/phaser/core/tween_data.js +30 -30
- package/src/phaser/core/tween_manager.js +29 -24
- package/src/phaser/core/world.js +4 -3
- package/src/phaser/display/bitmap_text.js +61 -54
- package/src/phaser/display/button.js +48 -47
- package/src/phaser/display/canvas/buffer.js +8 -8
- package/src/phaser/display/canvas/graphics.js +8 -8
- package/src/phaser/display/canvas/masker.js +5 -5
- package/src/phaser/display/canvas/pool.js +18 -18
- package/src/phaser/display/canvas/renderer.js +16 -16
- package/src/phaser/display/canvas/tinter.js +22 -22
- package/src/phaser/display/canvas/util.js +42 -42
- package/src/phaser/display/display_object.js +119 -108
- package/src/phaser/display/graphics.js +112 -112
- package/src/phaser/display/graphics_data.js +10 -10
- package/src/phaser/display/graphics_data_util.js +3 -3
- package/src/phaser/display/group.js +50 -50
- package/src/phaser/display/image.js +54 -50
- package/src/phaser/display/sprite_batch.js +2 -2
- package/src/phaser/display/sprite_util.js +19 -19
- package/src/phaser/display/text.js +212 -187
- package/src/phaser/display/webgl/abstract_filter.js +4 -4
- package/src/phaser/display/webgl/base_texture.js +9 -9
- package/src/phaser/display/webgl/blend_manager.js +7 -7
- package/src/phaser/display/webgl/earcut.js +95 -95
- package/src/phaser/display/webgl/earcut_node.js +4 -4
- package/src/phaser/display/webgl/fast_sprite_batch.js +15 -15
- package/src/phaser/display/webgl/filter_manager.js +9 -9
- package/src/phaser/display/webgl/filter_texture.js +10 -10
- package/src/phaser/display/webgl/graphics.js +37 -37
- package/src/phaser/display/webgl/graphics_data.js +4 -4
- package/src/phaser/display/webgl/mask_manager.js +6 -6
- package/src/phaser/display/webgl/render_texture.js +16 -16
- package/src/phaser/display/webgl/renderer.js +20 -20
- package/src/phaser/display/webgl/shader/complex.js +4 -4
- package/src/phaser/display/webgl/shader/fast.js +4 -4
- package/src/phaser/display/webgl/shader/normal.js +8 -8
- package/src/phaser/display/webgl/shader/primitive.js +4 -4
- package/src/phaser/display/webgl/shader/strip.js +4 -4
- package/src/phaser/display/webgl/shader_manager.js +9 -9
- package/src/phaser/display/webgl/sprite_batch.js +18 -18
- package/src/phaser/display/webgl/stencil_manager.js +16 -16
- package/src/phaser/display/webgl/texture.js +13 -13
- package/src/phaser/display/webgl/texture_util.js +8 -8
- package/src/phaser/display/webgl/util.js +25 -25
- package/src/phaser/geom/circle.js +69 -69
- package/src/phaser/geom/circle.test.js +1 -0
- package/src/phaser/geom/ellipse.js +28 -28
- package/src/phaser/geom/ellipse.test.js +1 -0
- package/src/phaser/geom/line.js +93 -93
- package/src/phaser/geom/line.test.js +1 -0
- package/src/phaser/geom/matrix.js +54 -54
- package/src/phaser/geom/matrix.test.js +1 -0
- package/src/phaser/geom/point.js +96 -96
- package/src/phaser/geom/point.test.js +1 -0
- package/src/phaser/geom/polygon.js +22 -22
- package/src/phaser/geom/rectangle.js +132 -132
- package/src/phaser/geom/rectangle.test.js +1 -0
- package/src/phaser/geom/rounded_rectangle.js +12 -12
- package/src/phaser/geom/rounded_rectangle.test.js +1 -0
- package/src/phaser/geom/util/circle.js +33 -33
- package/src/phaser/geom/util/circle.test.js +1 -0
- package/src/phaser/geom/util/ellipse.js +5 -5
- package/src/phaser/geom/util/ellipse.test.js +1 -0
- package/src/phaser/geom/util/line.js +26 -26
- package/src/phaser/geom/util/line.test.js +1 -0
- package/src/phaser/geom/util/matrix.js +8 -8
- package/src/phaser/geom/util/matrix.test.js +1 -0
- package/src/phaser/geom/util/point.js +97 -97
- package/src/phaser/geom/util/point.test.js +1 -0
- package/src/phaser/geom/util/polygon.js +4 -4
- package/src/phaser/geom/util/polygon.test.js +1 -0
- package/src/phaser/geom/util/rectangle.js +74 -74
- package/src/phaser/geom/util/rectangle.test.js +1 -0
- package/src/phaser/geom/util/rounded_rectangle.js +4 -4
- package/src/phaser/geom/util/rounded_rectangle.test.js +1 -0
- package/src/phaser/util/math.js +81 -81
- package/src/phaser/util/math.test.js +1 -0
- package/types/phaser/core/animation.d.ts +61 -56
- package/types/phaser/core/animation.d.ts.map +1 -1
- package/types/phaser/core/animation_manager.d.ts +55 -55
- package/types/phaser/core/cache.d.ts +154 -154
- package/types/phaser/core/device.d.ts.map +1 -1
- package/types/phaser/core/dom.d.ts +43 -43
- package/types/phaser/core/event_manager.d.ts +63 -63
- package/types/phaser/core/factory.d.ts +47 -47
- package/types/phaser/core/frame.d.ts +30 -30
- package/types/phaser/core/frame_data.d.ts +28 -27
- package/types/phaser/core/frame_data.d.ts.map +1 -1
- package/types/phaser/core/game.d.ts +52 -19
- package/types/phaser/core/game.d.ts.map +1 -1
- package/types/phaser/core/loader.d.ts +170 -170
- package/types/phaser/core/loader_parser.d.ts.map +1 -1
- package/types/phaser/core/raf.d.ts +1 -1
- package/types/phaser/core/scene.d.ts +15 -9
- package/types/phaser/core/scene.d.ts.map +1 -1
- package/types/phaser/core/scene_manager.d.ts +51 -43
- package/types/phaser/core/scene_manager.d.ts.map +1 -1
- package/types/phaser/core/signal.d.ts +54 -51
- package/types/phaser/core/signal.d.ts.map +1 -1
- package/types/phaser/core/sound.d.ts +54 -54
- package/types/phaser/core/sound_manager.d.ts +49 -49
- package/types/phaser/core/stage.d.ts +10 -10
- package/types/phaser/core/time.d.ts +30 -30
- package/types/phaser/core/timer.d.ts +64 -64
- package/types/phaser/core/timer_event.d.ts +9 -9
- package/types/phaser/core/tween.d.ts +90 -90
- package/types/phaser/core/tween_data.d.ts +30 -30
- package/types/phaser/core/tween_manager.d.ts +29 -24
- package/types/phaser/core/tween_manager.d.ts.map +1 -1
- package/types/phaser/core/world.d.ts +4 -3
- package/types/phaser/core/world.d.ts.map +1 -1
- package/types/phaser/display/bitmap_text.d.ts +59 -52
- package/types/phaser/display/bitmap_text.d.ts.map +1 -1
- package/types/phaser/display/button.d.ts +47 -46
- package/types/phaser/display/button.d.ts.map +1 -1
- package/types/phaser/display/canvas/buffer.d.ts +8 -8
- package/types/phaser/display/canvas/renderer.d.ts +16 -16
- package/types/phaser/display/display_object.d.ts +119 -108
- package/types/phaser/display/display_object.d.ts.map +1 -1
- package/types/phaser/display/graphics.d.ts +101 -101
- package/types/phaser/display/graphics_data.d.ts +10 -10
- package/types/phaser/display/group.d.ts +47 -47
- package/types/phaser/display/image.d.ts +42 -40
- package/types/phaser/display/image.d.ts.map +1 -1
- package/types/phaser/display/text.d.ts +207 -184
- package/types/phaser/display/text.d.ts.map +1 -1
- package/types/phaser/display/webgl/abstract_filter.d.ts +4 -4
- package/types/phaser/display/webgl/base_texture.d.ts +9 -9
- package/types/phaser/display/webgl/blend_manager.d.ts +6 -6
- package/types/phaser/display/webgl/earcut.d.ts +95 -95
- package/types/phaser/display/webgl/earcut_node.d.ts +4 -4
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts +15 -15
- package/types/phaser/display/webgl/filter_manager.d.ts +8 -8
- package/types/phaser/display/webgl/filter_texture.d.ts +10 -10
- package/types/phaser/display/webgl/graphics_data.d.ts +4 -4
- package/types/phaser/display/webgl/render_texture.d.ts +16 -16
- package/types/phaser/display/webgl/renderer.d.ts +20 -20
- package/types/phaser/display/webgl/shader/complex.d.ts +4 -4
- package/types/phaser/display/webgl/shader/fast.d.ts +4 -4
- package/types/phaser/display/webgl/shader/normal.d.ts +8 -8
- package/types/phaser/display/webgl/shader/primitive.d.ts +4 -4
- package/types/phaser/display/webgl/shader/strip.d.ts +4 -4
- package/types/phaser/display/webgl/shader_manager.d.ts +8 -8
- package/types/phaser/display/webgl/sprite_batch.d.ts +17 -17
- package/types/phaser/display/webgl/stencil_manager.d.ts +15 -15
- package/types/phaser/display/webgl/texture.d.ts +12 -12
- package/types/phaser/geom/circle.d.ts +69 -69
- package/types/phaser/geom/ellipse.d.ts +28 -28
- package/types/phaser/geom/line.d.ts +93 -93
- package/types/phaser/geom/matrix.d.ts +54 -54
- package/types/phaser/geom/point.d.ts +96 -96
- package/types/phaser/geom/polygon.d.ts +22 -22
- package/types/phaser/geom/rectangle.d.ts +132 -132
- package/types/phaser/geom/rounded_rectangle.d.ts +12 -12
- package/pnpm-workspace.yaml +0 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export class Circle {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @param {number} x -
|
|
5
|
-
* @param {number} y -
|
|
6
|
-
* @param {number} diameter -
|
|
3
|
+
* Creates a new Circle instance.
|
|
4
|
+
* @param {number} x - The x coordinate of the center point (default: 0).
|
|
5
|
+
* @param {number} y - The y coordinate of the center point (default: 0).
|
|
6
|
+
* @param {number} diameter - The diameter of the circle (default: 0).
|
|
7
7
|
*/
|
|
8
8
|
constructor(x?: number, y?: number, diameter?: number);
|
|
9
9
|
/** @type {number} */
|
|
@@ -17,152 +17,152 @@ export class Circle {
|
|
|
17
17
|
/** @type {number} */
|
|
18
18
|
type: number;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
* @returns {number}
|
|
20
|
+
* Calculates the circumference of this circle.
|
|
21
|
+
* @returns {number} The circumference of this circle.
|
|
22
22
|
*/
|
|
23
23
|
circumference(): number;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* @param {Point} output -
|
|
27
|
-
* @returns {Point}
|
|
25
|
+
* Returns a random point within this circle.
|
|
26
|
+
* @param {Point} output - The point to store the result in (optional).
|
|
27
|
+
* @returns {Point} A random point within this circle.
|
|
28
28
|
*/
|
|
29
29
|
random(output?: Point): Point;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
* @returns {Rectangle}
|
|
31
|
+
* Gets the bounding rectangle of this circle.
|
|
32
|
+
* @returns {Rectangle} The bounding rectangle of this circle.
|
|
33
33
|
*/
|
|
34
34
|
getBounds(): Rectangle;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
* @param {number} x -
|
|
38
|
-
* @param {number} y -
|
|
39
|
-
* @param {number} diameter -
|
|
40
|
-
* @returns {Circle}
|
|
36
|
+
* Sets the position and size of this circle to new values.
|
|
37
|
+
* @param {number} x - The new x coordinate of the center point.
|
|
38
|
+
* @param {number} y - The new y coordinate of the center point.
|
|
39
|
+
* @param {number} diameter - The new diameter of the circle.
|
|
40
|
+
* @returns {Circle} This circle instance for chaining.
|
|
41
41
|
*/
|
|
42
42
|
setTo(x: number, y: number, diameter: number): Circle;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
45
|
-
* @param {Circle} source -
|
|
46
|
-
* @returns {Circle}
|
|
44
|
+
* Copies the values from another circle to this circle.
|
|
45
|
+
* @param {Circle} source - The circle to copy values from.
|
|
46
|
+
* @returns {Circle} This circle instance for chaining.
|
|
47
47
|
*/
|
|
48
48
|
copyFrom(source: Circle): Circle;
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @param {Circle} dest -
|
|
52
|
-
* @returns {Circle}
|
|
50
|
+
* Copies the values of this circle to another circle.
|
|
51
|
+
* @param {Circle} dest - The circle to copy values to.
|
|
52
|
+
* @returns {Circle} The destination circle.
|
|
53
53
|
*/
|
|
54
54
|
copyTo(dest: Circle): Circle;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
57
|
-
* @param {Circle} dest -
|
|
58
|
-
* @param {boolean} round -
|
|
59
|
-
* @returns {number}
|
|
56
|
+
* Calculates the distance between this circle and another circle.
|
|
57
|
+
* @param {Circle} dest - The other circle to calculate the distance to.
|
|
58
|
+
* @param {boolean} round - Whether to round the result (default: false).
|
|
59
|
+
* @returns {number} The distance between the circles.
|
|
60
60
|
*/
|
|
61
61
|
distance(dest: Circle, round?: boolean): number;
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
64
|
-
* @returns {Circle}
|
|
63
|
+
* Creates a clone of this circle.
|
|
64
|
+
* @returns {Circle} A new circle with the same values as this one.
|
|
65
65
|
*/
|
|
66
66
|
clone(): Circle;
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
69
|
-
* @param {number} x -
|
|
70
|
-
* @param {number} y -
|
|
71
|
-
* @returns {boolean}
|
|
68
|
+
* Checks if the specified point is contained within this circle.
|
|
69
|
+
* @param {number} x - The x coordinate of the point to check.
|
|
70
|
+
* @param {number} y - The y coordinate of the point to check.
|
|
71
|
+
* @returns {boolean} True if the point is contained within this circle, false otherwise.
|
|
72
72
|
*/
|
|
73
73
|
contains(x: number, y: number): boolean;
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
76
|
-
* @param {number} angle -
|
|
77
|
-
* @param {boolean} asDegrees -
|
|
78
|
-
* @param {Point} out -
|
|
79
|
-
* @returns {Point}
|
|
75
|
+
* Gets a point at a specific angle on the circumference of this circle.
|
|
76
|
+
* @param {number} angle - The angle in radians (or degrees if asDegrees is true) to get the point for.
|
|
77
|
+
* @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false).
|
|
78
|
+
* @param {Point} out - The point to store the result in (optional).
|
|
79
|
+
* @returns {Point} A point at the specified angle on the circumference of this circle.
|
|
80
80
|
*/
|
|
81
81
|
circumferencePoint(angle: number, asDegrees: boolean, out: Point): Point;
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
84
|
-
* @param {number} dx -
|
|
85
|
-
* @param {number} dy -
|
|
86
|
-
* @returns {Circle}
|
|
83
|
+
* Offsets the position of this circle by the specified amounts.
|
|
84
|
+
* @param {number} dx - The amount to offset the x coordinate by.
|
|
85
|
+
* @param {number} dy - The amount to offset the y coordinate by.
|
|
86
|
+
* @returns {Circle} This circle instance for chaining.
|
|
87
87
|
*/
|
|
88
88
|
offset(dx: number, dy: number): Circle;
|
|
89
89
|
/**
|
|
90
|
-
*
|
|
91
|
-
* @param {Point} point -
|
|
92
|
-
* @returns {Circle}
|
|
90
|
+
* Offsets the position of this circle by the specified point coordinates.
|
|
91
|
+
* @param {Point} point - The point to offset the circle by.
|
|
92
|
+
* @returns {Circle} This circle instance for chaining.
|
|
93
93
|
*/
|
|
94
94
|
offsetPoint(point: Point): Circle;
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
97
|
-
* @returns {string}
|
|
96
|
+
* Returns a string representation of this circle.
|
|
97
|
+
* @returns {string} A string representation of the circle.
|
|
98
98
|
*/
|
|
99
99
|
toString(): string;
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* Sets the diameter of this circle.
|
|
102
102
|
*/
|
|
103
103
|
set diameter(value: number);
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
106
|
-
* @returns {number}
|
|
105
|
+
* Gets the diameter of this circle.
|
|
106
|
+
* @returns {number} The diameter of this circle.
|
|
107
107
|
*/
|
|
108
108
|
get diameter(): number;
|
|
109
109
|
/**
|
|
110
|
-
*
|
|
110
|
+
* Sets the radius of this circle.
|
|
111
111
|
*/
|
|
112
112
|
set radius(value: number);
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
115
|
-
* @returns {number}
|
|
114
|
+
* Gets the radius of this circle.
|
|
115
|
+
* @returns {number} The radius of this circle.
|
|
116
116
|
*/
|
|
117
117
|
get radius(): number;
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
119
|
+
* Sets the left coordinate of this circle.
|
|
120
120
|
*/
|
|
121
121
|
set left(value: number);
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
124
|
-
* @returns {number}
|
|
123
|
+
* Gets the left coordinate of this circle.
|
|
124
|
+
* @returns {number} The left coordinate of this circle.
|
|
125
125
|
*/
|
|
126
126
|
get left(): number;
|
|
127
127
|
/**
|
|
128
|
-
*
|
|
128
|
+
* Sets the right coordinate of this circle.
|
|
129
129
|
*/
|
|
130
130
|
set right(value: number);
|
|
131
131
|
/**
|
|
132
|
-
*
|
|
133
|
-
* @returns {number}
|
|
132
|
+
* Gets the right coordinate of this circle.
|
|
133
|
+
* @returns {number} The right coordinate of this circle.
|
|
134
134
|
*/
|
|
135
135
|
get right(): number;
|
|
136
136
|
/**
|
|
137
|
-
*
|
|
137
|
+
* Sets the top coordinate of this circle.
|
|
138
138
|
*/
|
|
139
139
|
set top(value: number);
|
|
140
140
|
/**
|
|
141
|
-
*
|
|
142
|
-
* @returns {number}
|
|
141
|
+
* Gets the top coordinate of this circle.
|
|
142
|
+
* @returns {number} The top coordinate of this circle.
|
|
143
143
|
*/
|
|
144
144
|
get top(): number;
|
|
145
145
|
/**
|
|
146
|
-
*
|
|
146
|
+
* Sets the bottom coordinate of this circle.
|
|
147
147
|
*/
|
|
148
148
|
set bottom(value: number);
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
151
|
-
* @returns {number}
|
|
150
|
+
* Gets the bottom coordinate of this circle.
|
|
151
|
+
* @returns {number} The bottom coordinate of this circle.
|
|
152
152
|
*/
|
|
153
153
|
get bottom(): number;
|
|
154
154
|
/**
|
|
155
|
-
*
|
|
156
|
-
* @returns {number}
|
|
155
|
+
* Gets the area of this circle.
|
|
156
|
+
* @returns {number} The area of this circle.
|
|
157
157
|
*/
|
|
158
158
|
get area(): number;
|
|
159
159
|
/**
|
|
160
|
-
*
|
|
160
|
+
* Sets whether this circle is empty (zero diameter).
|
|
161
161
|
*/
|
|
162
162
|
set empty(value: boolean);
|
|
163
163
|
/**
|
|
164
|
-
*
|
|
165
|
-
* @returns {boolean}
|
|
164
|
+
* Checks if this circle is empty (has zero diameter).
|
|
165
|
+
* @returns {boolean} True if the circle is empty, false otherwise.
|
|
166
166
|
*/
|
|
167
167
|
get empty(): boolean;
|
|
168
168
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export class Ellipse {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @param {number} x -
|
|
5
|
-
* @param {number} y -
|
|
6
|
-
* @param {number} width -
|
|
7
|
-
* @param {number} height -
|
|
3
|
+
* Creates a new Ellipse instance.
|
|
4
|
+
* @param {number} x - The x coordinate of the center point (default: 0).
|
|
5
|
+
* @param {number} y - The y coordinate of the center point (default: 0).
|
|
6
|
+
* @param {number} width - The width of the ellipse (default: 0).
|
|
7
|
+
* @param {number} height - The height of the ellipse (default: 0).
|
|
8
8
|
*/
|
|
9
9
|
constructor(x?: number, y?: number, width?: number, height?: number);
|
|
10
10
|
/** @type {number} */
|
|
@@ -18,47 +18,47 @@ export class Ellipse {
|
|
|
18
18
|
/** @type {number} */
|
|
19
19
|
type: number;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
* @param {number} x -
|
|
23
|
-
* @param {number} y -
|
|
24
|
-
* @param {number} width -
|
|
25
|
-
* @param {number} height -
|
|
26
|
-
* @returns {Ellipse}
|
|
21
|
+
* Sets the position and size of this ellipse to new values.
|
|
22
|
+
* @param {number} x - The new x coordinate of the center point.
|
|
23
|
+
* @param {number} y - The new y coordinate of the center point.
|
|
24
|
+
* @param {number} width - The new width of the ellipse.
|
|
25
|
+
* @param {number} height - The new height of the ellipse.
|
|
26
|
+
* @returns {Ellipse} This ellipse instance for chaining.
|
|
27
27
|
*/
|
|
28
28
|
setTo(x: number, y: number, width: number, height: number): Ellipse;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
* @returns {Rectangle}
|
|
30
|
+
* Gets the bounding rectangle of this ellipse.
|
|
31
|
+
* @returns {Rectangle} The bounding rectangle of this ellipse.
|
|
32
32
|
*/
|
|
33
33
|
getBounds(): Rectangle;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @param {Ellipse} source -
|
|
37
|
-
* @returns {Ellipse}
|
|
35
|
+
* Copies the values from another ellipse to this ellipse.
|
|
36
|
+
* @param {Ellipse} source - The ellipse to copy values from.
|
|
37
|
+
* @returns {Ellipse} This ellipse instance for chaining.
|
|
38
38
|
*/
|
|
39
39
|
copyFrom(source: Ellipse): Ellipse;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
* @param {Ellipse} dest -
|
|
43
|
-
* @returns {Ellipse}
|
|
41
|
+
* Copies the values of this ellipse to another ellipse.
|
|
42
|
+
* @param {Ellipse} dest - The ellipse to copy values to.
|
|
43
|
+
* @returns {Ellipse} The destination ellipse.
|
|
44
44
|
*/
|
|
45
45
|
copyTo(dest: Ellipse): Ellipse;
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
* @param {number} x -
|
|
49
|
-
* @param {number} y -
|
|
50
|
-
* @returns {boolean}
|
|
47
|
+
* Checks if the specified point is contained within this ellipse.
|
|
48
|
+
* @param {number} x - The x coordinate of the point to check.
|
|
49
|
+
* @param {number} y - The y coordinate of the point to check.
|
|
50
|
+
* @returns {boolean} True if the point is contained within this ellipse, false otherwise.
|
|
51
51
|
*/
|
|
52
52
|
contains(x: number, y: number): boolean;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
55
|
-
* @param {Point} output -
|
|
56
|
-
* @returns {Point}
|
|
54
|
+
* Returns a random point within this ellipse.
|
|
55
|
+
* @param {Point} output - The point to store the result in (optional).
|
|
56
|
+
* @returns {Point} A random point within this ellipse.
|
|
57
57
|
*/
|
|
58
58
|
random(output?: Point): Point;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
* @returns {string}
|
|
60
|
+
* Returns a string representation of this ellipse.
|
|
61
|
+
* @returns {string} A string representation of the ellipse.
|
|
62
62
|
*/
|
|
63
63
|
toString(): string;
|
|
64
64
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export class Line {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @param {number} x1 -
|
|
5
|
-
* @param {number} y1 -
|
|
6
|
-
* @param {number} x2 -
|
|
7
|
-
* @param {number} y2 -
|
|
3
|
+
* Creates a new Line instance.
|
|
4
|
+
* @param {number} x1 - The x coordinate of the start point (default: 0).
|
|
5
|
+
* @param {number} y1 - The y coordinate of the start point (default: 0).
|
|
6
|
+
* @param {number} x2 - The x coordinate of the end point (default: 0).
|
|
7
|
+
* @param {number} y2 - The y coordinate of the end point (default: 0).
|
|
8
8
|
*/
|
|
9
9
|
constructor(x1?: number, y1?: number, x2?: number, y2?: number);
|
|
10
10
|
/** @type {Point} */
|
|
@@ -14,178 +14,178 @@ export class Line {
|
|
|
14
14
|
/** @type {number} */
|
|
15
15
|
type: number;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @param {number} x1 -
|
|
19
|
-
* @param {number} y1 -
|
|
20
|
-
* @param {number} x2 -
|
|
21
|
-
* @param {number} y2 -
|
|
22
|
-
* @returns {Line}
|
|
17
|
+
* Sets the coordinates of this line to new values.
|
|
18
|
+
* @param {number} x1 - The new x coordinate of the start point.
|
|
19
|
+
* @param {number} y1 - The new y coordinate of the start point.
|
|
20
|
+
* @param {number} x2 - The new x coordinate of the end point.
|
|
21
|
+
* @param {number} y2 - The new y coordinate of the end point.
|
|
22
|
+
* @returns {Line} This line instance for chaining.
|
|
23
23
|
*/
|
|
24
24
|
setTo(x1: number, y1: number, x2: number, y2: number): Line;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @param {object} startSprite -
|
|
28
|
-
* @param {object} endSprite -
|
|
29
|
-
* @param {boolean} useCenter -
|
|
30
|
-
* @returns {Line}
|
|
26
|
+
* Sets the coordinates of this line to match the positions of two sprites.
|
|
27
|
+
* @param {object} startSprite - The starting sprite to get the position from.
|
|
28
|
+
* @param {object} endSprite - The ending sprite to get the position from.
|
|
29
|
+
* @param {boolean} useCenter - Whether to use the center of the sprites (default: false).
|
|
30
|
+
* @returns {Line} This line instance for chaining.
|
|
31
31
|
*/
|
|
32
32
|
fromSprite(startSprite: object, endSprite: object, useCenter?: boolean): Line;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
* @param {number} x -
|
|
36
|
-
* @param {number} y -
|
|
37
|
-
* @param {number} angle -
|
|
38
|
-
* @param {number} length -
|
|
39
|
-
* @returns {Line}
|
|
34
|
+
* Sets the coordinates of this line to a point at a specific angle and distance.
|
|
35
|
+
* @param {number} x - The x coordinate of the starting point.
|
|
36
|
+
* @param {number} y - The y coordinate of the starting point.
|
|
37
|
+
* @param {number} angle - The angle in radians to set the line at.
|
|
38
|
+
* @param {number} length - The length of the line.
|
|
39
|
+
* @returns {Line} This line instance for chaining.
|
|
40
40
|
*/
|
|
41
41
|
fromAngle(x: number, y: number, angle: number, length: number): Line;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @param {number} angle -
|
|
45
|
-
* @param {boolean} asDegrees -
|
|
46
|
-
* @returns {Line}
|
|
43
|
+
* Rotates this line around its center point by the specified angle.
|
|
44
|
+
* @param {number} angle - The angle in radians (or degrees if asDegrees is true) to rotate by.
|
|
45
|
+
* @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false).
|
|
46
|
+
* @returns {Line} This line instance for chaining.
|
|
47
47
|
*/
|
|
48
48
|
rotate(angle: number, asDegrees?: boolean): Line;
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @param {number} x -
|
|
52
|
-
* @param {number} y -
|
|
53
|
-
* @param {number} angle -
|
|
54
|
-
* @param {boolean} asDegrees -
|
|
55
|
-
* @returns {Line}
|
|
50
|
+
* Rotates this line around a specific point by the specified angle.
|
|
51
|
+
* @param {number} x - The x coordinate of the center point to rotate around.
|
|
52
|
+
* @param {number} y - The y coordinate of the center point to rotate around.
|
|
53
|
+
* @param {number} angle - The angle in radians (or degrees if asDegrees is true) to rotate by.
|
|
54
|
+
* @param {boolean} asDegrees - Whether the angle is provided in degrees (default: false).
|
|
55
|
+
* @returns {Line} This line instance for chaining.
|
|
56
56
|
*/
|
|
57
57
|
rotateAround(x: number, y: number, angle: number, asDegrees?: boolean): Line;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
60
|
-
* @param {Line} line -
|
|
61
|
-
* @param {boolean} asSegment -
|
|
62
|
-
* @param {Point} result -
|
|
63
|
-
* @returns {Point}
|
|
59
|
+
* Checks if this line intersects with another line.
|
|
60
|
+
* @param {Line} line - The other line to check for intersection with.
|
|
61
|
+
* @param {boolean} asSegment - Whether to treat the lines as segments (default: false).
|
|
62
|
+
* @param {Point} result - The point to store the intersection in (optional).
|
|
63
|
+
* @returns {Point} The intersection point, or null if no intersection occurs.
|
|
64
64
|
*/
|
|
65
65
|
intersects(line: Line, asSegment: boolean, result: Point): Point;
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
68
|
-
* @param {Line} line -
|
|
69
|
-
* @returns {number}
|
|
67
|
+
* Calculates the reflection of this line off another line.
|
|
68
|
+
* @param {Line} line - The line to reflect off.
|
|
69
|
+
* @returns {number} The angle of reflection in radians.
|
|
70
70
|
*/
|
|
71
71
|
reflect(line: Line): number;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
74
|
-
* @param {Point} output -
|
|
75
|
-
* @returns {Point}
|
|
73
|
+
* Returns the midpoint of this line.
|
|
74
|
+
* @param {Point} output - The point to store the result in (optional).
|
|
75
|
+
* @returns {Point} The midpoint of this line.
|
|
76
76
|
*/
|
|
77
77
|
midPoint(output?: Point): Point;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
80
|
-
* @param {number} x -
|
|
81
|
-
* @param {number} y -
|
|
79
|
+
* Centers this line on the specified point.
|
|
80
|
+
* @param {number} x - The x coordinate to center the line on.
|
|
81
|
+
* @param {number} y - The y coordinate to center the line on.
|
|
82
82
|
*/
|
|
83
83
|
centerOn(x: number, y: number): void;
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
86
|
-
* @param {number} x -
|
|
87
|
-
* @param {number} y -
|
|
88
|
-
* @returns {boolean}
|
|
85
|
+
* Checks if the specified point lies on this line (not necessarily on the segment).
|
|
86
|
+
* @param {number} x - The x coordinate of the point to check.
|
|
87
|
+
* @param {number} y - The y coordinate of the point to check.
|
|
88
|
+
* @returns {boolean} True if the point lies on this line, false otherwise.
|
|
89
89
|
*/
|
|
90
90
|
pointOnLine(x: number, y: number): boolean;
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
93
|
-
* @param {number} x -
|
|
94
|
-
* @param {number} y -
|
|
95
|
-
* @returns {boolean}
|
|
92
|
+
* Checks if the specified point lies on this line segment.
|
|
93
|
+
* @param {number} x - The x coordinate of the point to check.
|
|
94
|
+
* @param {number} y - The y coordinate of the point to check.
|
|
95
|
+
* @returns {boolean} True if the point lies on this line segment, false otherwise.
|
|
96
96
|
*/
|
|
97
97
|
pointOnSegment(x: number, y: number): boolean;
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
100
|
-
* @param {Point} output -
|
|
101
|
-
* @returns {Point}
|
|
99
|
+
* Returns a random point on this line.
|
|
100
|
+
* @param {Point} output - The point to store the result in (optional).
|
|
101
|
+
* @returns {Point} A random point on this line.
|
|
102
102
|
*/
|
|
103
103
|
random(output?: Point): Point;
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
106
|
-
* @param {number} stepRate -
|
|
107
|
-
* @param {number[][]} results -
|
|
108
|
-
* @returns {number[][]}
|
|
105
|
+
* Gets coordinates of points along this line at regular intervals.
|
|
106
|
+
* @param {number} stepRate - The interval between points (default: 1).
|
|
107
|
+
* @param {number[][]} results - The array to store the results in (optional).
|
|
108
|
+
* @returns {number[][]} An array of coordinate pairs representing points along this line.
|
|
109
109
|
*/
|
|
110
110
|
coordinatesOnLine(stepRate?: number, results?: number[][]): number[][];
|
|
111
111
|
/**
|
|
112
|
-
*
|
|
113
|
-
* @returns {Line}
|
|
112
|
+
* Creates a clone of this line.
|
|
113
|
+
* @returns {Line} A new line with the same values as this one.
|
|
114
114
|
*/
|
|
115
115
|
clone(): Line;
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
118
|
-
* @returns {number}
|
|
117
|
+
* Gets the length of this line.
|
|
118
|
+
* @returns {number} The length of this line.
|
|
119
119
|
*/
|
|
120
120
|
get length(): number;
|
|
121
121
|
/**
|
|
122
|
-
*
|
|
123
|
-
* @returns {number}
|
|
122
|
+
* Gets the angle of this line in radians.
|
|
123
|
+
* @returns {number} The angle of this line in radians.
|
|
124
124
|
*/
|
|
125
125
|
get angle(): number;
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
128
|
-
* @returns {number}
|
|
127
|
+
* Gets the slope of this line.
|
|
128
|
+
* @returns {number} The slope of this line.
|
|
129
129
|
*/
|
|
130
130
|
get slope(): number;
|
|
131
131
|
/**
|
|
132
|
-
*
|
|
133
|
-
* @returns {number}
|
|
132
|
+
* Gets the perpendicular slope of this line.
|
|
133
|
+
* @returns {number} The perpendicular slope of this line.
|
|
134
134
|
*/
|
|
135
135
|
get perpSlope(): number;
|
|
136
136
|
/**
|
|
137
|
-
*
|
|
138
|
-
* @returns {number}
|
|
137
|
+
* Gets the x coordinate of the leftmost point on this line.
|
|
138
|
+
* @returns {number} The x coordinate of the leftmost point on this line.
|
|
139
139
|
*/
|
|
140
140
|
get x(): number;
|
|
141
141
|
/**
|
|
142
|
-
*
|
|
143
|
-
* @returns {number}
|
|
142
|
+
* Gets the y coordinate of the topmost point on this line.
|
|
143
|
+
* @returns {number} The y coordinate of the topmost point on this line.
|
|
144
144
|
*/
|
|
145
145
|
get y(): number;
|
|
146
146
|
/**
|
|
147
|
-
*
|
|
148
|
-
* @returns {number}
|
|
147
|
+
* Gets the x coordinate of the leftmost point on this line.
|
|
148
|
+
* @returns {number} The x coordinate of the leftmost point on this line.
|
|
149
149
|
*/
|
|
150
150
|
get left(): number;
|
|
151
151
|
/**
|
|
152
|
-
*
|
|
153
|
-
* @returns {number}
|
|
152
|
+
* Gets the x coordinate of the rightmost point on this line.
|
|
153
|
+
* @returns {number} The x coordinate of the rightmost point on this line.
|
|
154
154
|
*/
|
|
155
155
|
get right(): number;
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
158
|
-
* @returns {number}
|
|
157
|
+
* Gets the y coordinate of the topmost point on this line.
|
|
158
|
+
* @returns {number} The y coordinate of the topmost point on this line.
|
|
159
159
|
*/
|
|
160
160
|
get top(): number;
|
|
161
161
|
/**
|
|
162
|
-
*
|
|
163
|
-
* @returns {number}
|
|
162
|
+
* Gets the y coordinate of the bottommost point on this line.
|
|
163
|
+
* @returns {number} The y coordinate of the bottommost point on this line.
|
|
164
164
|
*/
|
|
165
165
|
get bottom(): number;
|
|
166
166
|
/**
|
|
167
|
-
*
|
|
168
|
-
* @returns {number}
|
|
167
|
+
* Gets the width of this line (absolute difference between x coordinates).
|
|
168
|
+
* @returns {number} The width of this line.
|
|
169
169
|
*/
|
|
170
170
|
get width(): number;
|
|
171
171
|
/**
|
|
172
|
-
*
|
|
173
|
-
* @returns {number}
|
|
172
|
+
* Gets the height of this line (absolute difference between y coordinates).
|
|
173
|
+
* @returns {number} The height of this line.
|
|
174
174
|
*/
|
|
175
175
|
get height(): number;
|
|
176
176
|
/**
|
|
177
|
-
*
|
|
178
|
-
* @returns {number}
|
|
177
|
+
* Gets the normal vector x component of this line (perpendicular to the line).
|
|
178
|
+
* @returns {number} The normal vector x component of this line.
|
|
179
179
|
*/
|
|
180
180
|
get normalX(): number;
|
|
181
181
|
/**
|
|
182
|
-
*
|
|
183
|
-
* @returns {number}
|
|
182
|
+
* Gets the normal vector y component of this line (perpendicular to the line).
|
|
183
|
+
* @returns {number} The normal vector y component of this line.
|
|
184
184
|
*/
|
|
185
185
|
get normalY(): number;
|
|
186
186
|
/**
|
|
187
|
-
*
|
|
188
|
-
* @returns {number}
|
|
187
|
+
* Gets the angle of the normal vector of this line in radians.
|
|
188
|
+
* @returns {number} The angle of the normal vector of this line in radians.
|
|
189
189
|
*/
|
|
190
190
|
get normalAngle(): number;
|
|
191
191
|
}
|