@defold-typescript/library-types 0.23.0 → 0.24.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/api-doc/boom.json +3870 -0
- package/api-doc/bridge.json +10 -5
- package/api-doc/bzAnim.json +338 -0
- package/api-doc/decore.json +1 -1
- package/api-doc/defcon.json +150 -0
- package/api-doc/{defmath.defmath.json → defmath.json} +6 -46
- package/api-doc/defsave.json +518 -0
- package/api-doc/deftest.json +741 -0
- package/api-doc/{dicebag.dicebag.json → dicebag.json} +19 -1
- package/api-doc/druid.json +90 -92
- package/api-doc/event.json +16 -16
- package/api-doc/gooey.json +2050 -0
- package/api-doc/in.accelerometer.json +75 -1
- package/api-doc/in.button.json +17 -10
- package/api-doc/in.cursor.json +26 -0
- package/api-doc/in.gesture.json +401 -6
- package/api-doc/in.keyboard.json +2 -0
- package/api-doc/in.mapper.json +12 -8
- package/api-doc/in.onscreen.json +61 -5
- package/api-doc/in.state.json +61 -13
- package/api-doc/in.textbox.json +23 -12
- package/api-doc/in.triggers.json +336 -0
- package/api-doc/lang.json +5 -5
- package/api-doc/log.json +1 -1
- package/api-doc/metrics.fps.json +61 -2
- package/api-doc/metrics.mem.json +61 -2
- package/api-doc/monarch.monarch.json +249 -7
- package/api-doc/monarch.transitions.easings.json +19 -26
- package/api-doc/monarch.transitions.gui.json +782 -79
- package/api-doc/nakama.engine.defold.json +31 -18
- package/api-doc/{nakama.nakama.json → nakama.json} +4752 -2554
- package/api-doc/nakama.util.log.json +32 -4
- package/api-doc/narrator.json +1 -1
- package/api-doc/openapi/nakama.nakama.json +7680 -0
- package/api-doc/orthographic.camera.json +96 -98
- package/api-doc/orthographic.json +602 -0
- package/api-doc/panthera.json +1183 -0
- package/api-doc/{persist.persist.json → persist.json} +26 -1
- package/api-doc/{platypus.platypus.json → platypus.json} +68 -14
- package/api-doc/{rendy.rendy.json → rendy.json} +46 -99
- package/api-doc/richtext.color.json +77 -0
- package/api-doc/richtext.richtext.json +375 -5
- package/api-doc/saver.saver.json +2 -1
- package/api-doc/saver.storage.json +2 -1
- package/api-doc/{starly.starly.json → starly.json} +1 -1
- package/api-doc/{yagames.yagames.json → yagames.json} +784 -189
- package/api-doc/{zzfx.api.json → zzfx.json} +9 -9
- package/authored-targets.json +403 -0
- package/generated/{boom.boom.d.ts → boom.d.ts} +14 -0
- package/generated/bridge.d.ts +5 -5
- package/generated/{bzAnim.bzLibrary.d.ts → bzAnim.d.ts} +6 -0
- package/generated/decore.d.ts +1 -1
- package/generated/defcon.d.ts +43 -0
- package/generated/{defmath.defmath.d.ts → defmath.d.ts} +3 -2
- package/generated/defsave.d.ts +144 -0
- package/generated/{dicebag.dicebag.d.ts → dicebag.d.ts} +25 -0
- package/generated/druid.d.ts +81 -79
- package/generated/event.d.ts +15 -15
- package/generated/{gooey.gooey.d.ts → gooey.d.ts} +61 -6
- package/generated/in.onscreen.d.ts +5 -0
- package/generated/in.textbox.d.ts +4 -0
- package/generated/lang.d.ts +5 -5
- package/generated/log.d.ts +1 -1
- package/generated/metrics.fps.d.ts +19 -1
- package/generated/metrics.mem.d.ts +19 -1
- package/generated/monarch.monarch.d.ts +44 -1
- package/generated/monarch.transitions.easings.d.ts +0 -1
- package/generated/monarch.transitions.gui.d.ts +96 -12
- package/generated/nakama.d.ts +1158 -0
- package/generated/nakama.engine.defold.d.ts +3 -1
- package/generated/nakama.util.log.d.ts +6 -0
- package/generated/narrator.d.ts +1 -1
- package/generated/openapi/nakama.nakama.d.ts +884 -0
- package/generated/orthographic.camera.d.ts +24 -38
- package/generated/orthographic.d.ts +155 -0
- package/generated/panthera.d.ts +170 -0
- package/generated/{persist.persist.d.ts → persist.d.ts} +3 -0
- package/generated/{platypus.platypus.d.ts → platypus.d.ts} +9 -0
- package/generated/{rendy.rendy.d.ts → rendy.d.ts} +33 -80
- package/generated/richtext.color.d.ts +15 -0
- package/generated/saver.saver.d.ts +2 -0
- package/generated/saver.storage.d.ts +2 -0
- package/generated/{yagames.yagames.d.ts → yagames.d.ts} +151 -29
- package/generated/{zzfx.api.d.ts → zzfx.d.ts} +7 -0
- package/library-classification.json +0 -156
- package/library-targets.json +1 -218
- package/luals-targets.json +56 -3
- package/openapi-targets.json +17 -0
- package/package.json +7 -57
- package/scripts/__snapshots__/parse-luals.test.ts.snap +164 -10
- package/scripts/apply-luals-overrides.ts +39 -7
- package/scripts/authored-parity.ts +718 -0
- package/scripts/emit-library-dts.ts +94 -17
- package/scripts/extract-api-doc.ts +189 -38
- package/scripts/fidelity-floor.ts +178 -0
- package/scripts/import-upstream-docs.ts +125 -0
- package/scripts/lower-api-doc.ts +21 -3
- package/scripts/luals-fidelity.ts +16 -11
- package/scripts/map-luals-types.ts +52 -21
- package/scripts/parse-lua-surface.ts +187 -0
- package/scripts/parse-luals.ts +50 -4
- package/scripts/parse-markdown-api.ts +247 -0
- package/scripts/parse-openapi-api.ts +313 -0
- package/scripts/sync-authored-types.ts +249 -0
- package/scripts/sync-library-types.ts +99 -3
- package/scripts/sync-luals-types.ts +14 -1
- package/scripts/sync-markdown-types.ts +761 -0
- package/scripts/sync-openapi-types.ts +308 -0
- package/scripts/sync-script-api-types.ts +16 -17
- package/api-doc/boom.boom.json +0 -26
- package/api-doc/bzAnim.bzLibrary.json +0 -156
- package/api-doc/defcon.console.json +0 -109
- package/api-doc/defsave.defsave.json +0 -175
- package/api-doc/deftest.deftest.json +0 -71
- package/api-doc/gooey.gooey.json +0 -963
- package/generated/defcon.console.d.ts +0 -24
- package/generated/defsave.defsave.d.ts +0 -31
- package/generated/nakama.nakama.d.ts +0 -594
- /package/generated/{deftest.deftest.d.ts → deftest.d.ts} +0 -0
- /package/generated/{starly.starly.d.ts → starly.d.ts} +0 -0
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
declare module 'orthographic.camera' {
|
|
8
8
|
/**
|
|
9
|
-
* Follow
|
|
9
|
+
* Follow one or more game objects. When following multiple objects the camera will follow the center point between the objects.
|
|
10
10
|
* @param camera_id undefined for the first camera
|
|
11
|
-
* @param
|
|
11
|
+
* @param targets Game object(s) to follow
|
|
12
12
|
* @param options Options
|
|
13
13
|
*/
|
|
14
14
|
export function follow(
|
|
15
15
|
camera_id: Hash | Url | undefined,
|
|
16
|
-
|
|
16
|
+
targets: Hash | Url | (Hash | Url)[],
|
|
17
17
|
options?: {
|
|
18
18
|
/**
|
|
19
19
|
* Lerp from current position to target position with lerp as t.
|
|
@@ -54,6 +54,24 @@ declare module 'orthographic.camera' {
|
|
|
54
54
|
zoom: number,
|
|
55
55
|
): void;
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Get if the camera is configured to use automatic zoom level.
|
|
59
|
+
* @param camera_id undefined for the first camera
|
|
60
|
+
*/
|
|
61
|
+
export function get_automatic_zoom(
|
|
62
|
+
camera_id: Hash | Url | undefined,
|
|
63
|
+
): boolean;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Set if the camera should use automatic zoom level.
|
|
67
|
+
* @param camera_id undefined for the first camera
|
|
68
|
+
* @param enabled True if automatic zoom should be enabled
|
|
69
|
+
*/
|
|
70
|
+
export function set_automatic_zoom(
|
|
71
|
+
camera_id: Hash | Url | undefined,
|
|
72
|
+
enabled: boolean,
|
|
73
|
+
): void;
|
|
74
|
+
|
|
57
75
|
/**
|
|
58
76
|
* Shake the camera.
|
|
59
77
|
* @param camera_id undefined for the first camera
|
|
@@ -133,12 +151,6 @@ declare module 'orthographic.camera' {
|
|
|
133
151
|
camera_id: Hash | Url | undefined,
|
|
134
152
|
): Matrix4;
|
|
135
153
|
|
|
136
|
-
/**
|
|
137
|
-
* Get the current projection id of the camera.
|
|
138
|
-
* @param camera_id undefined for the first camera
|
|
139
|
-
*/
|
|
140
|
-
export function get_projection_id(camera_id: Hash | Url | undefined): Hash;
|
|
141
|
-
|
|
142
154
|
/**
|
|
143
155
|
* Apply a recoil effect to the camera. The recoil will decay using linear interpolation.
|
|
144
156
|
* @param camera_id
|
|
@@ -214,18 +226,13 @@ declare module 'orthographic.camera' {
|
|
|
214
226
|
): Vector4;
|
|
215
227
|
|
|
216
228
|
/**
|
|
217
|
-
* Translate world coordinates to screen coordinates, based on the view and projection of the camera
|
|
229
|
+
* Translate world coordinates to screen coordinates, based on the view and projection of the camera. This is useful when manually culling game objects and you need to determine if a world coordinate will be visible or not. It can also be used to position gui nodes on top of game objects.
|
|
218
230
|
* @param camera_id undefined for the first camera
|
|
219
231
|
* @param world World coordinates to convert
|
|
220
|
-
* @param adjust_mode One of gui.ADJUST_FIT, gui.ADJUST_ZOOM and gui.ADJUST_STRETCH, or undefined to not take into account the adjust mode.
|
|
221
232
|
*/
|
|
222
233
|
export function world_to_screen(
|
|
223
234
|
camera_id: Hash | Url | undefined,
|
|
224
235
|
world: Vector3,
|
|
225
|
-
adjust_mode?:
|
|
226
|
-
| typeof gui.ADJUST_FIT
|
|
227
|
-
| typeof gui.ADJUST_STRETCH
|
|
228
|
-
| typeof gui.ADJUST_ZOOM,
|
|
229
236
|
): Vector3;
|
|
230
237
|
|
|
231
238
|
/**
|
|
@@ -252,26 +259,6 @@ declare module 'orthographic.camera' {
|
|
|
252
259
|
world: Vector3,
|
|
253
260
|
): Vector3;
|
|
254
261
|
|
|
255
|
-
/**
|
|
256
|
-
* Add a custom projector that can be used by cameras in your project (see configuration above).
|
|
257
|
-
* @param projector_id Id of the projector. Used as a value in the projection field of the camera script.
|
|
258
|
-
* @param projector_fn The function to call when a projection matrix is needed for the camera. The function will receive the id, near_z and far_z values of the camera.
|
|
259
|
-
*/
|
|
260
|
-
export function add_projector(
|
|
261
|
-
projector_id: Hash,
|
|
262
|
-
projector_fn: (id: Hash, near_z: number, far_z: number) => void,
|
|
263
|
-
): void;
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Set a specific projector for a camera. This must be either one of the predefined projectors (see above) or a custom projector added using `camera.add_projector()`.
|
|
267
|
-
* @param camera_id undefined for the first camera
|
|
268
|
-
* @param projector_id Id of the projector.
|
|
269
|
-
*/
|
|
270
|
-
export function use_projector(
|
|
271
|
-
camera_id: Hash | Url | undefined,
|
|
272
|
-
projector_id: Hash,
|
|
273
|
-
): void;
|
|
274
|
-
|
|
275
262
|
/**
|
|
276
263
|
* Set window scaling factor (basically retina or no retina screen). There is no built-in way to detect if Defold is running on a retina or non retina screen. This information combined with the High DPI setting in game.project can be used to ensure that the zoom behaves the same way regardless of screen type and High DPI setting. You can use an extension such as DefOS to get the window scaling factor.
|
|
277
264
|
* @param scaling_factor Current window scaling factor
|
|
@@ -288,8 +275,6 @@ declare module 'orthographic.camera' {
|
|
|
288
275
|
export const SHAKE_VERTICAL: Hash;
|
|
289
276
|
export const SHAKE_HORIZONTAL: Hash;
|
|
290
277
|
|
|
291
|
-
export const ORTHOGRAPHIC_RENDER_SCRIPT_USED: boolean;
|
|
292
|
-
|
|
293
278
|
export const MSG_DISABLE: Hash;
|
|
294
279
|
export const MSG_UNFOLLOW: Hash;
|
|
295
280
|
export const MSG_FOLLOW: Hash;
|
|
@@ -302,7 +287,8 @@ declare module 'orthographic.camera' {
|
|
|
302
287
|
export const MSG_BOUNDS: Hash;
|
|
303
288
|
export const MSG_UPDATE_CAMERA: Hash;
|
|
304
289
|
export const MSG_ZOOM_TO: Hash;
|
|
305
|
-
|
|
290
|
+
/** Posted to a camera to turn automatic zoom on or off. */
|
|
291
|
+
export const MSG_SET_AUTOMATIC_ZOOM: Hash;
|
|
306
292
|
export const MSG_VIEWPORT: Hash;
|
|
307
293
|
export const MSG_ENABLE: Hash;
|
|
308
294
|
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
/** @noResolution */
|
|
3
|
+
declare module 'orthographic.camera' {
|
|
4
|
+
/**
|
|
5
|
+
* (synthesized)
|
|
6
|
+
* Defold `orthographic` API namespace.
|
|
7
|
+
*/
|
|
8
|
+
export namespace orthographic {
|
|
9
|
+
/**
|
|
10
|
+
* Limits the camera position to within the specified rectangle.
|
|
11
|
+
*
|
|
12
|
+
* @param camera_id - nil for the first camera
|
|
13
|
+
* @param left - Left edge of the camera bounds
|
|
14
|
+
* @param top - Top edge of camera bounds
|
|
15
|
+
* @param right - Right edge of camera bounds
|
|
16
|
+
* @param bottom - Bottom edge of camera bounds
|
|
17
|
+
*/
|
|
18
|
+
function bounds(camera_id: Hash | Url | undefined, left: number, top: number, right: number, bottom: number): void;
|
|
19
|
+
/**
|
|
20
|
+
* If following a game object this will add a deadzone around the camera position where the camera position will not update. If the target moves to the edge of the deadzone the camera will start to follow until the target returns within the bounds of the deadzone.
|
|
21
|
+
*
|
|
22
|
+
* @param camera_id - nil for the first camera
|
|
23
|
+
* @param left - Number of pixels to the left of the camera
|
|
24
|
+
* @param top - Number of pixels above the camera
|
|
25
|
+
* @param right - Number of pixels to the right of the camera
|
|
26
|
+
* @param bottom - Number of pixels below the camera
|
|
27
|
+
*/
|
|
28
|
+
function deadzone(camera_id: Hash | Url | undefined, left: number, top: number, right: number, bottom: number): void;
|
|
29
|
+
/**
|
|
30
|
+
* Follow one or more game objects. When following multiple objects the camera will follow the center point between the objects.
|
|
31
|
+
*
|
|
32
|
+
* @param camera_id - nil for the first camera
|
|
33
|
+
* @param targets - Game object(s) to follow
|
|
34
|
+
* @param options - Options (see below)
|
|
35
|
+
*/
|
|
36
|
+
function follow(camera_id: Hash | Url | undefined, targets: Hash | Url | Record<string | number, unknown>, options?: Record<string | number, unknown>): void;
|
|
37
|
+
/**
|
|
38
|
+
* Change the camera follow offset.
|
|
39
|
+
*
|
|
40
|
+
* @param camera_id - nil for the first camera
|
|
41
|
+
* @param offset - Camera offset from target position.
|
|
42
|
+
*/
|
|
43
|
+
function follow_offset(camera_id: Hash | Url | undefined, offset: Vector3): void;
|
|
44
|
+
/**
|
|
45
|
+
* Get if the camera is configured to use automatic zoom level.
|
|
46
|
+
*
|
|
47
|
+
* @returns True if automatic zoom is enabled
|
|
48
|
+
*/
|
|
49
|
+
function get_automatic_zoom(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Get the display size, as specified in game.project.
|
|
52
|
+
*/
|
|
53
|
+
function get_display_size(): LuaMultiReturn<[number, number]>;
|
|
54
|
+
/**
|
|
55
|
+
* Get the current offset of the camera (caused by shake or recoil)
|
|
56
|
+
*
|
|
57
|
+
* @param camera_id - nil for the first camera
|
|
58
|
+
* @returns The current offset of the camera
|
|
59
|
+
*/
|
|
60
|
+
function get_offset(camera_id?: Hash | Url): Vector3;
|
|
61
|
+
/**
|
|
62
|
+
* Get the current projection of the camera.
|
|
63
|
+
*
|
|
64
|
+
* @param camera_id - nil for the first camera
|
|
65
|
+
* @returns The current projection
|
|
66
|
+
*/
|
|
67
|
+
function get_projection(camera_id?: Hash | Url): Matrix4;
|
|
68
|
+
/**
|
|
69
|
+
* Get the current view of the camera.
|
|
70
|
+
*
|
|
71
|
+
* @param camera_id - nil for the first camera
|
|
72
|
+
* @returns The current view
|
|
73
|
+
*/
|
|
74
|
+
function get_view(camera_id?: Hash | Url): Matrix4;
|
|
75
|
+
/**
|
|
76
|
+
* Get the current viewport of the camera.
|
|
77
|
+
*
|
|
78
|
+
* @param camera_id - nil for the first camera
|
|
79
|
+
*/
|
|
80
|
+
function get_viewport(camera_id?: Hash | Url): LuaMultiReturn<[number, number, number, number]>;
|
|
81
|
+
/**
|
|
82
|
+
* Get the current window size. The default values will be the ones specified in game.project.
|
|
83
|
+
*/
|
|
84
|
+
function get_window_size(): LuaMultiReturn<[number, number]>;
|
|
85
|
+
/**
|
|
86
|
+
* Get the current zoom level of the camera.
|
|
87
|
+
*
|
|
88
|
+
* @param camera_id - nil for the first camera
|
|
89
|
+
* @returns The current zoom of the camera
|
|
90
|
+
*/
|
|
91
|
+
function get_zoom(camera_id?: Hash | Url): number;
|
|
92
|
+
/**
|
|
93
|
+
* Apply a recoil effect to the camera. The recoil will decay using linear interpolation.
|
|
94
|
+
*
|
|
95
|
+
* @param offset - Offset to apply to the camera. Defaults to 0.05
|
|
96
|
+
* @param duration - Duration of the recoil, in seconds. Defaults to 0.5
|
|
97
|
+
*/
|
|
98
|
+
function recoil(camera_id: Hash | Url, offset: Vector3, duration?: number): void;
|
|
99
|
+
/**
|
|
100
|
+
* Translate screen coordinates to world coordinates, based on the view and projection of the camera.
|
|
101
|
+
*
|
|
102
|
+
* @param camera_id - nil for the first camera
|
|
103
|
+
* @param screen - Screen coordinates to convert
|
|
104
|
+
* @returns World coordinates
|
|
105
|
+
*/
|
|
106
|
+
function screen_to_world(camera_id: Hash | Url | undefined, screen: Vector3): Vector3;
|
|
107
|
+
/**
|
|
108
|
+
* Translate screen boundaries (corners) to world coordinates, based on the view and projection of the camera.
|
|
109
|
+
*
|
|
110
|
+
* @param camera_id - nil for the first camera
|
|
111
|
+
* @returns Screen bounds (x = left, y = top, z = right, w = bottom)
|
|
112
|
+
*/
|
|
113
|
+
function screen_to_world_bounds(camera_id?: Hash | Url): Vector4;
|
|
114
|
+
/**
|
|
115
|
+
* Set if the camera should use automatic zoom level.
|
|
116
|
+
*
|
|
117
|
+
* @param enabled - True if automatic zoom should be enabled
|
|
118
|
+
*/
|
|
119
|
+
function set_automatic_zoom(enabled: boolean): void;
|
|
120
|
+
/**
|
|
121
|
+
* Change the zoom level of the camera.
|
|
122
|
+
*
|
|
123
|
+
* @param camera_id - nil for the first camera
|
|
124
|
+
* @param zoom - The new zoom level of the camera
|
|
125
|
+
*/
|
|
126
|
+
function set_zoom(camera_id: Hash | Url | undefined, zoom: number): void;
|
|
127
|
+
/**
|
|
128
|
+
* Shake the camera.
|
|
129
|
+
*
|
|
130
|
+
* @param intensity - Intensity of the shake, in percent of screen. Defaults to 0.05
|
|
131
|
+
* @param duration - Duration of the shake, in seconds. Defaults to 0.5
|
|
132
|
+
* @param direction - Direction of the shake. Possible values: `both`, `horizontal`, `vertical`. Defaults to `both`.
|
|
133
|
+
* @param cb - Function to call when the shake has finished. Optional.
|
|
134
|
+
*/
|
|
135
|
+
function shake(camera_id: Hash | Url, intensity?: number, duration?: number, direction?: Hash, cb?: (...args: unknown[]) => unknown): void;
|
|
136
|
+
/**
|
|
137
|
+
* Stop shaking the camera.
|
|
138
|
+
*/
|
|
139
|
+
function stop_shaking(camera_id: Hash | Url): void;
|
|
140
|
+
/**
|
|
141
|
+
* Stop following a game object.
|
|
142
|
+
*
|
|
143
|
+
* @param camera_id - nil for the first camera
|
|
144
|
+
*/
|
|
145
|
+
function unfollow(camera_id?: Hash | Url): void;
|
|
146
|
+
/**
|
|
147
|
+
* Translate world coordinates to screen coordinates, based on the view and projection of the camera. This is useful when manually culling game objects and you need to determine if a world coordinate will be visible or not. It can also be used to position gui nodes on top of game objects.
|
|
148
|
+
*
|
|
149
|
+
* @param camera_id - nil for the first camera
|
|
150
|
+
* @param world - World coordinates to convert
|
|
151
|
+
* @returns Screen coordinates
|
|
152
|
+
*/
|
|
153
|
+
function world_to_screen(camera_id: Hash | Url | undefined, world: Vector3): Vector3;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/** @noResolution */
|
|
2
|
+
declare module 'panthera.panthera' {
|
|
3
|
+
interface panthera_animation {
|
|
4
|
+
adapter: panthera_adapter;
|
|
5
|
+
speed: number;
|
|
6
|
+
current_time: number;
|
|
7
|
+
nodes: LuaTable;
|
|
8
|
+
childs?: panthera_animation[] | undefined;
|
|
9
|
+
get_node: (node_id: string) => Opaque<"node">;
|
|
10
|
+
animation_id?: string | undefined;
|
|
11
|
+
previous_animation_id?: string | undefined;
|
|
12
|
+
animation_path: string;
|
|
13
|
+
animation_keys_index: number;
|
|
14
|
+
events?: LuaTable | undefined;
|
|
15
|
+
timer_id?: number | undefined;
|
|
16
|
+
}
|
|
17
|
+
interface panthera_options {
|
|
18
|
+
is_loop?: boolean | undefined;
|
|
19
|
+
is_skip_init?: boolean | undefined;
|
|
20
|
+
is_detached?: boolean | undefined;
|
|
21
|
+
speed?: number | undefined;
|
|
22
|
+
easing?: string | Opaque<"constant"> | undefined;
|
|
23
|
+
callback?: ((animation_id: string) => undefined) | undefined;
|
|
24
|
+
callback_event?: ((event_id: string, node: Opaque<"node"> | undefined, string_value: string, number_value: number) => undefined) | undefined;
|
|
25
|
+
}
|
|
26
|
+
interface panthera_options_tweener {
|
|
27
|
+
speed?: number | undefined;
|
|
28
|
+
is_loop?: boolean | undefined;
|
|
29
|
+
easing?: string | Opaque<"constant"> | undefined;
|
|
30
|
+
callback?: ((animation_id: string) => undefined) | undefined;
|
|
31
|
+
callback_event?: ((event_id: string, node: Opaque<"node"> | undefined, string_value: string, number_value: number) => undefined) | undefined;
|
|
32
|
+
is_reverse?: boolean | undefined;
|
|
33
|
+
from?: number | undefined;
|
|
34
|
+
to?: number | undefined;
|
|
35
|
+
}
|
|
36
|
+
interface panthera {
|
|
37
|
+
SPEED: number;
|
|
38
|
+
}
|
|
39
|
+
interface panthera_adapter {
|
|
40
|
+
get_node: (node_id: string) => Opaque<"node">;
|
|
41
|
+
get_easing: (easing_id: string) => Hash;
|
|
42
|
+
tween_animation_key: (node: Opaque<"node">, property_id: string, easing: Hash | number[], duration: number, end_value: number) => undefined;
|
|
43
|
+
trigger_animation_key: (node: Opaque<"node">, property_id: string, value: unknown) => undefined;
|
|
44
|
+
event_animation_key: (node: Opaque<"node">, key: panthera_animation_data_animation_key) => undefined;
|
|
45
|
+
set_node_property: (node: Opaque<"node">, property_id: string, value: number | string) => boolean;
|
|
46
|
+
stop_tween: (node: Opaque<"node">, property_id: string) => undefined;
|
|
47
|
+
is_node_valid: (node: Opaque<"node">) => boolean;
|
|
48
|
+
}
|
|
49
|
+
interface panthera_logger {
|
|
50
|
+
trace: (logger: panthera_logger, message: string, data: unknown | undefined) => void;
|
|
51
|
+
debug: (logger: panthera_logger, message: string, data: unknown | undefined) => void;
|
|
52
|
+
info: (logger: panthera_logger, message: string, data: unknown | undefined) => void;
|
|
53
|
+
warn: (logger: panthera_logger, message: string, data: unknown | undefined) => void;
|
|
54
|
+
error: (logger: panthera_logger, message: string, data: unknown | undefined) => void;
|
|
55
|
+
}
|
|
56
|
+
interface panthera_animation_data_node {
|
|
57
|
+
}
|
|
58
|
+
interface panthera_animation_data_metadata {
|
|
59
|
+
gui_path: string;
|
|
60
|
+
fps: number;
|
|
61
|
+
settings: LuaTable;
|
|
62
|
+
gizmo_steps: LuaTable;
|
|
63
|
+
template_animation_paths: LuaTable<string, string>;
|
|
64
|
+
}
|
|
65
|
+
interface panthera_animation_data_animation {
|
|
66
|
+
duration: number;
|
|
67
|
+
animation_id: string;
|
|
68
|
+
initial_state: string;
|
|
69
|
+
animation_keys: panthera_animation_data_animation_key[];
|
|
70
|
+
}
|
|
71
|
+
interface panthera_animation_data {
|
|
72
|
+
name: string;
|
|
73
|
+
nodes: panthera_animation_data_node[];
|
|
74
|
+
animations: panthera_animation_data_animation[];
|
|
75
|
+
metadata: panthera_animation_data_metadata;
|
|
76
|
+
group_animation_keys: LuaTable<string, LuaTable<string, LuaTable<string, panthera_animation_data_animation_key[]>>>;
|
|
77
|
+
animations_dict: LuaTable<string, panthera_animation_data_animation>;
|
|
78
|
+
}
|
|
79
|
+
interface panthera_animation_project_file {
|
|
80
|
+
data: panthera_animation_data;
|
|
81
|
+
format: string;
|
|
82
|
+
version: string;
|
|
83
|
+
type: string;
|
|
84
|
+
}
|
|
85
|
+
interface panthera_animation_data_animation_key {
|
|
86
|
+
key_type: number;
|
|
87
|
+
node_id: string;
|
|
88
|
+
property_id: string;
|
|
89
|
+
start_time: number;
|
|
90
|
+
duration: number;
|
|
91
|
+
start_value: number;
|
|
92
|
+
end_value: number;
|
|
93
|
+
easing: string;
|
|
94
|
+
easing_custom?: number[] | Vector | undefined;
|
|
95
|
+
start_data: string;
|
|
96
|
+
data: string;
|
|
97
|
+
event_id: string;
|
|
98
|
+
is_editor_only: boolean;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Customize the logging mechanism used by Panthera Runtime. You can use Defold Log library or provide a custom logger.
|
|
102
|
+
*/
|
|
103
|
+
export function set_logger(this: void, logger_instance?: panthera_logger | LuaTable | undefined): void;
|
|
104
|
+
/**
|
|
105
|
+
* Load and create a game object animation state from a Lua table or JSON file.
|
|
106
|
+
*/
|
|
107
|
+
export function create_go(this: void, animation_or_path: string | LuaTable, collection_name?: string | undefined, objects?: LuaTable<string | Hash, string | Hash> | undefined): panthera_animation;
|
|
108
|
+
/**
|
|
109
|
+
* Load and create a GUI animation state from a Lua table or JSON file.
|
|
110
|
+
*/
|
|
111
|
+
export function create_gui(this: void, animation_or_path: string | LuaTable, template?: string | undefined, nodes?: LuaTable<string | Hash, Opaque<"node">> | undefined): panthera_animation;
|
|
112
|
+
/**
|
|
113
|
+
* Load an animation from a Lua table or JSON file and create an animation state using a specified adapter.
|
|
114
|
+
*/
|
|
115
|
+
export function create(this: void, animation_or_path: string | LuaTable, adapter: panthera_adapter, get_node: (node_id: string) => Opaque<"node">): panthera_animation;
|
|
116
|
+
/**
|
|
117
|
+
* Clone an existing animation state object, enabling multiple instances of the same animation to play simultaneously or independently.
|
|
118
|
+
*/
|
|
119
|
+
export function clone_state(this: void, animation_state: panthera_animation): panthera_animation;
|
|
120
|
+
/**
|
|
121
|
+
* Play an animation with specified ID and options.
|
|
122
|
+
*/
|
|
123
|
+
export function play(this: void, animation_state: panthera_animation, animation_id: string, options?: panthera_options | undefined): void;
|
|
124
|
+
/**
|
|
125
|
+
* Play animation with easing support using tweener. Allows for non-linear animation playback with custom easing functions.
|
|
126
|
+
*/
|
|
127
|
+
export function play_tweener(this: void, animation_state: panthera_animation, animation_id: string, options?: panthera_options_tweener | undefined): void;
|
|
128
|
+
/**
|
|
129
|
+
* Play animation as a child of the current animation state, allowing multiple animations to run independently and simultaneously.
|
|
130
|
+
*
|
|
131
|
+
* This creates a detached animation that runs in parallel with the main animation state without affecting it.
|
|
132
|
+
* The child animation will be automatically cleaned up when it completes.
|
|
133
|
+
*/
|
|
134
|
+
export function play_detached(this: void, animation_state: panthera_animation, animation_id: string, options?: panthera_options | undefined): void;
|
|
135
|
+
/**
|
|
136
|
+
* Set the current time of an animation. This function stops any currently playing animation.
|
|
137
|
+
*/
|
|
138
|
+
export function set_time(this: void, animation_state: panthera_animation, animation_id: string, time: number, event_callback?: ((event_id: string, node: Opaque<"node"> | undefined, string_value: string, number_value: number) => void) | undefined): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Retrieve the current playback time in seconds of an animation. If the animation is not playing, the function returns 0.
|
|
141
|
+
*/
|
|
142
|
+
export function get_time(this: void, animation_state: panthera_animation): number;
|
|
143
|
+
/**
|
|
144
|
+
* Stop a currently playing animation. The animation will be stopped at current time.
|
|
145
|
+
*/
|
|
146
|
+
export function stop(this: void, animation_state: panthera_animation): boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Retrieve the total duration of a specific animation.
|
|
149
|
+
*/
|
|
150
|
+
export function get_duration(this: void, animation_state: panthera_animation, animation_id: string): number;
|
|
151
|
+
/**
|
|
152
|
+
* Check if an animation is currently playing.
|
|
153
|
+
*/
|
|
154
|
+
export function is_playing(this: void, animation_state: panthera_animation): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Get the ID of the last animation that was started.
|
|
157
|
+
*/
|
|
158
|
+
export function get_latest_animation_id(this: void, animation_state: panthera_animation): string | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Return a list of animation IDs from the created animation state.
|
|
161
|
+
*/
|
|
162
|
+
export function get_animations(this: void, animation_state: panthera_animation): string[];
|
|
163
|
+
/**
|
|
164
|
+
* Reload animations from JSON files, useful for development and debugging.
|
|
165
|
+
*
|
|
166
|
+
* The animations loaded from Lua tables will not be reloaded.
|
|
167
|
+
* Animation will be reloaded only at desktop.
|
|
168
|
+
*/
|
|
169
|
+
export function reload_animation(this: void, animation_path?: string | undefined): void;
|
|
170
|
+
}
|
|
@@ -31,4 +31,7 @@ declare module 'persist.persist' {
|
|
|
31
31
|
* Returns an `object`, or `undefined` if the file does not exist.
|
|
32
32
|
*/
|
|
33
33
|
export function load(file_name: string): {} | undefined;
|
|
34
|
+
|
|
35
|
+
/** Checks if a file exists. */
|
|
36
|
+
export function exists(file_name: string): boolean;
|
|
34
37
|
}
|
|
@@ -67,6 +67,15 @@ declare module 'platypus.platypus' {
|
|
|
67
67
|
export const DOUBLE_JUMP: Hash;
|
|
68
68
|
export const WALL_SLIDE: Hash;
|
|
69
69
|
|
|
70
|
+
/** Value for `collisions.separation` selecting raycast separation. */
|
|
71
|
+
export const SEPARATION_RAYS: Hash;
|
|
72
|
+
/**
|
|
73
|
+
* Value for `collisions.separation` selecting shape separation. Platypus warns
|
|
74
|
+
* at runtime that this mode is no longer supported and only raycast separation
|
|
75
|
+
* is; the constant still exists.
|
|
76
|
+
*/
|
|
77
|
+
export const SEPARATION_SHAPES: Hash;
|
|
78
|
+
|
|
70
79
|
type Direction = number;
|
|
71
80
|
export const DIR_UP: Direction;
|
|
72
81
|
export const DIR_LEFT: Direction;
|
|
@@ -9,6 +9,39 @@
|
|
|
9
9
|
declare module 'rendy.rendy' {
|
|
10
10
|
type CameraId = Hash | string;
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Every camera except the GUI camera, keyed by camera id. Exposed only because the
|
|
14
|
+
* rendy.render_script file needs write-access to it; reach for `set` and `get`
|
|
15
|
+
* rather than accessing or manipulating it directly.
|
|
16
|
+
*/
|
|
17
|
+
const cameras: LuaMap<CameraId, unknown>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Initial width of the window, specified in the game.project file. Exposed only
|
|
21
|
+
* because the rendy.render_script file needs write-access to it; it is unset until
|
|
22
|
+
* that script has run.
|
|
23
|
+
*/
|
|
24
|
+
const display_width: number;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Initial height of the window, specified in the game.project file. Exposed only
|
|
28
|
+
* because the rendy.render_script file needs write-access to it; it is unset until
|
|
29
|
+
* that script has run.
|
|
30
|
+
*/
|
|
31
|
+
const display_height: number;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Current width of the window. Exposed only because the rendy.render_script file
|
|
35
|
+
* needs write-access to it; it is unset until that script has run.
|
|
36
|
+
*/
|
|
37
|
+
const window_width: number;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Current height of the window. Exposed only because the rendy.render_script file
|
|
41
|
+
* needs write-access to it; it is unset until that script has run.
|
|
42
|
+
*/
|
|
43
|
+
const window_height: number;
|
|
44
|
+
|
|
12
45
|
/**
|
|
13
46
|
* Creates a camera. This function is called automatically by the rendy.go game object.
|
|
14
47
|
* @param camera_id - The identifier for the camera.
|
|
@@ -29,86 +62,6 @@ declare module 'rendy.rendy' {
|
|
|
29
62
|
*/
|
|
30
63
|
function set(camera_id: CameraId, property: Hash | string, value: any): void;
|
|
31
64
|
|
|
32
|
-
/**
|
|
33
|
-
* Animates a camera property. This function replaces the standard go.animate().
|
|
34
|
-
* @param camera_id - The identifier for the camera.
|
|
35
|
-
* @param property - The property to be animated.
|
|
36
|
-
* @param playback - The playback mode of the animation.
|
|
37
|
-
* @param to - The target value of the animation.
|
|
38
|
-
* @param easing - The easing function for the animation.
|
|
39
|
-
* @param duration - The duration of the animation.
|
|
40
|
-
* @param delay - Optional delay before starting the animation.
|
|
41
|
-
* @param complete_function - Optional function to be called when the animation is complete.
|
|
42
|
-
*/
|
|
43
|
-
function animate(
|
|
44
|
-
camera_id: CameraId,
|
|
45
|
-
property: Hash | string,
|
|
46
|
-
playback:
|
|
47
|
-
| typeof go.PLAYBACK_LOOP_BACKWARD
|
|
48
|
-
| typeof go.PLAYBACK_LOOP_FORWARD
|
|
49
|
-
| typeof go.PLAYBACK_LOOP_PINGPONG
|
|
50
|
-
| typeof go.PLAYBACK_ONCE_BACKWARD
|
|
51
|
-
| typeof go.PLAYBACK_ONCE_FORWARD
|
|
52
|
-
| typeof go.PLAYBACK_ONCE_PINGPONG,
|
|
53
|
-
to: Quaternion | Vector3 | Vector4 | number,
|
|
54
|
-
easing:
|
|
55
|
-
| Vector3
|
|
56
|
-
| typeof go.EASING_INBACK
|
|
57
|
-
| typeof go.EASING_INBOUNCE
|
|
58
|
-
| typeof go.EASING_INCIRC
|
|
59
|
-
| typeof go.EASING_INCUBIC
|
|
60
|
-
| typeof go.EASING_INELASTIC
|
|
61
|
-
| typeof go.EASING_INEXPO
|
|
62
|
-
| typeof go.EASING_INOUTBACK
|
|
63
|
-
| typeof go.EASING_INOUTBOUNCE
|
|
64
|
-
| typeof go.EASING_INOUTCIRC
|
|
65
|
-
| typeof go.EASING_INOUTCUBIC
|
|
66
|
-
| typeof go.EASING_INOUTELASTIC
|
|
67
|
-
| typeof go.EASING_INOUTEXPO
|
|
68
|
-
| typeof go.EASING_INOUTQUAD
|
|
69
|
-
| typeof go.EASING_INOUTQUART
|
|
70
|
-
| typeof go.EASING_INOUTQUINT
|
|
71
|
-
| typeof go.EASING_INOUTSINE
|
|
72
|
-
| typeof go.EASING_INQUAD
|
|
73
|
-
| typeof go.EASING_INQUART
|
|
74
|
-
| typeof go.EASING_INQUINT
|
|
75
|
-
| typeof go.EASING_INSINE
|
|
76
|
-
| typeof go.EASING_LINEAR
|
|
77
|
-
| typeof go.EASING_OUTBACK
|
|
78
|
-
| typeof go.EASING_OUTBOUNCE
|
|
79
|
-
| typeof go.EASING_OUTCIRC
|
|
80
|
-
| typeof go.EASING_OUTCUBIC
|
|
81
|
-
| typeof go.EASING_OUTELASTIC
|
|
82
|
-
| typeof go.EASING_OUTEXPO
|
|
83
|
-
| typeof go.EASING_OUTINBACK
|
|
84
|
-
| typeof go.EASING_OUTINBOUNCE
|
|
85
|
-
| typeof go.EASING_OUTINCIRC
|
|
86
|
-
| typeof go.EASING_OUTINCUBIC
|
|
87
|
-
| typeof go.EASING_OUTINELASTIC
|
|
88
|
-
| typeof go.EASING_OUTINEXPO
|
|
89
|
-
| typeof go.EASING_OUTINQUAD
|
|
90
|
-
| typeof go.EASING_OUTINQUART
|
|
91
|
-
| typeof go.EASING_OUTINQUINT
|
|
92
|
-
| typeof go.EASING_OUTINSINE
|
|
93
|
-
| typeof go.EASING_OUTQUAD
|
|
94
|
-
| typeof go.EASING_OUTQUART
|
|
95
|
-
| typeof go.EASING_OUTQUINT
|
|
96
|
-
| typeof go.EASING_OUTSINE,
|
|
97
|
-
duration: number,
|
|
98
|
-
delay?: number,
|
|
99
|
-
complete_function?: (this: any, url: Url, property: Hash) => void,
|
|
100
|
-
): void;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Cancels a camera property animation. This function replaces the standard go.cancel_animations().
|
|
104
|
-
* @param camera_id - The identifier for the camera.
|
|
105
|
-
* @param property - The property of the animation to be cancelled.
|
|
106
|
-
*/
|
|
107
|
-
function cancel_animations(
|
|
108
|
-
camera_id: CameraId,
|
|
109
|
-
property: Hash | string,
|
|
110
|
-
): void;
|
|
111
|
-
|
|
112
65
|
/**
|
|
113
66
|
* Gets a camera property. This function is equivalent to the standard go.get().
|
|
114
67
|
* @param camera_id - The identifier for the camera.
|
|
@@ -6,6 +6,21 @@
|
|
|
6
6
|
declare module 'richtext.color' {
|
|
7
7
|
export function add(name: string, color: number | string): void;
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Resolves a color by name, hex string or comma-separated decimal string.
|
|
11
|
+
*/
|
|
12
|
+
export function parse(c: string): Vector4 | undefined;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Parses a `#rrggbb` or `#rrggbbaa` hex string, with or without the leading `#`.
|
|
16
|
+
*/
|
|
17
|
+
export function parse_hex(hex: string): Vector4 | undefined;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Parses a comma-separated `r,g,b,a` string of decimal components.
|
|
21
|
+
*/
|
|
22
|
+
export function parse_decimal(dec: string): Vector4 | undefined;
|
|
23
|
+
|
|
9
24
|
export const COLORS: {
|
|
10
25
|
aqua: Vector4;
|
|
11
26
|
black: Vector4;
|