@ringozz/godot 4.7.2-583 → 4.7.2-592

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.
Files changed (49) hide show
  1. package/README.md +19 -1
  2. package/gen/classes/ArrayOccluder3D.ts +1 -1
  3. package/gen/classes/CPUParticles2D.ts +3 -3
  4. package/gen/classes/CPUParticles3D.ts +3 -3
  5. package/gen/classes/CSGPolygon3D.ts +1 -1
  6. package/gen/classes/CollisionPolygon2D.ts +1 -1
  7. package/gen/classes/CollisionPolygon3D.ts +1 -1
  8. package/gen/classes/ColorPalette.ts +1 -1
  9. package/gen/classes/ConcavePolygonShape2D.ts +1 -1
  10. package/gen/classes/ConcavePolygonShape3D.ts +1 -1
  11. package/gen/classes/ConvexPolygonShape2D.ts +1 -1
  12. package/gen/classes/ConvexPolygonShape3D.ts +1 -1
  13. package/gen/classes/FontVariation.ts +1 -1
  14. package/gen/classes/Gradient.ts +1 -1
  15. package/gen/classes/Line2D.ts +1 -1
  16. package/gen/classes/MultiMesh.ts +4 -4
  17. package/gen/classes/NavigationMesh.ts +1 -1
  18. package/gen/classes/NavigationObstacle2D.ts +1 -1
  19. package/gen/classes/NavigationObstacle3D.ts +1 -1
  20. package/gen/classes/NavigationPathQueryResult2D.ts +1 -1
  21. package/gen/classes/NavigationPathQueryResult3D.ts +1 -1
  22. package/gen/classes/NavigationPolygon.ts +1 -1
  23. package/gen/classes/OccluderPolygon2D.ts +1 -1
  24. package/gen/classes/Polygon2D.ts +3 -3
  25. package/gen/classes/PolygonOccluder3D.ts +1 -1
  26. package/gen/classes/Window.ts +1 -1
  27. package/gen/index.ts +0 -3
  28. package/gen/utility-functions.ts +114 -114
  29. package/gen/value-types/AABB.ts +267 -277
  30. package/gen/value-types/Basis.ts +313 -264
  31. package/gen/value-types/Color.ts +398 -268
  32. package/gen/value-types/Plane.ts +121 -125
  33. package/gen/value-types/Projection.ts +178 -126
  34. package/gen/value-types/Quaternion.ts +180 -179
  35. package/gen/value-types/Rect2.ts +169 -171
  36. package/gen/value-types/Rect2i.ts +148 -150
  37. package/gen/value-types/Transform2D.ts +192 -194
  38. package/gen/value-types/Transform3D.ts +133 -126
  39. package/gen/value-types/Vector2.ts +370 -354
  40. package/gen/value-types/Vector2i.ts +192 -191
  41. package/gen/value-types/Vector3.ts +354 -354
  42. package/gen/value-types/Vector3i.ts +187 -192
  43. package/gen/value-types/Vector4.ts +263 -274
  44. package/gen/value-types/Vector4i.ts +187 -198
  45. package/gen/value-types/index.ts +16 -16
  46. package/package.json +20 -4
  47. package/src/debug.ts +30 -27
  48. package/src/index.ts +0 -2
  49. package/src/runtime.ts +16 -7
@@ -1,9 +1,9 @@
1
1
  // Auto-generated from extension_api.json - DO NOT EDIT
2
2
  // Generated by dev/codegen.ts
3
3
 
4
- import { GodotVar, _C, _R, _get, _set } from '../../src/runtime.ts';
4
+ import { _V } from '../../src/runtime.ts';
5
5
  import type { GodotArray, GodotDictionary, Variant } from '../heap-types/index.ts';
6
- import type { Rect2i, Transform2D, Vector2 } from '../value-types/index.ts';
6
+ import type { Rect2i, Transform2D, Vector2 } from './index.ts';
7
7
 
8
8
  /**
9
9
  * The {@link Rect2} built-in {@link Variant} type represents an axis-aligned rectangle in a 2D space. It is defined by its {@link position} and {@link size}, which are {@link Vector2}. It is frequently used for fast overlap tests (see {@link intersects}). Although {@link Rect2} itself is axis-aligned, it can be combined with {@link Transform2D} to represent a rotated or skewed rectangle.
@@ -11,172 +11,170 @@ import type { Rect2i, Transform2D, Vector2 } from '../value-types/index.ts';
11
11
  * **Note:** Negative values for {@link size} are not supported. With negative size, most {@link Rect2} methods do not work correctly. Use {@link abs} to get an equivalent {@link Rect2} with a non-negative size.
12
12
  * **Note:** In a boolean context, a {@link Rect2} evaluates to `false` if both {@link position} and {@link size} are zero (equal to {@link Vector2.ZERO}). Otherwise, it always evaluates to `true`.
13
13
  */
