@vpmedia/phaser 1.95.0 → 1.96.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 +29 -0
- package/package.json +9 -9
- 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 +56 -52
- 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 +64 -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/ellipse.js +28 -28
- package/src/phaser/geom/line.js +93 -93
- package/src/phaser/geom/matrix.js +54 -54
- package/src/phaser/geom/point.js +96 -96
- package/src/phaser/geom/polygon.js +22 -22
- package/src/phaser/geom/rectangle.js +132 -132
- package/src/phaser/geom/rounded_rectangle.js +12 -12
- package/src/phaser/geom/util/circle.js +33 -33
- package/src/phaser/geom/util/ellipse.js +5 -5
- package/src/phaser/geom/util/line.js +26 -26
- package/src/phaser/geom/util/matrix.js +8 -8
- package/src/phaser/geom/util/point.js +97 -97
- package/src/phaser/geom/util/polygon.js +4 -4
- package/src/phaser/geom/util/rectangle.js +74 -74
- package/src/phaser/geom/util/rounded_rectangle.js +4 -4
- package/src/phaser/util/math.js +81 -81
- 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,10 +1,10 @@
|
|
|
1
1
|
export class Rectangle {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @param {number} x -
|
|
5
|
-
* @param {number} y -
|
|
6
|
-
* @param {number} width -
|
|
7
|
-
* @param {number} height -
|
|
3
|
+
* Creates a new Rectangle instance.
|
|
4
|
+
* @param {number} x - The x coordinate of the top-left corner of the rectangle (default: 0).
|
|
5
|
+
* @param {number} y - The y coordinate of the top-left corner of the rectangle (default: 0).
|
|
6
|
+
* @param {number} width - The width of the rectangle (default: 0).
|
|
7
|
+
* @param {number} height - The height of the rectangle (default: 0).
|
|
8
8
|
*/
|
|
9
9
|
constructor(x?: number, y?: number, width?: number, height?: number);
|
|
10
10
|
/** @type {number} */
|
|
@@ -18,289 +18,289 @@ export class Rectangle {
|
|
|
18
18
|
/** @type {number} */
|
|
19
19
|
type: number;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
* @param {number} dx -
|
|
23
|
-
* @param {number} dy -
|
|
24
|
-
* @returns {Rectangle}
|
|
21
|
+
* Offsets the rectangle's position by the specified amounts.
|
|
22
|
+
* @param {number} dx - The amount to offset the x coordinate by.
|
|
23
|
+
* @param {number} dy - The amount to offset the y coordinate by.
|
|
24
|
+
* @returns {Rectangle} This rectangle instance for chaining.
|
|
25
25
|
*/
|
|
26
26
|
offset(dx: number, dy: number): Rectangle;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
* @param {Point} point -
|
|
30
|
-
* @returns {Rectangle}
|
|
28
|
+
* Offsets the rectangle's position by the specified point coordinates.
|
|
29
|
+
* @param {Point} point - The point to offset the rectangle by.
|
|
30
|
+
* @returns {Rectangle} This rectangle instance for chaining.
|
|
31
31
|
*/
|
|
32
32
|
offsetPoint(point: Point): Rectangle;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
* @param {number} x -
|
|
36
|
-
* @param {number} y -
|
|
37
|
-
* @param {number} width -
|
|
38
|
-
* @param {number} height -
|
|
39
|
-
* @returns {Rectangle}
|
|
34
|
+
* Sets the rectangle's position and size to new values.
|
|
35
|
+
* @param {number} x - The new x coordinate of the top-left corner of the rectangle.
|
|
36
|
+
* @param {number} y - The new y coordinate of the top-left corner of the rectangle.
|
|
37
|
+
* @param {number} width - The new width of the rectangle.
|
|
38
|
+
* @param {number} height - The new height of the rectangle.
|
|
39
|
+
* @returns {Rectangle} This rectangle instance for chaining.
|
|
40
40
|
*/
|
|
41
41
|
setTo(x: number, y: number, width: number, height: number): Rectangle;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @param {number} x -
|
|
45
|
-
* @param {number} y -
|
|
46
|
-
* @returns {Rectangle}
|
|
43
|
+
* Scales the rectangle's size by the specified amounts.
|
|
44
|
+
* @param {number} x - The amount to scale the width by.
|
|
45
|
+
* @param {number} y - The amount to scale the height by (default: x).
|
|
46
|
+
* @returns {Rectangle} This rectangle instance for chaining.
|
|
47
47
|
*/
|
|
48
48
|
scale(x: number, y: number): Rectangle;
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @param {number} x -
|
|
52
|
-
* @param {number} y -
|
|
53
|
-
* @returns {Rectangle}
|
|
50
|
+
* Centers the rectangle on the specified point.
|
|
51
|
+
* @param {number} x - The x coordinate to center the rectangle on.
|
|
52
|
+
* @param {number} y - The y coordinate to center the rectangle on.
|
|
53
|
+
* @returns {Rectangle} This rectangle instance for chaining.
|
|
54
54
|
*/
|
|
55
55
|
centerOn(x: number, y: number): Rectangle;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Sets the x coordinate of the center of this rectangle.
|
|
58
58
|
*/
|
|
59
59
|
set centerX(value: number);
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
62
|
-
* @returns {number}
|
|
61
|
+
* Gets the x coordinate of the center of this rectangle.
|
|
62
|
+
* @returns {number} The x coordinate of the center of this rectangle.
|
|
63
63
|
*/
|
|
64
64
|
get centerX(): number;
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* Sets the y coordinate of the center of this rectangle.
|
|
67
67
|
*/
|
|
68
68
|
set centerY(value: number);
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
71
|
-
* @returns {number}
|
|
70
|
+
* Gets the y coordinate of the center of this rectangle.
|
|
71
|
+
* @returns {number} The y coordinate of the center of this rectangle.
|
|
72
72
|
*/
|
|
73
73
|
get centerY(): number;
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
75
|
+
* Floors the x and y coordinates of the rectangle (rounds down to nearest integer).
|
|
76
76
|
*/
|
|
77
77
|
floor(): void;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* Floors all coordinates of the rectangle (rounds down to nearest integer).
|
|
80
80
|
*/
|
|
81
81
|
floorAll(): void;
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* Ceils the x and y coordinates of the rectangle (rounds up to nearest integer).
|
|
84
84
|
*/
|
|
85
85
|
ceil(): void;
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
87
|
+
* Ceils all coordinates of the rectangle (rounds up to nearest integer).
|
|
88
88
|
*/
|
|
89
89
|
ceilAll(): void;
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
92
|
-
* @param {Rectangle} source -
|
|
93
|
-
* @returns {Rectangle}
|
|
91
|
+
* Copies the values from another rectangle to this rectangle.
|
|
92
|
+
* @param {Rectangle} source - The rectangle to copy values from.
|
|
93
|
+
* @returns {Rectangle} This rectangle instance for chaining.
|
|
94
94
|
*/
|
|
95
95
|
copyFrom(source: Rectangle): Rectangle;
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
98
|
-
* @param {Rectangle} dest -
|
|
99
|
-
* @returns {Rectangle}
|
|
97
|
+
* Copies the values of this rectangle to another rectangle.
|
|
98
|
+
* @param {Rectangle} dest - The rectangle to copy values to.
|
|
99
|
+
* @returns {Rectangle} The destination rectangle.
|
|
100
100
|
*/
|
|
101
101
|
copyTo(dest: Rectangle): Rectangle;
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
104
|
-
* @param {number} dx -
|
|
105
|
-
* @param {number} dy -
|
|
106
|
-
* @returns {Rectangle}
|
|
103
|
+
* Increases the size of the rectangle by the specified amounts.
|
|
104
|
+
* @param {number} dx - The amount to increase the width by.
|
|
105
|
+
* @param {number} dy - The amount to increase the height by.
|
|
106
|
+
* @returns {Rectangle} This rectangle instance for chaining.
|
|
107
107
|
*/
|
|
108
108
|
inflate(dx: number, dy: number): Rectangle;
|
|
109
109
|
/**
|
|
110
|
-
*
|
|
111
|
-
* @param {Point} output -
|
|
112
|
-
* @returns {Point}
|
|
110
|
+
* Gets the size of the rectangle as a point.
|
|
111
|
+
* @param {Point} output - The point to store the size in (optional).
|
|
112
|
+
* @returns {Point} The size of the rectangle as a point.
|
|
113
113
|
*/
|
|
114
114
|
size(output: Point): Point;
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
117
|
-
* @param {number} width -
|
|
118
|
-
* @param {number} height -
|
|
119
|
-
* @returns {Rectangle}
|
|
116
|
+
* Resizes the rectangle to the specified dimensions.
|
|
117
|
+
* @param {number} width - The new width of the rectangle.
|
|
118
|
+
* @param {number} height - The new height of the rectangle.
|
|
119
|
+
* @returns {Rectangle} This rectangle instance for chaining.
|
|
120
120
|
*/
|
|
121
121
|
resize(width: number, height: number): Rectangle;
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
124
|
-
* @param {Rectangle} output -
|
|
125
|
-
* @returns {Rectangle}
|
|
123
|
+
* Creates a clone of this rectangle.
|
|
124
|
+
* @param {Rectangle} output - The rectangle to store the clone in (optional).
|
|
125
|
+
* @returns {Rectangle} A new rectangle with the same values as this one.
|
|
126
126
|
*/
|
|
127
127
|
clone(output: Rectangle): Rectangle;
|
|
128
128
|
/**
|
|
129
|
-
*
|
|
130
|
-
* @param {number} x -
|
|
131
|
-
* @param {number} y -
|
|
132
|
-
* @returns {boolean}
|
|
129
|
+
* Checks if the specified point is contained within this rectangle.
|
|
130
|
+
* @param {number} x - The x coordinate of the point to check.
|
|
131
|
+
* @param {number} y - The y coordinate of the point to check.
|
|
132
|
+
* @returns {boolean} True if the point is contained within this rectangle, false otherwise.
|
|
133
133
|
*/
|
|
134
134
|
contains(x: number, y: number): boolean;
|
|
135
135
|
/**
|
|
136
|
-
*
|
|
137
|
-
* @param {Rectangle} b -
|
|
138
|
-
* @returns {boolean}
|
|
136
|
+
* Checks if the specified rectangle is fully contained within this rectangle.
|
|
137
|
+
* @param {Rectangle} b - The rectangle to check if it's contained.
|
|
138
|
+
* @returns {boolean} True if the rectangle is contained within this rectangle, false otherwise.
|
|
139
139
|
*/
|
|
140
140
|
containsRect(b: Rectangle): boolean;
|
|
141
141
|
/**
|
|
142
|
-
*
|
|
143
|
-
* @param {Rectangle} b -
|
|
144
|
-
* @returns {boolean}
|
|
142
|
+
* Checks if this rectangle is equal to another rectangle.
|
|
143
|
+
* @param {Rectangle} b - The rectangle to compare with.
|
|
144
|
+
* @returns {boolean} True if the rectangles have the same values, false otherwise.
|
|
145
145
|
*/
|
|
146
146
|
equals(b: Rectangle): boolean;
|
|
147
147
|
/**
|
|
148
|
-
*
|
|
149
|
-
* @param {Rectangle} b -
|
|
150
|
-
* @param {Rectangle} out -
|
|
151
|
-
* @returns {Rectangle}
|
|
148
|
+
* Gets the intersection of this rectangle and another rectangle.
|
|
149
|
+
* @param {Rectangle} b - The rectangle to intersect with.
|
|
150
|
+
* @param {Rectangle} out - The rectangle to store the result in (optional).
|
|
151
|
+
* @returns {Rectangle} The intersection of the two rectangles.
|
|
152
152
|
*/
|
|
153
153
|
intersection(b: Rectangle, out: Rectangle): Rectangle;
|
|
154
154
|
/**
|
|
155
|
-
*
|
|
156
|
-
* @param {Rectangle} b -
|
|
157
|
-
* @returns {boolean}
|
|
155
|
+
* Checks if this rectangle intersects with another rectangle.
|
|
156
|
+
* @param {Rectangle} b - The rectangle to check for intersection with.
|
|
157
|
+
* @returns {boolean} True if the rectangles intersect, false otherwise.
|
|
158
158
|
*/
|
|
159
159
|
intersects(b: Rectangle): boolean;
|
|
160
160
|
/**
|
|
161
|
-
*
|
|
162
|
-
* @param {number} left -
|
|
163
|
-
* @param {number} right -
|
|
164
|
-
* @param {number} top -
|
|
165
|
-
* @param {number} bottom -
|
|
166
|
-
* @param {number} tolerance -
|
|
167
|
-
* @returns {boolean}
|
|
161
|
+
* Checks if this rectangle intersects with the specified bounds.
|
|
162
|
+
* @param {number} left - The left boundary of the area to check for intersection.
|
|
163
|
+
* @param {number} right - The right boundary of the area to check for intersection.
|
|
164
|
+
* @param {number} top - The top boundary of the area to check for intersection.
|
|
165
|
+
* @param {number} bottom - The bottom boundary of the area to check for intersection.
|
|
166
|
+
* @param {number} tolerance - A tolerance value to use when checking (default: 0).
|
|
167
|
+
* @returns {boolean} True if the rectangle intersects with the bounds, false otherwise.
|
|
168
168
|
*/
|
|
169
169
|
intersectsRaw(left: number, right: number, top: number, bottom: number, tolerance: number): boolean;
|
|
170
170
|
/**
|
|
171
|
-
*
|
|
172
|
-
* @param {Rectangle} b -
|
|
173
|
-
* @param {Rectangle} out -
|
|
174
|
-
* @returns {Rectangle}
|
|
171
|
+
* Gets the union of this rectangle and another rectangle.
|
|
172
|
+
* @param {Rectangle} b - The rectangle to union with.
|
|
173
|
+
* @param {Rectangle} out - The rectangle to store the result in (optional).
|
|
174
|
+
* @returns {Rectangle} The union of the two rectangles.
|
|
175
175
|
*/
|
|
176
176
|
union(b: Rectangle, out: Rectangle): Rectangle;
|
|
177
177
|
/**
|
|
178
|
-
*
|
|
179
|
-
* @param {Point} output -
|
|
180
|
-
* @returns {Point}
|
|
178
|
+
* Gets a random point within this rectangle.
|
|
179
|
+
* @param {Point} output - The point to store the result in (optional).
|
|
180
|
+
* @returns {Point} A random point within this rectangle.
|
|
181
181
|
*/
|
|
182
182
|
random(output?: Point): Point;
|
|
183
183
|
/**
|
|
184
|
-
*
|
|
185
|
-
* @param {number} position -
|
|
186
|
-
* @param {Point} output -
|
|
187
|
-
* @returns {Point}
|
|
184
|
+
* Gets a point at a specific position on the rectangle.
|
|
185
|
+
* @param {number} position - The position to get the point for (TOP_LEFT, TOP_CENTER, etc.).
|
|
186
|
+
* @param {Point} output - The point to store the result in (optional).
|
|
187
|
+
* @returns {Point} A point at the specified position on the rectangle.
|
|
188
188
|
*/
|
|
189
189
|
getPoint(position: number, output?: Point): Point;
|
|
190
190
|
/**
|
|
191
|
-
*
|
|
192
|
-
* @returns {string}
|
|
191
|
+
* Returns a string representation of this rectangle.
|
|
192
|
+
* @returns {string} A string representation of the rectangle.
|
|
193
193
|
*/
|
|
194
194
|
toString(): string;
|
|
195
195
|
/**
|
|
196
|
-
*
|
|
197
|
-
* @returns {number}
|
|
196
|
+
* Gets half the width of this rectangle.
|
|
197
|
+
* @returns {number} Half the width of this rectangle.
|
|
198
198
|
*/
|
|
199
199
|
get halfWidth(): number;
|
|
200
200
|
/**
|
|
201
|
-
*
|
|
202
|
-
* @returns {number}
|
|
201
|
+
* Gets half the height of this rectangle.
|
|
202
|
+
* @returns {number} Half the height of this rectangle.
|
|
203
203
|
*/
|
|
204
204
|
get halfHeight(): number;
|
|
205
205
|
/**
|
|
206
|
-
*
|
|
206
|
+
* Sets the top coordinate of this rectangle.
|
|
207
207
|
*/
|
|
208
208
|
set top(value: number);
|
|
209
209
|
/**
|
|
210
|
-
*
|
|
211
|
-
* @returns {number}
|
|
210
|
+
* Gets the top coordinate of this rectangle.
|
|
211
|
+
* @returns {number} The top coordinate of this rectangle.
|
|
212
212
|
*/
|
|
213
213
|
get top(): number;
|
|
214
214
|
/**
|
|
215
|
-
*
|
|
215
|
+
* Sets the top-left point of this rectangle.
|
|
216
216
|
*/
|
|
217
217
|
set topLeft(value: Point);
|
|
218
218
|
/**
|
|
219
|
-
*
|
|
220
|
-
* @returns {Point}
|
|
219
|
+
* Gets the top-left point of this rectangle.
|
|
220
|
+
* @returns {Point} The top-left point of this rectangle.
|
|
221
221
|
*/
|
|
222
222
|
get topLeft(): Point;
|
|
223
223
|
/**
|
|
224
|
-
*
|
|
224
|
+
* Sets the top-right point of this rectangle.
|
|
225
225
|
*/
|
|
226
226
|
set topRight(value: Point);
|
|
227
227
|
/**
|
|
228
|
-
*
|
|
229
|
-
* @returns {Point}
|
|
228
|
+
* Gets the top-right point of this rectangle.
|
|
229
|
+
* @returns {Point} The top-right point of this rectangle.
|
|
230
230
|
*/
|
|
231
231
|
get topRight(): Point;
|
|
232
232
|
/**
|
|
233
|
-
*
|
|
233
|
+
* Sets the right coordinate of this rectangle.
|
|
234
234
|
*/
|
|
235
235
|
set right(value: number);
|
|
236
236
|
/**
|
|
237
|
-
*
|
|
238
|
-
* @returns {number}
|
|
237
|
+
* Gets the right coordinate of this rectangle.
|
|
238
|
+
* @returns {number} The right coordinate of this rectangle.
|
|
239
239
|
*/
|
|
240
240
|
get right(): number;
|
|
241
241
|
/**
|
|
242
|
-
*
|
|
242
|
+
* Sets the bottom coordinate of this rectangle.
|
|
243
243
|
*/
|
|
244
244
|
set bottom(value: number);
|
|
245
245
|
/**
|
|
246
|
-
*
|
|
247
|
-
* @returns {number}
|
|
246
|
+
* Gets the bottom coordinate of this rectangle.
|
|
247
|
+
* @returns {number} The bottom coordinate of this rectangle.
|
|
248
248
|
*/
|
|
249
249
|
get bottom(): number;
|
|
250
250
|
/**
|
|
251
|
-
*
|
|
251
|
+
* Sets the bottom-left point of this rectangle.
|
|
252
252
|
*/
|
|
253
253
|
set bottomLeft(value: Point);
|
|
254
254
|
/**
|
|
255
|
-
*
|
|
256
|
-
* @returns {Point}
|
|
255
|
+
* Gets the bottom-left point of this rectangle.
|
|
256
|
+
* @returns {Point} The bottom-left point of this rectangle.
|
|
257
257
|
*/
|
|
258
258
|
get bottomLeft(): Point;
|
|
259
259
|
/**
|
|
260
|
-
*
|
|
260
|
+
* Sets the bottom-right point of this rectangle.
|
|
261
261
|
*/
|
|
262
262
|
set bottomRight(value: Point);
|
|
263
263
|
/**
|
|
264
|
-
*
|
|
265
|
-
* @returns {Point}
|
|
264
|
+
* Gets the bottom-right point of this rectangle.
|
|
265
|
+
* @returns {Point} The bottom-right point of this rectangle.
|
|
266
266
|
*/
|
|
267
267
|
get bottomRight(): Point;
|
|
268
268
|
/**
|
|
269
|
-
*
|
|
269
|
+
* Sets the left coordinate of this rectangle.
|
|
270
270
|
*/
|
|
271
271
|
set left(value: number);
|
|
272
272
|
/**
|
|
273
|
-
*
|
|
274
|
-
* @returns {number}
|
|
273
|
+
* Gets the left coordinate of this rectangle.
|
|
274
|
+
* @returns {number} The left coordinate of this rectangle.
|
|
275
275
|
*/
|
|
276
276
|
get left(): number;
|
|
277
277
|
/**
|
|
278
|
-
*
|
|
279
|
-
* @returns {number}
|
|
278
|
+
* Gets the volume (area) of this rectangle.
|
|
279
|
+
* @returns {number} The volume (area) of this rectangle.
|
|
280
280
|
*/
|
|
281
281
|
get volume(): number;
|
|
282
282
|
/**
|
|
283
|
-
*
|
|
284
|
-
* @returns {number}
|
|
283
|
+
* Gets the perimeter of this rectangle.
|
|
284
|
+
* @returns {number} The perimeter of this rectangle.
|
|
285
285
|
*/
|
|
286
286
|
get perimeter(): number;
|
|
287
287
|
/**
|
|
288
|
-
*
|
|
289
|
-
* @returns {number}
|
|
288
|
+
* Gets a random x coordinate within this rectangle.
|
|
289
|
+
* @returns {number} A random x coordinate within this rectangle.
|
|
290
290
|
*/
|
|
291
291
|
get randomX(): number;
|
|
292
292
|
/**
|
|
293
|
-
*
|
|
294
|
-
* @returns {number}
|
|
293
|
+
* Gets a random y coordinate within this rectangle.
|
|
294
|
+
* @returns {number} A random y coordinate within this rectangle.
|
|
295
295
|
*/
|
|
296
296
|
get randomY(): number;
|
|
297
297
|
/**
|
|
298
|
-
*
|
|
298
|
+
* Sets whether this rectangle is empty (zero width or height).
|
|
299
299
|
*/
|
|
300
300
|
set empty(value: boolean);
|
|
301
301
|
/**
|
|
302
|
-
*
|
|
303
|
-
* @returns {boolean}
|
|
302
|
+
* Checks if this rectangle is empty (has zero width or height).
|
|
303
|
+
* @returns {boolean} True if the rectangle is empty, false otherwise.
|
|
304
304
|
*/
|
|
305
305
|
get empty(): boolean;
|
|
306
306
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export class RoundedRectangle {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @param {number} x -
|
|
5
|
-
* @param {number} y -
|
|
6
|
-
* @param {number} width -
|
|
7
|
-
* @param {number} height -
|
|
8
|
-
* @param {number} radius -
|
|
3
|
+
* Creates a new RoundedRectangle instance.
|
|
4
|
+
* @param {number} x - The x coordinate of the top-left corner of the rectangle (default: 0).
|
|
5
|
+
* @param {number} y - The y coordinate of the top-left corner of the rectangle (default: 0).
|
|
6
|
+
* @param {number} width - The width of the rectangle (default: 0).
|
|
7
|
+
* @param {number} height - The height of the rectangle (default: 0).
|
|
8
|
+
* @param {number} radius - The corner radius (default: 20).
|
|
9
9
|
*/
|
|
10
10
|
constructor(x?: number, y?: number, width?: number, height?: number, radius?: number);
|
|
11
11
|
x: number;
|
|
@@ -15,15 +15,15 @@ export class RoundedRectangle {
|
|
|
15
15
|
radius: number;
|
|
16
16
|
type: number;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* @param {number} x -
|
|
20
|
-
* @param {number} y -
|
|
21
|
-
* @returns {boolean}
|
|
18
|
+
* Checks if the specified point is contained within this rounded rectangle.
|
|
19
|
+
* @param {number} x - The x coordinate of the point to check.
|
|
20
|
+
* @param {number} y - The y coordinate of the point to check.
|
|
21
|
+
* @returns {boolean} True if the point is contained within this rounded rectangle, false otherwise.
|
|
22
22
|
*/
|
|
23
23
|
contains(x: number, y: number): boolean;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* @returns {RoundedRectangle}
|
|
25
|
+
* Creates a clone of this rounded rectangle.
|
|
26
|
+
* @returns {RoundedRectangle} A new rounded rectangle with the same values as this one.
|
|
27
27
|
*/
|
|
28
28
|
clone(): RoundedRectangle;
|
|
29
29
|
}
|
package/pnpm-workspace.yaml
DELETED