@defold-typescript/library-types 0.18.1
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/NOTICE +52 -0
- package/README.md +78 -0
- package/api-doc/boom.boom.json +26 -0
- package/api-doc/bridge.bridge.json +1653 -0
- package/api-doc/bzAnim.bzLibrary.json +156 -0
- package/api-doc/defcon.console.json +109 -0
- package/api-doc/defmath.defmath.json +1381 -0
- package/api-doc/defsave.defsave.json +175 -0
- package/api-doc/deftest.deftest.json +71 -0
- package/api-doc/dicebag.dicebag.json +323 -0
- package/api-doc/event.event.json +238 -0
- package/api-doc/gooey.gooey.json +963 -0
- package/api-doc/immutable.immutable.json +63 -0
- package/api-doc/in.accelerometer.json +281 -0
- package/api-doc/in.button.json +148 -0
- package/api-doc/in.cursor.json +203 -0
- package/api-doc/in.gesture.json +206 -0
- package/api-doc/in.keyboard.json +45 -0
- package/api-doc/in.mapper.json +141 -0
- package/api-doc/in.onscreen.json +265 -0
- package/api-doc/in.state.json +195 -0
- package/api-doc/in.textbox.json +213 -0
- package/api-doc/in.triggers.json +1260 -0
- package/api-doc/lang.lang.json +411 -0
- package/api-doc/log.log.json +50 -0
- package/api-doc/metrics.fps.json +88 -0
- package/api-doc/metrics.mem.json +80 -0
- package/api-doc/monarch.monarch.json +1065 -0
- package/api-doc/monarch.transitions.easings.json +206 -0
- package/api-doc/monarch.transitions.gui.json +445 -0
- package/api-doc/nakama.engine.defold.json +165 -0
- package/api-doc/nakama.nakama.json +6574 -0
- package/api-doc/nakama.util.log.json +25 -0
- package/api-doc/narrator.narrator.json +150 -0
- package/api-doc/orthographic.camera.json +1019 -0
- package/api-doc/persist.persist.json +142 -0
- package/api-doc/platypus.platypus.json +631 -0
- package/api-doc/proto.proto.json +355 -0
- package/api-doc/rendy.rendy.json +408 -0
- package/api-doc/richtext.color.json +219 -0
- package/api-doc/richtext.richtext.json +382 -0
- package/api-doc/richtext.tags.json +67 -0
- package/api-doc/saver.saver.json +553 -0
- package/api-doc/saver.storage.json +174 -0
- package/api-doc/squid.squid.json +660 -0
- package/api-doc/starly.starly.json +488 -0
- package/api-doc/tweener.tweener.json +419 -0
- package/api-doc/yagames.yagames.json +1465 -0
- package/api-doc/zzfx.api.json +85 -0
- package/generated/boom.boom.d.ts +1585 -0
- package/generated/bridge.bridge.d.ts +533 -0
- package/generated/bzAnim.bzLibrary.d.ts +93 -0
- package/generated/defcon.console.d.ts +24 -0
- package/generated/defmath.defmath.d.ts +194 -0
- package/generated/defsave.defsave.d.ts +31 -0
- package/generated/deftest.deftest.d.ts +47 -0
- package/generated/dicebag.dicebag.d.ts +90 -0
- package/generated/event.event.d.ts +54 -0
- package/generated/gooey.gooey.d.ts +261 -0
- package/generated/immutable.immutable.d.ts +13 -0
- package/generated/in.accelerometer.d.ts +37 -0
- package/generated/in.button.d.ts +20 -0
- package/generated/in.cursor.d.ts +33 -0
- package/generated/in.gesture.d.ts +64 -0
- package/generated/in.keyboard.d.ts +18 -0
- package/generated/in.mapper.d.ts +23 -0
- package/generated/in.onscreen.d.ts +58 -0
- package/generated/in.state.d.ts +34 -0
- package/generated/in.textbox.d.ts +26 -0
- package/generated/in.triggers.d.ts +180 -0
- package/generated/lang.lang.d.ts +33 -0
- package/generated/log.log.d.ts +40 -0
- package/generated/metrics.fps.d.ts +16 -0
- package/generated/metrics.mem.d.ts +16 -0
- package/generated/monarch.monarch.d.ts +412 -0
- package/generated/monarch.transitions.easings.d.ts +65 -0
- package/generated/monarch.transitions.gui.d.ts +197 -0
- package/generated/nakama.engine.defold.d.ts +24 -0
- package/generated/nakama.nakama.d.ts +594 -0
- package/generated/nakama.util.log.d.ts +10 -0
- package/generated/narrator.narrator.d.ts +66 -0
- package/generated/orthographic.camera.d.ts +308 -0
- package/generated/persist.persist.d.ts +34 -0
- package/generated/platypus.platypus.d.ts +76 -0
- package/generated/proto.proto.d.ts +36 -0
- package/generated/rendy.rendy.d.ts +184 -0
- package/generated/richtext.color.d.ts +33 -0
- package/generated/richtext.richtext.d.ts +126 -0
- package/generated/richtext.tags.d.ts +12 -0
- package/generated/saver.saver.d.ts +44 -0
- package/generated/saver.storage.d.ts +16 -0
- package/generated/squid.squid.d.ts +106 -0
- package/generated/starly.starly.d.ts +148 -0
- package/generated/tweener.tweener.d.ts +151 -0
- package/generated/yagames.yagames.d.ts +279 -0
- package/generated/zzfx.api.d.ts +20 -0
- package/library-classification.json +726 -0
- package/library-targets.json +291 -0
- package/package.json +180 -0
- package/scripts/extract-api-doc.ts +418 -0
- package/scripts/sync-library-types.ts +542 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/** @noSelfInFile **/
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @see {@link https://github.com/britzl/defold-orthographic|Github Source}
|
|
5
|
+
* @noResolution
|
|
6
|
+
*/
|
|
7
|
+
declare module 'orthographic.camera' {
|
|
8
|
+
/**
|
|
9
|
+
* Follow a game object.
|
|
10
|
+
* @param camera_id undefined for the first camera
|
|
11
|
+
* @param target Game object to follow
|
|
12
|
+
* @param options Options
|
|
13
|
+
*/
|
|
14
|
+
export function follow(
|
|
15
|
+
camera_id: Hash | Url | undefined,
|
|
16
|
+
target: Hash | Url,
|
|
17
|
+
options?: {
|
|
18
|
+
/**
|
|
19
|
+
* Lerp from current position to target position with lerp as t.
|
|
20
|
+
*/
|
|
21
|
+
lerp?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Camera offset from target position.
|
|
24
|
+
*/
|
|
25
|
+
offset?: Vector3;
|
|
26
|
+
/**
|
|
27
|
+
* True if following the target along the horizontal axis.
|
|
28
|
+
*/
|
|
29
|
+
horizontal?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* True if following the target along the vertical axis.
|
|
32
|
+
*/
|
|
33
|
+
vertical?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* True if the camera should be immediately positioned on the target even when lerping.
|
|
36
|
+
*/
|
|
37
|
+
immediate?: boolean;
|
|
38
|
+
},
|
|
39
|
+
): void;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get the current zoom level of the camera.
|
|
43
|
+
* @param camera_id (hash | url), undefined for the first camera
|
|
44
|
+
*/
|
|
45
|
+
export function get_zoom(camera_id: Hash | Url | undefined): number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Change the zoom level of the camera.
|
|
49
|
+
* @param camera_id undefined for the first camera
|
|
50
|
+
* @param zoom The new zoom level of the camera
|
|
51
|
+
*/
|
|
52
|
+
export function set_zoom(
|
|
53
|
+
camera_id: Hash | Url | undefined,
|
|
54
|
+
zoom: number,
|
|
55
|
+
): void;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Shake the camera.
|
|
59
|
+
* @param camera_id undefined for the first camera
|
|
60
|
+
* @param intensity Intensity of the shake, in percent of screen. Defaults to 0.05
|
|
61
|
+
* @param duration Duration of the shake, in seconds. Defaults to 0.5
|
|
62
|
+
* @param direction Direction of the shake. Possible values: `both`, `horizontal`, `vertical`. Defaults to `both`.
|
|
63
|
+
* @param cb Function to call when the shake has finished. Optional.
|
|
64
|
+
*/
|
|
65
|
+
export function shake(
|
|
66
|
+
camera_id: Hash | Url | undefined,
|
|
67
|
+
intensity?: number,
|
|
68
|
+
duration?: number,
|
|
69
|
+
direction?: { both?: boolean; horizontal?: boolean; vertical?: boolean },
|
|
70
|
+
cb?: () => void,
|
|
71
|
+
): void;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Stop shaking the camera.
|
|
75
|
+
* @param camera_id (hash | url), undefined for the first camera
|
|
76
|
+
*/
|
|
77
|
+
export function stop_shaking(camera_id: Hash | Url | undefined): void;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Translate screen coordinates to world coordinates, based on the view and projection of the camera.
|
|
81
|
+
* @param camera_id (hash | url), undefined for the first camera
|
|
82
|
+
* @param screen Screen coordinates to convert
|
|
83
|
+
*/
|
|
84
|
+
export function screen_to_world(
|
|
85
|
+
camera_id: Hash | Url | undefined,
|
|
86
|
+
screen: Vector3,
|
|
87
|
+
): Vector3;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Translate window coordinates to world coordinates, based on the view and projection of the camera.
|
|
91
|
+
* @param camera_id (hash | url), undefined for the first camera
|
|
92
|
+
* @param window Window coordinates to convert
|
|
93
|
+
*/
|
|
94
|
+
export function window_to_world(
|
|
95
|
+
camera_id: Hash | Url | undefined,
|
|
96
|
+
window: Vector3,
|
|
97
|
+
): Vector3;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Get the display size (ie from game.project).
|
|
101
|
+
*/
|
|
102
|
+
export function get_display_size(): LuaMultiReturn<[number, number]>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Get window size.
|
|
106
|
+
*/
|
|
107
|
+
export function get_window_size(): LuaMultiReturn<[number, number]>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Get list of camera ids.
|
|
111
|
+
*/
|
|
112
|
+
export function get_cameras(): Array<Hash | Url | undefined>;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Get the current view of the camera.
|
|
116
|
+
* @param camera_id undefined for the first camera
|
|
117
|
+
*/
|
|
118
|
+
export function get_view(camera_id: Hash | Url | undefined): Matrix4;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Get the current viewport of the camera.
|
|
122
|
+
* @param camera_id undefined for the first camera
|
|
123
|
+
*/
|
|
124
|
+
export function get_viewport(
|
|
125
|
+
camera_id: Hash | Url | undefined,
|
|
126
|
+
): LuaMultiReturn<[number, number, number, number]>;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Get the current projection of the camera.
|
|
130
|
+
* @param camera_id undefined for the first camera
|
|
131
|
+
*/
|
|
132
|
+
export function get_projection(
|
|
133
|
+
camera_id: Hash | Url | undefined,
|
|
134
|
+
): Matrix4;
|
|
135
|
+
|
|
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
|
+
/**
|
|
143
|
+
* Apply a recoil effect to the camera. The recoil will decay using linear interpolation.
|
|
144
|
+
* @param camera_id
|
|
145
|
+
* @param offset Offset to apply to the camera. Defaults to 0.05
|
|
146
|
+
* @param duration Duration of the recoil, in seconds. Defaults to 0.5
|
|
147
|
+
*/
|
|
148
|
+
export function recoil(
|
|
149
|
+
camera_id: Hash | Url,
|
|
150
|
+
offset: Vector3,
|
|
151
|
+
duration?: number,
|
|
152
|
+
): void;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Get the current offset of the camera (caused by shake or recoil)
|
|
156
|
+
* @param camera_id undefined for the first camera
|
|
157
|
+
*/
|
|
158
|
+
export function get_offset(camera_id: Hash | Url | undefined): Vector3;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Change the camera follow offset.
|
|
162
|
+
* @param camera_id undefined for the first camera
|
|
163
|
+
* @param offset Camera offset from target position.
|
|
164
|
+
*/
|
|
165
|
+
export function follow_offset(
|
|
166
|
+
camera_id: Hash | Url | undefined,
|
|
167
|
+
offset: Vector3,
|
|
168
|
+
): void;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Stop following a game object.
|
|
172
|
+
* @param camera_id undefined for the first camera
|
|
173
|
+
*/
|
|
174
|
+
export function unfollow(camera_id: Hash | Url | undefined): void;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* 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.
|
|
178
|
+
* @param camera_id undefined for the first camera
|
|
179
|
+
* @param left Number of pixels to the left of the camera
|
|
180
|
+
* @param top Number of pixels above the camera
|
|
181
|
+
* @param right Number of pixels to the right of the camera
|
|
182
|
+
* @param bottom Number of pixels below the camera
|
|
183
|
+
*/
|
|
184
|
+
export function deadzone(
|
|
185
|
+
camera_id: Hash | Url | undefined,
|
|
186
|
+
left: number,
|
|
187
|
+
top: number,
|
|
188
|
+
right: number,
|
|
189
|
+
bottom: number,
|
|
190
|
+
): void;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Limits the camera position to within the specified rectangle.
|
|
194
|
+
* @param camera_id undefined for the first camera
|
|
195
|
+
* @param left Left edge of the camera bounds
|
|
196
|
+
* @param top Top edge of camera bounds
|
|
197
|
+
* @param right Right edge of camera bounds
|
|
198
|
+
* @param bottom Bottom edge of camera bounds
|
|
199
|
+
*/
|
|
200
|
+
export function bounds(
|
|
201
|
+
camera_id: Hash | Url | undefined,
|
|
202
|
+
left: number,
|
|
203
|
+
top: number,
|
|
204
|
+
right: number,
|
|
205
|
+
bottom: number,
|
|
206
|
+
): void;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Translate screen boundaries (corners) to world coordinates, based on the view and projection of the camera.
|
|
210
|
+
* @param camera_id undefined for the first camera
|
|
211
|
+
*/
|
|
212
|
+
export function screen_to_world_bounds(
|
|
213
|
+
camera_id: Hash | Url | undefined,
|
|
214
|
+
): Vector4;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Translate world coordinates to screen coordinates, based on the view and projection of the camera, optionally taking into account an adjust mode. 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
|
+
* @param camera_id undefined for the first camera
|
|
219
|
+
* @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
|
+
*/
|
|
222
|
+
export function world_to_screen(
|
|
223
|
+
camera_id: Hash | Url | undefined,
|
|
224
|
+
world: Vector3,
|
|
225
|
+
adjust_mode?:
|
|
226
|
+
| typeof gui.ADJUST_FIT
|
|
227
|
+
| typeof gui.ADJUST_STRETCH
|
|
228
|
+
| typeof gui.ADJUST_ZOOM,
|
|
229
|
+
): Vector3;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Translate screen coordinates to world coordinates using the specified view and projection.
|
|
233
|
+
* @param view
|
|
234
|
+
* @param projection
|
|
235
|
+
* @param screen Screen coordinates to convert
|
|
236
|
+
*/
|
|
237
|
+
export function unproject(
|
|
238
|
+
view: Matrix4,
|
|
239
|
+
projection: Matrix4,
|
|
240
|
+
screen: Vector3,
|
|
241
|
+
): Vector3;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Translate world coordinates to screen coordinates using the specified view and projection.
|
|
245
|
+
* @param view
|
|
246
|
+
* @param projection
|
|
247
|
+
* @param world World coordinates to convert
|
|
248
|
+
*/
|
|
249
|
+
export function project(
|
|
250
|
+
view: Matrix4,
|
|
251
|
+
projection: Matrix4,
|
|
252
|
+
world: Vector3,
|
|
253
|
+
): Vector3;
|
|
254
|
+
|
|
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
|
+
/**
|
|
276
|
+
* 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
|
+
* @param scaling_factor Current window scaling factor
|
|
278
|
+
*/
|
|
279
|
+
export function set_window_scaling_factor(scaling_factor: number): void;
|
|
280
|
+
|
|
281
|
+
export const PROJECTOR: {
|
|
282
|
+
FIXED_ZOOM: Hash;
|
|
283
|
+
DEFAULT: Hash;
|
|
284
|
+
FIXED_AUTO: Hash;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
export const SHAKE_BOTH: Hash;
|
|
288
|
+
export const SHAKE_VERTICAL: Hash;
|
|
289
|
+
export const SHAKE_HORIZONTAL: Hash;
|
|
290
|
+
|
|
291
|
+
export const ORTHOGRAPHIC_RENDER_SCRIPT_USED: boolean;
|
|
292
|
+
|
|
293
|
+
export const MSG_DISABLE: Hash;
|
|
294
|
+
export const MSG_UNFOLLOW: Hash;
|
|
295
|
+
export const MSG_FOLLOW: Hash;
|
|
296
|
+
export const MSG_FOLLOW_OFFSET: Hash;
|
|
297
|
+
export const MSG_RECOIL: Hash;
|
|
298
|
+
export const MSG_SHAKE: Hash;
|
|
299
|
+
export const MSG_SHAKE_COMPLETED: Hash;
|
|
300
|
+
export const MSG_STOP_SHAKING: Hash;
|
|
301
|
+
export const MSG_DEADZONE: Hash;
|
|
302
|
+
export const MSG_BOUNDS: Hash;
|
|
303
|
+
export const MSG_UPDATE_CAMERA: Hash;
|
|
304
|
+
export const MSG_ZOOM_TO: Hash;
|
|
305
|
+
export const MSG_USE_PROJECTION: Hash;
|
|
306
|
+
export const MSG_VIEWPORT: Hash;
|
|
307
|
+
export const MSG_ENABLE: Hash;
|
|
308
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A simple interface for saving and loading data.
|
|
5
|
+
* @see {@link https://github.com/klaytonkowalski/library-defold-persist|Github Source}
|
|
6
|
+
* @example `import * as persist from 'persist.persist'`
|
|
7
|
+
* @noResolution
|
|
8
|
+
*/
|
|
9
|
+
declare module 'persist.persist' {
|
|
10
|
+
/**
|
|
11
|
+
* Creates a file with the specified data.
|
|
12
|
+
* If the file already exists, then its data can be overwritten.
|
|
13
|
+
*/
|
|
14
|
+
export function create(
|
|
15
|
+
file_name: string,
|
|
16
|
+
data: any,
|
|
17
|
+
overwrite?: boolean,
|
|
18
|
+
): void;
|
|
19
|
+
|
|
20
|
+
/** Writes data to a file. */
|
|
21
|
+
export function write(file_name: string, key: string, value: any): void;
|
|
22
|
+
|
|
23
|
+
/** Flushes unsaved data from a file. If a key is specified, then only that field is flushed. */
|
|
24
|
+
export function flush(file_name: string, key?: string): void;
|
|
25
|
+
|
|
26
|
+
/** Saves data that was written to a file. */
|
|
27
|
+
export function save(file_name: string): void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Loads data from a file, including data that has not yet been saved.
|
|
31
|
+
* Returns an `object`, or `undefined` if the file does not exist.
|
|
32
|
+
*/
|
|
33
|
+
export function load(file_name: string): {} | undefined;
|
|
34
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Defold platformer engine
|
|
5
|
+
* @see {@link https://github.com/britzl/platypus|Github Source}
|
|
6
|
+
* @example `import * as platypus from 'platypus.platypus'`
|
|
7
|
+
* @noResolution
|
|
8
|
+
*/
|
|
9
|
+
declare module 'platypus.platypus' {
|
|
10
|
+
interface PlatypusConfig {
|
|
11
|
+
collisions: {
|
|
12
|
+
groups: LuaMap<Hash, Direction>;
|
|
13
|
+
left: number;
|
|
14
|
+
right: number;
|
|
15
|
+
top: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
offset?: Vector3;
|
|
18
|
+
};
|
|
19
|
+
debug?: boolean;
|
|
20
|
+
reparent?: boolean;
|
|
21
|
+
gravity?: number;
|
|
22
|
+
max_velocity?: number;
|
|
23
|
+
wall_jump_power_ratio_x?: number;
|
|
24
|
+
wall_jump_power_ratio_y?: number;
|
|
25
|
+
allow_double_jump?: boolean;
|
|
26
|
+
allow_wall_jump?: boolean;
|
|
27
|
+
const_wall_jump?: boolean;
|
|
28
|
+
allow_wall_slide?: boolean;
|
|
29
|
+
wall_slide_velocity?: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** @noSelf **/
|
|
33
|
+
interface PlatypusInstance extends PlatypusConfig {
|
|
34
|
+
velocity: Vector3;
|
|
35
|
+
update(dt: number): void;
|
|
36
|
+
on_message(message_id: Hash, message: AnyNotNil): void;
|
|
37
|
+
left(velocity: number): void;
|
|
38
|
+
right(velocity: number): void;
|
|
39
|
+
up(velocity: number): void;
|
|
40
|
+
down(velocity: number): void;
|
|
41
|
+
move(velocity: Vector3): void;
|
|
42
|
+
jump(power: number): void;
|
|
43
|
+
force_jump(power: number): void;
|
|
44
|
+
abort_jump(reduction: number): void;
|
|
45
|
+
abort_wall_slide(): void;
|
|
46
|
+
has_ground_contact(): boolean;
|
|
47
|
+
has_wall_contact(): boolean;
|
|
48
|
+
is_falling(): boolean;
|
|
49
|
+
is_jumping(): boolean;
|
|
50
|
+
is_wall_jumping(): boolean;
|
|
51
|
+
is_wall_sliding(): boolean;
|
|
52
|
+
toggle_debug(): void;
|
|
53
|
+
set_collisions(collisions: {
|
|
54
|
+
top: number;
|
|
55
|
+
left: number;
|
|
56
|
+
right: number;
|
|
57
|
+
bottom: number;
|
|
58
|
+
}): void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function create(config: PlatypusConfig): PlatypusInstance;
|
|
62
|
+
export const FALLING: Hash;
|
|
63
|
+
export const GROUND_CONTACT: Hash;
|
|
64
|
+
export const WALL_CONTACT: Hash;
|
|
65
|
+
export const JUMP: Hash;
|
|
66
|
+
export const WALL_JUMP: Hash;
|
|
67
|
+
export const DOUBLE_JUMP: Hash;
|
|
68
|
+
export const WALL_SLIDE: Hash;
|
|
69
|
+
|
|
70
|
+
type Direction = number;
|
|
71
|
+
export const DIR_UP: Direction;
|
|
72
|
+
export const DIR_LEFT: Direction;
|
|
73
|
+
export const DIR_RIGHT: Direction;
|
|
74
|
+
export const DIR_DOWN: Direction;
|
|
75
|
+
export const DIR_ALL: Direction;
|
|
76
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** @noSelfInFile **/
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-empty-object-type */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link https://github.com/Insality/defold-proto|Github Source}
|
|
7
|
+
* @see {@link https://github.com/Insality/defold-proto/blob/main/API_REFERENCE.md|API Reference}
|
|
8
|
+
* @example `import * as proto from 'proto.proto'`
|
|
9
|
+
* @noResolution
|
|
10
|
+
*/
|
|
11
|
+
declare module 'proto.proto' {
|
|
12
|
+
interface LoggerInstance {
|
|
13
|
+
trace(this: any, message: string, data?: {}): void;
|
|
14
|
+
debug(this: any, message: string, data?: {}): void;
|
|
15
|
+
info(this: any, message: string, data?: {}): void;
|
|
16
|
+
warn(this: any, message: string, data?: {}): void;
|
|
17
|
+
error(this: any, message: string, data?: {}): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function init(configOrPath: string | { [key: string]: string }): void;
|
|
21
|
+
export function get(protoType: string): { [key: string]: unknown };
|
|
22
|
+
export function encode(
|
|
23
|
+
protoType: string,
|
|
24
|
+
data: { [key: string]: any },
|
|
25
|
+
): string;
|
|
26
|
+
export function decode(
|
|
27
|
+
protoType: string,
|
|
28
|
+
data?: string,
|
|
29
|
+
): { [key: string]: unknown };
|
|
30
|
+
export function verify(
|
|
31
|
+
protoType: string,
|
|
32
|
+
data: { [key: string]: any },
|
|
33
|
+
): { [key: string]: unknown };
|
|
34
|
+
export function set_logger(logger_instance: LoggerInstance): void;
|
|
35
|
+
export function set_logger(remove_logger_instance: undefined): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/** @noSelfInFile **/
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A versatile camera suite and render pipeline
|
|
5
|
+
* @see {@link https://github.com/klaytonkowalski/library-defold-rendy|Github Source}
|
|
6
|
+
* @noResolution
|
|
7
|
+
* @example `import * as rendy from 'rendy.rendy'`
|
|
8
|
+
*/
|
|
9
|
+
declare module 'rendy.rendy' {
|
|
10
|
+
type CameraId = Hash | string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Creates a camera. This function is called automatically by the rendy.go game object.
|
|
14
|
+
* @param camera_id - The identifier for the camera.
|
|
15
|
+
*/
|
|
16
|
+
function create_camera(camera_id: CameraId): void;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Destroys a camera. This function is called automatically by the rendy.go game object.
|
|
20
|
+
* @param camera_id - The identifier for the camera to be destroyed.
|
|
21
|
+
*/
|
|
22
|
+
function destroy_camera(camera_id: CameraId): void;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Sets a camera property. This function replaces the standard go.set().
|
|
26
|
+
* @param camera_id - The identifier for the camera.
|
|
27
|
+
* @param property - The property to be set.
|
|
28
|
+
* @param value - The value to set the property to.
|
|
29
|
+
*/
|
|
30
|
+
function set(camera_id: CameraId, property: Hash | string, value: any): void;
|
|
31
|
+
|
|
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
|
+
/**
|
|
113
|
+
* Gets a camera property. This function is equivalent to the standard go.get().
|
|
114
|
+
* @param camera_id - The identifier for the camera.
|
|
115
|
+
* @param property - The property to be retrieved.
|
|
116
|
+
* @returns The value of the specified property.
|
|
117
|
+
*/
|
|
118
|
+
function get(camera_id: CameraId, property: Hash | string): unknown;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Gets the initial window size specified in the game.project file.
|
|
122
|
+
* @returns The initial window size.
|
|
123
|
+
*/
|
|
124
|
+
function get_display_size(): Vector3;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Gets the current window size.
|
|
128
|
+
* @returns The current window size.
|
|
129
|
+
*/
|
|
130
|
+
function get_window_size(): Vector3;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Gets camera ids whose viewports intersect a screen position.
|
|
134
|
+
* @param screen_x - The x-coordinate of the screen position.
|
|
135
|
+
* @param screen_y - The y-coordinate of the screen position.
|
|
136
|
+
* @returns An array of camera ids.
|
|
137
|
+
*/
|
|
138
|
+
function get_stack(screen_x: number, screen_y: number): CameraId[];
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Starts a camera shake animation. If the camera is already shaking, then the animation is cancelled and restarted.
|
|
142
|
+
* The radius is increased or decreased over time if the scaler argument is ~= 1.
|
|
143
|
+
* @param camera_id - The identifier for the camera.
|
|
144
|
+
* @param radius - The initial radius of the camera shake.
|
|
145
|
+
* @param intensity - The intensity of the camera shake.
|
|
146
|
+
* @param duration - The duration of the camera shake animation.
|
|
147
|
+
* @param scaler - Optional scaler argument for adjusting the radius over time.
|
|
148
|
+
*/
|
|
149
|
+
function shake(
|
|
150
|
+
camera_id: CameraId,
|
|
151
|
+
radius: number,
|
|
152
|
+
intensity: number,
|
|
153
|
+
duration: number,
|
|
154
|
+
scaler?: number,
|
|
155
|
+
): void;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Cancels an ongoing camera shake animation.
|
|
159
|
+
* @param camera_id - The identifier for the camera.
|
|
160
|
+
*/
|
|
161
|
+
function cancel_shake(camera_id: CameraId): void;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Converts a screen position to a world position. The screen position's z component maps to the camera frustum's z component.
|
|
165
|
+
* @param camera_id - The identifier for the camera.
|
|
166
|
+
* @param screen_position - The screen position to be converted.
|
|
167
|
+
* @returns The corresponding world position.
|
|
168
|
+
*/
|
|
169
|
+
function screen_to_world(
|
|
170
|
+
camera_id: CameraId,
|
|
171
|
+
screen_position: Vector3,
|
|
172
|
+
): Vector3;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Converts a world position to a screen position. The world position's z component maps to the camera frustum's z component.
|
|
176
|
+
* @param camera_id - The identifier for the camera.
|
|
177
|
+
* @param world_position - The world position to be converted.
|
|
178
|
+
* @returns The corresponding screen position.
|
|
179
|
+
*/
|
|
180
|
+
function world_to_screen(
|
|
181
|
+
camera_id: CameraId,
|
|
182
|
+
world_position: Vector3,
|
|
183
|
+
): Vector3;
|
|
184
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see {@link https://github.com/britzl/defold-richtext|Github Source}
|
|
3
|
+
* @example `import * as color from 'richtext.color'`
|
|
4
|
+
* @noResolution
|
|
5
|
+
*/
|
|
6
|
+
declare module 'richtext.color' {
|
|
7
|
+
export function add(name: string, color: number | string): void;
|
|
8
|
+
|
|
9
|
+
export const COLORS: {
|
|
10
|
+
aqua: Vector4;
|
|
11
|
+
black: Vector4;
|
|
12
|
+
blue: Vector4;
|
|
13
|
+
brown: Vector4;
|
|
14
|
+
cyan: Vector4;
|
|
15
|
+
darkblue: Vector4;
|
|
16
|
+
fuchsia: Vector4;
|
|
17
|
+
green: Vector4;
|
|
18
|
+
grey: Vector4;
|
|
19
|
+
lightblue: Vector4;
|
|
20
|
+
lime: Vector4;
|
|
21
|
+
magenta: Vector4;
|
|
22
|
+
maroon: Vector4;
|
|
23
|
+
navy: Vector4;
|
|
24
|
+
olive: Vector4;
|
|
25
|
+
orange: Vector4;
|
|
26
|
+
purple: Vector4;
|
|
27
|
+
red: Vector4;
|
|
28
|
+
silver: Vector4;
|
|
29
|
+
teal: Vector4;
|
|
30
|
+
white: Vector4;
|
|
31
|
+
yellow: Vector4;
|
|
32
|
+
};
|
|
33
|
+
}
|