@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.
- package/README.md +19 -1
- package/gen/classes/ArrayOccluder3D.ts +1 -1
- package/gen/classes/CPUParticles2D.ts +3 -3
- package/gen/classes/CPUParticles3D.ts +3 -3
- package/gen/classes/CSGPolygon3D.ts +1 -1
- package/gen/classes/CollisionPolygon2D.ts +1 -1
- package/gen/classes/CollisionPolygon3D.ts +1 -1
- package/gen/classes/ColorPalette.ts +1 -1
- package/gen/classes/ConcavePolygonShape2D.ts +1 -1
- package/gen/classes/ConcavePolygonShape3D.ts +1 -1
- package/gen/classes/ConvexPolygonShape2D.ts +1 -1
- package/gen/classes/ConvexPolygonShape3D.ts +1 -1
- package/gen/classes/FontVariation.ts +1 -1
- package/gen/classes/Gradient.ts +1 -1
- package/gen/classes/Line2D.ts +1 -1
- package/gen/classes/MultiMesh.ts +4 -4
- package/gen/classes/NavigationMesh.ts +1 -1
- package/gen/classes/NavigationObstacle2D.ts +1 -1
- package/gen/classes/NavigationObstacle3D.ts +1 -1
- package/gen/classes/NavigationPathQueryResult2D.ts +1 -1
- package/gen/classes/NavigationPathQueryResult3D.ts +1 -1
- package/gen/classes/NavigationPolygon.ts +1 -1
- package/gen/classes/OccluderPolygon2D.ts +1 -1
- package/gen/classes/Polygon2D.ts +3 -3
- package/gen/classes/PolygonOccluder3D.ts +1 -1
- package/gen/classes/Window.ts +1 -1
- package/gen/index.ts +0 -3
- package/gen/utility-functions.ts +114 -114
- package/gen/value-types/AABB.ts +267 -277
- package/gen/value-types/Basis.ts +313 -264
- package/gen/value-types/Color.ts +398 -268
- package/gen/value-types/Plane.ts +121 -125
- package/gen/value-types/Projection.ts +178 -126
- package/gen/value-types/Quaternion.ts +180 -179
- package/gen/value-types/Rect2.ts +169 -171
- package/gen/value-types/Rect2i.ts +148 -150
- package/gen/value-types/Transform2D.ts +192 -194
- package/gen/value-types/Transform3D.ts +133 -126
- package/gen/value-types/Vector2.ts +370 -354
- package/gen/value-types/Vector2i.ts +192 -191
- package/gen/value-types/Vector3.ts +354 -354
- package/gen/value-types/Vector3i.ts +187 -192
- package/gen/value-types/Vector4.ts +263 -274
- package/gen/value-types/Vector4i.ts +187 -198
- package/gen/value-types/index.ts +16 -16
- package/package.json +20 -4
- package/src/debug.ts +30 -27
- package/src/index.ts +0 -2
- 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 {
|
|
4
|
+
import { _V } from '../../src/runtime.ts';
|
|
5
5
|
import type { GodotArray, GodotDictionary, Variant } from '../heap-types/index.ts';
|
|
6
|
-
import type { Rect2, Vector2i } from '
|
|
6
|
+
import type { Rect2, Vector2i } from './index.ts';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The {@link Rect2i} built-in {@link Variant} type represents an axis-aligned rectangle in a 2D space, using integer coordinates. It is defined by its {@link position} and {@link size}, which are {@link Vector2i}. Because it does not rotate, it is frequently used for fast overlap tests (see {@link intersects}).
|
|
@@ -11,151 +11,149 @@ import type { Rect2, Vector2i } from '../value-types/index.ts';
|
|
|
11
11
|
* **Note:** Negative values for {@link size} are not supported. With negative size, most {@link Rect2i} methods do not work correctly. Use {@link abs} to get an equivalent {@link Rect2i} with a non-negative size.
|
|
12
12
|
* **Note:** In a boolean context, a {@link Rect2i} evaluates to `false` if both {@link position} and {@link size} are zero (equal to {@link Vector2i.ZERO}). Otherwise, it always evaluates to `true`.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
static readonly name = _R(8, Rect2i);
|
|
161
|
-
}
|
|
14
|
+
export type Rect2i = [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)`.
|
|
18
|
+
* **Note:** If the {@link size} is odd, the result will be rounded towards {@link position}.
|
|
19
|
+
*/
|
|
20
|
+
export function getCenter(self: Rect2i): Vector2i { return _V(8, 4121, self) as Vector2i; }
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns the rectangle's area. This is equivalent to `size.x * size.y`. See also {@link hasArea}.
|
|
24
|
+
*/
|
|
25
|
+
export function getArea(self: Rect2i): number { return _V(8, 3789, self) as number; }
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Returns `true` if this rectangle has positive width and height. See also {@link getArea}.
|
|
29
|
+
*/
|
|
30
|
+
export function hasArea(self: Rect2i): boolean { return _V(8, 7358, self) as boolean; }
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Returns `true` if the rectangle contains the given `point`. By convention, points on the right and bottom edges are **not** included.
|
|
34
|
+
* **Note:** This method is not reliable for {@link Rect2i} with a *negative* {@link size}. Use {@link abs} first to get a valid rectangle.
|
|
35
|
+
*/
|
|
36
|
+
export function hasPoint(self: Rect2i, point: Vector2i): boolean { return _V(8, 7430, self, point) as boolean; }
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Returns `true` if this rectangle overlaps with the `b` rectangle. The edges of both rectangles are excluded.
|
|
40
|
+
*/
|
|
41
|
+
export function intersects(self: Rect2i, b: Rect2i): boolean { return _V(8, 7707, self, b) as boolean; }
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns `true` if this {@link Rect2i} completely encloses another one.
|
|
45
|
+
*/
|
|
46
|
+
export function encloses(self: Rect2i, b: Rect2i): boolean { return _V(8, 3077, self, b) as boolean; }
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Returns the intersection between this rectangle and `b`. If the rectangles do not intersect, returns an empty {@link Rect2i}.
|
|
50
|
+
*
|
|
51
|
+
*
|
|
52
|
+
* ```gdscript
|
|
53
|
+
*
|
|
54
|
+
* var a = Rect2i(0, 0, 5, 10)
|
|
55
|
+
* var b = Rect2i(2, 0, 8, 4)
|
|
56
|
+
*
|
|
57
|
+
* var c = a.intersection(b) # c is Rect2i(2, 0, 3, 4)
|
|
58
|
+
*
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
*
|
|
62
|
+
*
|
|
63
|
+
* **Note:** If you only need to know whether two rectangles are overlapping, use {@link intersects}, instead.
|
|
64
|
+
*/
|
|
65
|
+
export function intersection(self: Rect2i, b: Rect2i): Rect2i { return _V(8, 7705, self, b) as Rect2i; }
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Returns a {@link Rect2i} that encloses both this rectangle and `b` around the edges. See also {@link encloses}.
|
|
69
|
+
*/
|
|
70
|
+
export function merge(self: Rect2i, b: Rect2i): Rect2i { return _V(8, 8850, self, b) as Rect2i; }
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Returns a copy of this rectangle expanded to align the edges with the given `to` point, if necessary.
|
|
74
|
+
*
|
|
75
|
+
*
|
|
76
|
+
* ```gdscript
|
|
77
|
+
*
|
|
78
|
+
* var rect = Rect2i(0, 0, 5, 2)
|
|
79
|
+
*
|
|
80
|
+
* rect = rect.expand(Vector2i(10, 0)) # rect is Rect2i(0, 0, 10, 2)
|
|
81
|
+
* rect = rect.expand(Vector2i(-5, 5)) # rect is Rect2i(-5, 0, 15, 5)
|
|
82
|
+
*
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export function expand(self: Rect2i, to: Vector2i): Rect2i { return _V(8, 3187, self, to) as Rect2i; }
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* 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}.
|
|
89
|
+
*
|
|
90
|
+
*
|
|
91
|
+
* ```gdscript
|
|
92
|
+
*
|
|
93
|
+
* var a = Rect2i(4, 4, 8, 8).grow(4) # a is Rect2i(0, 0, 16, 16)
|
|
94
|
+
* var b = Rect2i(0, 0, 8, 4).grow(2) # b is Rect2i(-2, -2, 12, 8)
|
|
95
|
+
*
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export function grow(self: Rect2i, amount: number): Rect2i { return _V(8, 7304, self, amount) as Rect2i; }
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 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}.
|
|
102
|
+
*/
|
|
103
|
+
export function growSide(self: Rect2i, side: number, amount: number): Rect2i { return _V(8, 7311, self, side, amount) as Rect2i; }
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* 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}.
|
|
107
|
+
*/
|
|
108
|
+
export function growIndividual(self: Rect2i, left: number, top: number, right: number, bottom: number): Rect2i { return _V(8, 7309, self, left, top, right, bottom) as Rect2i; }
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Returns a {@link Rect2i} 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.
|
|
112
|
+
*
|
|
113
|
+
*
|
|
114
|
+
* ```gdscript
|
|
115
|
+
*
|
|
116
|
+
* var rect = Rect2i(25, 25, -100, -50)
|
|
117
|
+
* var absolute = rect.abs() # absolute is Rect2i(-75, -25, 100, 50)
|
|
118
|
+
*
|
|
119
|
+
* ```
|
|
120
|
+
*
|
|
121
|
+
*
|
|
122
|
+
*
|
|
123
|
+
* **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.
|
|
124
|
+
*/
|
|
125
|
+
export function abs(self: Rect2i): Rect2i { return _V(8, 1053, self) as Rect2i; }
|
|
126
|
+
|
|
127
|
+
export function equals(a: Rect2i, b: Variant | Rect2i): boolean { return _V(8, -1, a, b) as boolean; }
|
|
128
|
+
|
|
129
|
+
export function notEquals(a: Rect2i, b: Variant | Rect2i): boolean { return _V(8, -2, a, b) as boolean; }
|
|
130
|
+
|
|
131
|
+
export function not(self: Rect2i): boolean { return _V(8, -24, self, undefined) as boolean; }
|
|
132
|
+
|
|
133
|
+
export function contains(a: Rect2i, b: GodotDictionary | GodotArray): boolean { return _V(8, -25, a, b) as boolean; }
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Constructs a {@link Rect2i} with its {@link position} and {@link size} set to {@link Vector2i.ZERO}.
|
|
137
|
+
*/
|
|
138
|
+
export function create(): Rect2i { return _V(8, -4096, 0) as Rect2i; }
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Constructs a {@link Rect2i} as a copy of the given {@link Rect2i}.
|
|
142
|
+
*/
|
|
143
|
+
export function fromRect2i(from: Rect2i): Rect2i { return _V(8, -4096, 1, from) as Rect2i; }
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Constructs a {@link Rect2i} from a {@link Rect2}. The floating-point coordinates are truncated.
|
|
147
|
+
*/
|
|
148
|
+
export function fromRect2(from: Rect2): Rect2i { return _V(8, -4096, 2, from) as Rect2i; }
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Constructs a {@link Rect2i} by `position` and `size`.
|
|
152
|
+
*/
|
|
153
|
+
export function fromPositionSize(position: Vector2i, size: Vector2i): Rect2i { return _V(8, -4096, 3, position, size) as Rect2i; }
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Constructs a {@link Rect2i} by setting its {@link position} to (`x`, `y`), and its {@link size} to (`width`, `height`).
|
|
157
|
+
*/
|
|
158
|
+
export function fromXYWidthHeight(x: number, y: number, width: number, height: number): Rect2i { return _V(8, -4096, 4, x, y, width, height) as Rect2i; }
|
|
159
|
+
|