14
- export class Rect2 extends GodotVar {
15
- /**
16
- * The origin point. This is usually the top-left corner of the rectangle.
17
- */
18
- get position(): Vector2 { return _get(this, 9504) as Vector2; }
19
- set position(v: Vector2) { _set(this, 9504, v); }
20
-
21
- /**
22
- * The rectangle's width and height, starting from {@link position}. Setting this value also affects the {@link end} point.
23
- * **Note:** It's recommended setting the width and height to non-negative values, as most methods in Godot assume that the {@link position} is the top-left corner, and the {@link end} is the bottom-right corner. To get an equivalent rectangle with non-negative size, use {@link abs}.
24
- */
25
- get size(): Vector2 { return _get(this, 13608) as Vector2; }
26
- set size(v: Vector2) { _set(this, 13608, v); }
27
-
28
- /**
29
- * The ending point. This is usually the bottom-right corner of the rectangle, and is equivalent to `position + size`. Setting this point affects the {@link size}.
30
- */
31
- get end(): Vector2 { return _get(this, 3093) as Vector2; }
32
- set end(v: Vector2) { _set(this, 3093, v); }
33
-
34
- constructor();
35
- constructor(from: Rect2);
36
- constructor(from: Rect2i);
37
- constructor(position: Vector2, size: Vector2);
38
- constructor(x: number, y: number, width: number, height: number);
39
- constructor(...args: any[]) { super(7, ...args); }
40
-
41
- /**
42
- * Returns the center point of the rectangle. This is the same as `position + (size / 2.0)`.
43
- */
44
- getCenter(): Vector2 { return _C(this, 4121) as Vector2; }
45
-
46
- /**
47
- * Returns the rectangle's area. This is equivalent to `size.x * size.y`. See also {@link hasArea}.
48
- */
49
- getArea(): number { return _C(this, 3789) as number; }
50
-
51
- /**
52
- * Returns `true` if this rectangle has positive width and height. See also {@link getArea}.
53
- */
54
- hasArea(): boolean { return _C(this, 7358) as boolean; }
55
-
56
- /**
57
- * Returns `true` if the rectangle contains the given `point`. By convention, points on the right and bottom edges are **not** included.
58
- * **Note:** This method is not reliable for {@link Rect2} with a *negative* {@link size}. Use {@link abs} first to get a valid rectangle.
59
- */
60
- hasPoint(point: Vector2): boolean { return _C(this, 7430, point) as boolean; }
61
-
62
- /**
63
- * Returns `true` if this rectangle and `rect` are approximately equal, by calling {@link Vector2.isEqualApprox} on the {@link position} and the {@link size}.
64
- */
65
- isEqualApprox(rect: Rect2): boolean { return _C(this, 7938, rect) as boolean; }
66
-
67
- /**
68
- * Returns `true` if this rectangle's values are finite, by calling {@link Vector2.isFinite} on the {@link position} and the {@link size}.
69
- */
70
- isFinite(): boolean { return _C(this, 7951) as boolean; }
71
-
72
- /**
73
- * Returns `true` if this rectangle overlaps with the `b` rectangle. The edges of both rectangles are excluded, unless `includeBorders` is `true`.
74
- */
75
- intersects(b: Rect2, includeBorders?: boolean /* = false */): boolean { return _C(this, 7707, b, includeBorders) as boolean; }
76
-
77
- /**
78
- * Returns `true` if this rectangle *completely* encloses the `b` rectangle.
79
- */
80
- encloses(b: Rect2): boolean { return _C(this, 3077, b) as boolean; }
81
-
82
- /**
83
- * Returns the intersection between this rectangle and `b`. If the rectangles do not intersect, returns an empty {@link Rect2}.
84
- *
85
- *
86
- * ```gdscript
87
- *
88
- * var rect1 = Rect2(0, 0, 5, 10)
89
- * var rect2 = Rect2(2, 0, 8, 4)
90
- *
91
- * var a = rect1.intersection(rect2) # a is Rect2(2, 0, 3, 4)
92
- *
93
- * ```
94
- *
95
- *
96
- *
97
- * **Note:** If you only need to know whether two rectangles are overlapping, use {@link intersects}, instead.
98
- */
99
- intersection(b: Rect2): Rect2 { return _C(this, 7705, b) as Rect2; }
100
-
101
- /**
102
- * Returns a {@link Rect2} that encloses both this rectangle and `b` around the edges. See also {@link encloses}.
103
- */
104
- merge(b: Rect2): Rect2 { return _C(this, 8850, b) as Rect2; }
105
-
106
- /**
107
- * Returns a copy of this rectangle expanded to align the edges with the given `to` point, if necessary.
108
- *
109
- *
110
- * ```gdscript
111
- *
112
- * var rect = Rect2(0, 0, 5, 2)
113
- *
114
- * rect = rect.expand(Vector2(10, 0)) # rect is Rect2(0, 0, 10, 2)
115
- * rect = rect.expand(Vector2(-5, 5)) # rect is Rect2(-5, 0, 15, 5)
116
- *
117
- * ```
118
- */
119
- expand(to: Vector2): Rect2 { return _C(this, 3187, to) as Rect2; }
120
-
121
- /**
122
- * Returns the vertex's position of this rect that's the farthest in the given direction. This point is commonly known as the support point in collision detection algorithms.
123
- */
124
- getSupport(direction: Vector2): Vector2 { return _C(this, 6612, direction) as Vector2; }
125
-
126
- /**
127
- * Returns a copy of this rectangle extended on all sides by the given `amount`. A negative `amount` shrinks the rectangle instead. See also {@link growIndividual} and {@link growSide}.
128
- *
129
- *
130
- * ```gdscript
131
- *
132
- * var a = Rect2(4, 4, 8, 8).grow(4) # a is Rect2(0, 0, 16, 16)
133
- * var b = Rect2(0, 0, 8, 4).grow(2) # b is Rect2(-2, -2, 12, 8)
134
- *
135
- * ```
136
- */
137
- grow(amount: number): Rect2 { return _C(this, 7304, amount) as Rect2; }
138
-
139
- /**
140
- * Returns a copy of this rectangle with its `side` extended by the given `amount` (see {@link Side} constants). A negative `amount` shrinks the rectangle, instead. See also {@link grow} and {@link growIndividual}.
141
- */
142
- growSide(side: number, amount: number): Rect2 { return _C(this, 7311, side, amount) as Rect2; }
143
-
144
- /**
145
- * Returns a copy of this rectangle with its `left`, `top`, `right`, and `bottom` sides extended by the given amounts. Negative values shrink the sides, instead. See also {@link grow} and {@link growSide}.
146
- */
147
- growIndividual(left: number, top: number, right: number, bottom: number): Rect2 { return _C(this, 7309, left, top, right, bottom) as Rect2; }
148
-
149
- /**
150
- * Returns a {@link Rect2} equivalent to this rectangle, with its width and height modified to be non-negative values, and with its {@link position} being the top-left corner of the rectangle.
151
- *
152
- *
153
- * ```gdscript
154
- *
155
- * var rect = Rect2(25, 25, -100, -50)
156
- * var absolute = rect.abs() # absolute is Rect2(-75, -25, 100, 50)
157
- *
158
- * ```
159
- *
160
- *
161
- *
162
- * **Note:** It's recommended to use this method when {@link size} is negative, as most other methods in Godot assume that the {@link position} is the top-left corner, and the {@link end} is the bottom-right corner.
163
- */
164
- abs(): Rect2 { return _C(this, 1053) as Rect2; }
165
-
166
- equals(other: Variant | Rect2): boolean { return _C(this, -1, other) as boolean; }
167
-
168
- notEquals(other: Variant | Rect2): boolean { return _C(this, -2, other) as boolean; }
169
-
170
- not(): boolean { return _C(this, -24, undefined) as boolean; }
171
-
172
- /**
173
- * Inversely transforms (multiplies) the {@link Rect2} by the given {@link Transform2D} transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
174
- * `rect * transform` is equivalent to `transform.inverse() * rect`. See {@link Transform2D.inverse}.
175
- * For transforming by inverse of an affine transformation (e.g. with scaling) `transform.affine_inverse() * rect` can be used instead. See {@link Transform2D.affineInverse}.
176
- */
177
- mul(other: Transform2D): Rect2 { return _C(this, -9, other) as Rect2; }
178
-
179
- contains(other: GodotDictionary | GodotArray): boolean { return _C(this, -25, other) as boolean; }
180
-
181
- static readonly name = _R(7, Rect2);
182
- }
14
+ export type Rect2 = [x: number, y: number, w: number, h: number];
15
+
16
+ /**
17
+ * Returns the center point of the rectangle. This is the same as `position + (size / 2.0)`.
18
+ */
19
+ export function getCenter(self: Rect2): Vector2 { return _V(7, 4121, self) as Vector2; }
20
+
21
+ /**
22
+ * Returns the rectangle's area. This is equivalent to `size.x * size.y`. See also {@link hasArea}.
23
+ */
24
+ export function getArea(self: Rect2): number { return _V(7, 3789, self) as number; }
25
+
26
+ /**
27
+ * Returns `true` if this rectangle has positive width and height. See also {@link getArea}.
28
+ */
29
+ export function hasArea(self: Rect2): boolean { return _V(7, 7358, self) as boolean; }
30
+
31
+ /**
32
+ * Returns `true` if the rectangle contains the given `point`. By convention, points on the right and bottom edges are **not** included.
33
+ * **Note:** This method is not reliable for {@link Rect2} with a *negative* {@link size}. Use {@link abs} first to get a valid rectangle.
34
+ */
35
+ export function hasPoint(self: Rect2, point: Vector2): boolean { return _V(7, 7430, self, point) as boolean; }
36
+
37
+ /**
38
+ * Returns `true` if this rectangle and `rect` are approximately equal, by calling {@link Vector2.isEqualApprox} on the {@link position} and the {@link size}.
39
+ */
40
+ export function isEqualApprox(self: Rect2, rect: Rect2): boolean { return _V(7, 7938, self, rect) as boolean; }
41
+
42
+ /**
43
+ * Returns `true` if this rectangle's values are finite, by calling {@link Vector2.isFinite} on the {@link position} and the {@link size}.
44
+ */
45
+ export function isFinite(self: Rect2): boolean { return _V(7, 7951, self) as boolean; }
46
+
47
+ /**
48
+ * Returns `true` if this rectangle overlaps with the `b` rectangle. The edges of both rectangles are excluded, unless `includeBorders` is `true`.
49
+ */
50
+ export function intersects(self: Rect2, b: Rect2, includeBorders?: boolean /* = false */): boolean { return _V(7, 7707, self, b, includeBorders) as boolean; }
51
+
52
+ /**
53
+ * Returns `true` if this rectangle *completely* encloses the `b` rectangle.
54
+ */
55
+ export function encloses(self: Rect2, b: Rect2): boolean { return _V(7, 3077, self, b) as boolean; }
56
+
57
+ /**
58
+ * Returns the intersection between this rectangle and `b`. If the rectangles do not intersect, returns an empty {@link Rect2}.
59
+ *
60
+ *
61
+ * ```gdscript
62
+ *
63
+ * var rect1 = Rect2(0, 0, 5, 10)
64
+ * var rect2 = Rect2(2, 0, 8, 4)
65
+ *
66
+ * var a = rect1.intersection(rect2) # a is Rect2(2, 0, 3, 4)
67
+ *
68
+ * ```
69
+ *
70
+ *
71
+ *
72
+ * **Note:** If you only need to know whether two rectangles are overlapping, use {@link intersects}, instead.
73
+ */
74
+ export function intersection(self: Rect2, b: Rect2): Rect2 { return _V(7, 7705, self, b) as Rect2; }
75
+
76
+ /**
77
+ * Returns a {@link Rect2} that encloses both this rectangle and `b` around the edges. See also {@link encloses}.
78
+ */
79
+ export function merge(self: Rect2, b: Rect2): Rect2 { return _V(7, 8850, self, b) as Rect2; }
80
+
81
+ /**
82
+ * Returns a copy of this rectangle expanded to align the edges with the given `to` point, if necessary.
83
+ *
84
+ *
85
+ * ```gdscript
86
+ *
87
+ * var rect = Rect2(0, 0, 5, 2)
88
+ *
89
+ * rect = rect.expand(Vector2(10, 0)) # rect is Rect2(0, 0, 10, 2)
90
+ * rect = rect.expand(Vector2(-5, 5)) # rect is Rect2(-5, 0, 15, 5)
91
+ *
92
+ * ```
93
+ */
94
+ export function expand(self: Rect2, to: Vector2): Rect2 { return _V(7, 3187, self, to) as Rect2; }
95
+
96
+ /**
97
+ * Returns the vertex's position of this rect that's the farthest in the given direction. This point is commonly known as the support point in collision detection algorithms.
98
+ */
99
+ export function getSupport(self: Rect2, direction: Vector2): Vector2 { return _V(7, 6612, self, direction) as Vector2; }
100
+
101
+ /**
102
+ * Returns a copy of this rectangle extended on all sides by the given `amount`. A negative `amount` shrinks the rectangle instead. See also {@link growIndividual} and {@link growSide}.
103
+ *
104
+ *
105
+ * ```gdscript
106
+ *
107
+ * var a = Rect2(4, 4, 8, 8).grow(4) # a is Rect2(0, 0, 16, 16)
108
+ * var b = Rect2(0, 0, 8, 4).grow(2) # b is Rect2(-2, -2, 12, 8)
109
+ *
110
+ * ```
111
+ */
112
+ export function grow(self: Rect2, amount: number): Rect2 { return _V(7, 7304, self, amount) as Rect2; }
113
+
114
+ /**
115
+ * Returns a copy of this rectangle with its `side` extended by the given `amount` (see {@link Side} constants). A negative `amount` shrinks the rectangle, instead. See also {@link grow} and {@link growIndividual}.
116
+ */
117
+ export function growSide(self: Rect2, side: number, amount: number): Rect2 { return _V(7, 7311, self, side, amount) as Rect2; }
118
+
119
+ /**
120
+ * Returns a copy of this rectangle with its `left`, `top`, `right`, and `bottom` sides extended by the given amounts. Negative values shrink the sides, instead. See also {@link grow} and {@link growSide}.
121
+ */
122
+ export function growIndividual(self: Rect2, left: number, top: number, right: number, bottom: number): Rect2 { return _V(7, 7309, self, left, top, right, bottom) as Rect2; }
123
+
124
+ /**
125
+ * Returns a {@link Rect2} equivalent to this rectangle, with its width and height modified to be non-negative values, and with its {@link position} being the top-left corner of the rectangle.
126
+ *
127
+ *
128
+ * ```gdscript
129
+ *
130
+ * var rect = Rect2(25, 25, -100, -50)
131
+ * var absolute = rect.abs() # absolute is Rect2(-75, -25, 100, 50)
132
+ *
133
+ * ```
134
+ *
135
+ *
136
+ *
137
+ * **Note:** It's recommended to use this method when {@link size} is negative, as most other methods in Godot assume that the {@link position} is the top-left corner, and the {@link end} is the bottom-right corner.
138
+ */
139
+ export function abs(self: Rect2): Rect2 { return _V(7, 1053, self) as Rect2; }
140
+
141
+ export function equals(a: Rect2, b: Variant | Rect2): boolean { return _V(7, -1, a, b) as boolean; }
142
+
143
+ export function notEquals(a: Rect2, b: Variant | Rect2): boolean { return _V(7, -2, a, b) as boolean; }
144
+
145
+ export function not(self: Rect2): boolean { return _V(7, -24, self, undefined) as boolean; }
146
+
147
+ /**
148
+ * Inversely transforms (multiplies) the {@link Rect2} by the given {@link Transform2D} transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
149
+ * `rect * transform` is equivalent to `transform.inverse() * rect`. See {@link Transform2D.inverse}.
150
+ * For transforming by inverse of an affine transformation (e.g. with scaling) `transform.affine_inverse() * rect` can be used instead. See {@link Transform2D.affineInverse}.
151
+ */
152
+ export function mul(a: Rect2, b: Transform2D): Rect2 { return _V(7, -9, a, b) as Rect2; }
153
+
154
+ export function contains(a: Rect2, b: GodotDictionary | GodotArray): boolean { return _V(7, -25, a, b) as boolean; }
155
+
156
+ /**
157
+ * Constructs a {@link Rect2} with its {@link position} and {@link size} set to {@link Vector2.ZERO}.
158
+ */
159
+ export function create(): Rect2 { return _V(7, -4096, 0) as Rect2; }
160
+
161
+ /**
162
+ * Constructs a {@link Rect2} as a copy of the given {@link Rect2}.
163
+ */
164
+ export function fromRect2(from: Rect2): Rect2 { return _V(7, -4096, 1, from) as Rect2; }
165
+
166
+ /**
167
+ * Constructs a {@link Rect2} from a {@link Rect2i}.
168
+ */
169
+ export function fromRect2i(from: Rect2i): Rect2 { return _V(7, -4096, 2, from) as Rect2; }
170
+
171
+ /**
172
+ * Constructs a {@link Rect2} by `position` and `size`.
173
+ */
174
+ export function fromPositionSize(position: Vector2, size: Vector2): Rect2 { return _V(7, -4096, 3, position, size) as Rect2; }
175
+
176
+ /**
177
+ * Constructs a {@link Rect2} by setting its {@link position} to (`x`, `y`), and its {@link size} to (`width`, `height`).
178
+ */
179
+ export function fromXYWidthHeight(x: number, y: number, width: number, height: number): Rect2 { return _V(7, -4096, 4, x, y, width, height) as Rect2; }
180
+