goudengine 0.0.828 → 0.0.831
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 +116 -0
- package/dist/generated/diagnostic.g.d.ts +15 -0
- package/dist/generated/diagnostic.g.d.ts.map +1 -0
- package/dist/generated/diagnostic.g.js +50 -0
- package/dist/generated/diagnostic.g.js.map +1 -0
- package/dist/generated/index.g.d.ts +4 -2
- package/dist/generated/index.g.d.ts.map +1 -1
- package/dist/generated/index.g.js +8 -1
- package/dist/generated/index.g.js.map +1 -1
- package/dist/generated/node/index.g.d.ts +443 -3
- package/dist/generated/node/index.g.d.ts.map +1 -1
- package/dist/generated/node/index.g.js +985 -17
- package/dist/generated/node/index.g.js.map +1 -1
- package/dist/generated/types/engine.g.d.ts +541 -0
- package/dist/generated/types/engine.g.d.ts.map +1 -1
- package/dist/generated/types/input.g.d.ts +43 -1
- package/dist/generated/types/input.g.d.ts.map +1 -1
- package/dist/generated/types/input.g.js +50 -1
- package/dist/generated/types/input.g.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/node/index.d.ts +6 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +28 -0
- package/dist/node/index.js.map +1 -0
- package/dist/shared/debugger.d.ts +9 -0
- package/dist/shared/debugger.d.ts.map +1 -0
- package/dist/shared/debugger.js +11 -0
- package/dist/shared/debugger.js.map +1 -0
- package/dist/shared/network.d.ts +39 -0
- package/dist/shared/network.d.ts.map +1 -0
- package/dist/shared/network.js +66 -0
- package/dist/shared/network.js.map +1 -0
- package/dist/web/generated/types/engine.g.d.ts +541 -0
- package/dist/web/generated/types/engine.g.d.ts.map +1 -1
- package/dist/web/generated/types/input.g.d.ts +43 -1
- package/dist/web/generated/types/input.g.d.ts.map +1 -1
- package/dist/web/generated/types/input.g.js +49 -0
- package/dist/web/generated/types/input.g.js.map +1 -1
- package/dist/web/generated/web/index.g.d.ts +175 -3
- package/dist/web/generated/web/index.g.d.ts.map +1 -1
- package/dist/web/generated/web/index.g.js +497 -6
- package/dist/web/generated/web/index.g.js.map +1 -1
- package/dist/web/shared/debugger.d.ts +9 -0
- package/dist/web/shared/debugger.d.ts.map +1 -0
- package/dist/web/shared/debugger.js +7 -0
- package/dist/web/shared/debugger.js.map +1 -0
- package/dist/web/shared/network.d.ts +39 -0
- package/dist/web/shared/network.d.ts.map +1 -0
- package/dist/web/shared/network.js +61 -0
- package/dist/web/shared/network.js.map +1 -0
- package/dist/web/web/index.d.ts +6 -0
- package/dist/web/web/index.d.ts.map +1 -0
- package/dist/web/web/index.js +6 -0
- package/dist/web/web/index.js.map +1 -0
- package/goud-engine-node.darwin-arm64.node +0 -0
- package/goud-engine-node.darwin-x64.node +0 -0
- package/goud-engine-node.linux-x64-gnu.node +0 -0
- package/goud-engine-node.win32-x64-msvc.node +0 -0
- package/index.d.ts +381 -0
- package/index.js +56 -52
- package/package.json +25 -19
- package/wasm/goud_engine.d.ts +716 -70
- package/wasm/goud_engine.js +1401 -20
- package/wasm/goud_engine_bg.wasm +0 -0
- package/wasm/goud_engine_bg.wasm.d.ts +180 -70
package/wasm/goud_engine.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/* @ts-self-types="./goud_engine.d.ts" */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Collision contact data returned by wasm collision helper methods.
|
|
5
|
+
*/
|
|
3
6
|
export class WasmContact {
|
|
4
7
|
static __wrap(ptr) {
|
|
5
8
|
ptr = ptr >>> 0;
|
|
@@ -19,6 +22,7 @@ export class WasmContact {
|
|
|
19
22
|
wasm.__wbg_wasmcontact_free(ptr, 0);
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
25
|
+
* Contact normal X component.
|
|
22
26
|
* @returns {number}
|
|
23
27
|
*/
|
|
24
28
|
get normal_x() {
|
|
@@ -26,6 +30,7 @@ export class WasmContact {
|
|
|
26
30
|
return ret;
|
|
27
31
|
}
|
|
28
32
|
/**
|
|
33
|
+
* Contact normal Y component.
|
|
29
34
|
* @returns {number}
|
|
30
35
|
*/
|
|
31
36
|
get normal_y() {
|
|
@@ -33,6 +38,7 @@ export class WasmContact {
|
|
|
33
38
|
return ret;
|
|
34
39
|
}
|
|
35
40
|
/**
|
|
41
|
+
* Penetration depth along the contact normal.
|
|
36
42
|
* @returns {number}
|
|
37
43
|
*/
|
|
38
44
|
get penetration() {
|
|
@@ -40,6 +46,7 @@ export class WasmContact {
|
|
|
40
46
|
return ret;
|
|
41
47
|
}
|
|
42
48
|
/**
|
|
49
|
+
* Contact point X coordinate.
|
|
43
50
|
* @returns {number}
|
|
44
51
|
*/
|
|
45
52
|
get point_x() {
|
|
@@ -47,6 +54,7 @@ export class WasmContact {
|
|
|
47
54
|
return ret;
|
|
48
55
|
}
|
|
49
56
|
/**
|
|
57
|
+
* Contact point Y coordinate.
|
|
50
58
|
* @returns {number}
|
|
51
59
|
*/
|
|
52
60
|
get point_y() {
|
|
@@ -54,30 +62,35 @@ export class WasmContact {
|
|
|
54
62
|
return ret;
|
|
55
63
|
}
|
|
56
64
|
/**
|
|
65
|
+
* Contact normal X component.
|
|
57
66
|
* @param {number} arg0
|
|
58
67
|
*/
|
|
59
68
|
set normal_x(arg0) {
|
|
60
69
|
wasm.__wbg_set_wasmcontact_normal_x(this.__wbg_ptr, arg0);
|
|
61
70
|
}
|
|
62
71
|
/**
|
|
72
|
+
* Contact normal Y component.
|
|
63
73
|
* @param {number} arg0
|
|
64
74
|
*/
|
|
65
75
|
set normal_y(arg0) {
|
|
66
76
|
wasm.__wbg_set_wasmcontact_normal_y(this.__wbg_ptr, arg0);
|
|
67
77
|
}
|
|
68
78
|
/**
|
|
79
|
+
* Penetration depth along the contact normal.
|
|
69
80
|
* @param {number} arg0
|
|
70
81
|
*/
|
|
71
82
|
set penetration(arg0) {
|
|
72
83
|
wasm.__wbg_set_wasmcontact_penetration(this.__wbg_ptr, arg0);
|
|
73
84
|
}
|
|
74
85
|
/**
|
|
86
|
+
* Contact point X coordinate.
|
|
75
87
|
* @param {number} arg0
|
|
76
88
|
*/
|
|
77
89
|
set point_x(arg0) {
|
|
78
90
|
wasm.__wbg_set_wasmcontact_point_x(this.__wbg_ptr, arg0);
|
|
79
91
|
}
|
|
80
92
|
/**
|
|
93
|
+
* Contact point Y coordinate.
|
|
81
94
|
* @param {number} arg0
|
|
82
95
|
*/
|
|
83
96
|
set point_y(arg0) {
|
|
@@ -111,6 +124,7 @@ export class WasmGame {
|
|
|
111
124
|
wasm.__wbg_wasmgame_free(ptr, 0);
|
|
112
125
|
}
|
|
113
126
|
/**
|
|
127
|
+
* Returns whether two AABBs overlap.
|
|
114
128
|
* @param {number} min_ax
|
|
115
129
|
* @param {number} min_ay
|
|
116
130
|
* @param {number} max_ax
|
|
@@ -126,6 +140,7 @@ export class WasmGame {
|
|
|
126
140
|
return ret !== 0;
|
|
127
141
|
}
|
|
128
142
|
/**
|
|
143
|
+
* Inserts or replaces `Name` on the entity.
|
|
129
144
|
* @param {bigint} entity_bits
|
|
130
145
|
* @param {string} name
|
|
131
146
|
*/
|
|
@@ -135,6 +150,7 @@ export class WasmGame {
|
|
|
135
150
|
wasm.wasmgame_add_name(this.__wbg_ptr, entity_bits, ptr0, len0);
|
|
136
151
|
}
|
|
137
152
|
/**
|
|
153
|
+
* Accumulates scroll delta for the current frame.
|
|
138
154
|
* @param {number} dx
|
|
139
155
|
* @param {number} dy
|
|
140
156
|
*/
|
|
@@ -142,6 +158,7 @@ export class WasmGame {
|
|
|
142
158
|
wasm.wasmgame_add_scroll_delta(this.__wbg_ptr, dx, dy);
|
|
143
159
|
}
|
|
144
160
|
/**
|
|
161
|
+
* Inserts or replaces `Sprite` on the entity.
|
|
145
162
|
* @param {bigint} entity_bits
|
|
146
163
|
* @param {number} texture_handle
|
|
147
164
|
* @param {number} r
|
|
@@ -157,6 +174,7 @@ export class WasmGame {
|
|
|
157
174
|
wasm.wasmgame_add_sprite(this.__wbg_ptr, entity_bits, texture_handle, r, g, b, a, flip_x, flip_y, anchor_x, anchor_y);
|
|
158
175
|
}
|
|
159
176
|
/**
|
|
177
|
+
* Inserts or replaces `Transform2D` on the entity.
|
|
160
178
|
* @param {bigint} entity_bits
|
|
161
179
|
* @param {number} px
|
|
162
180
|
* @param {number} py
|
|
@@ -167,6 +185,210 @@ export class WasmGame {
|
|
|
167
185
|
add_transform2d(entity_bits, px, py, rotation, sx, sy) {
|
|
168
186
|
wasm.wasmgame_add_transform2d(this.__wbg_ptr, entity_bits, px, py, rotation, sx, sy);
|
|
169
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Creates or resumes the WebAudio context.
|
|
190
|
+
*
|
|
191
|
+
* Call this from the first user gesture (click/touch/key) to satisfy
|
|
192
|
+
* browser autoplay restrictions.
|
|
193
|
+
* @returns {number}
|
|
194
|
+
*/
|
|
195
|
+
audio_activate() {
|
|
196
|
+
const ret = wasm.wasmgame_audio_activate(this.__wbg_ptr);
|
|
197
|
+
return ret;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Applies an immediate two-player mix in `[0, 1]`.
|
|
201
|
+
* @param {number} from_player_id
|
|
202
|
+
* @param {number} to_player_id
|
|
203
|
+
* @param {number} mix
|
|
204
|
+
* @returns {number}
|
|
205
|
+
*/
|
|
206
|
+
audio_crossfade(from_player_id, to_player_id, mix) {
|
|
207
|
+
const ret = wasm.wasmgame_audio_crossfade(this.__wbg_ptr, from_player_id, to_player_id, mix);
|
|
208
|
+
return ret;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Pauses a player's playback.
|
|
212
|
+
* @param {number} player_id
|
|
213
|
+
* @returns {number}
|
|
214
|
+
*/
|
|
215
|
+
audio_pause(player_id) {
|
|
216
|
+
const ret = wasm.wasmgame_audio_pause(this.__wbg_ptr, player_id);
|
|
217
|
+
return ret;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Plays audio without spatialization defaults.
|
|
221
|
+
* @param {Uint8Array} asset_data
|
|
222
|
+
* @returns {number}
|
|
223
|
+
*/
|
|
224
|
+
audio_play(asset_data) {
|
|
225
|
+
const ptr0 = passArray8ToWasm0(asset_data, wasm.__wbindgen_malloc);
|
|
226
|
+
const len0 = WASM_VECTOR_LEN;
|
|
227
|
+
const ret = wasm.wasmgame_audio_play(this.__wbg_ptr, ptr0, len0);
|
|
228
|
+
return ret;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Plays audio with spatial attenuation in 2D (`z = 0`).
|
|
232
|
+
* @param {Uint8Array} asset_data
|
|
233
|
+
* @param {number} source_x
|
|
234
|
+
* @param {number} source_y
|
|
235
|
+
* @param {number} listener_x
|
|
236
|
+
* @param {number} listener_y
|
|
237
|
+
* @param {number} max_distance
|
|
238
|
+
* @param {number} rolloff
|
|
239
|
+
* @returns {number}
|
|
240
|
+
*/
|
|
241
|
+
audio_play_spatial(asset_data, source_x, source_y, listener_x, listener_y, max_distance, rolloff) {
|
|
242
|
+
const ptr0 = passArray8ToWasm0(asset_data, wasm.__wbindgen_malloc);
|
|
243
|
+
const len0 = WASM_VECTOR_LEN;
|
|
244
|
+
const ret = wasm.wasmgame_audio_play_spatial(this.__wbg_ptr, ptr0, len0, source_x, source_y, listener_x, listener_y, max_distance, rolloff);
|
|
245
|
+
return ret;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Plays audio with spatial attenuation in 3D.
|
|
249
|
+
* @param {Uint8Array} asset_data
|
|
250
|
+
* @param {number} source_x
|
|
251
|
+
* @param {number} source_y
|
|
252
|
+
* @param {number} source_z
|
|
253
|
+
* @param {number} listener_x
|
|
254
|
+
* @param {number} listener_y
|
|
255
|
+
* @param {number} listener_z
|
|
256
|
+
* @param {number} max_distance
|
|
257
|
+
* @param {number} rolloff
|
|
258
|
+
* @returns {number}
|
|
259
|
+
*/
|
|
260
|
+
audio_play_spatial_3d(asset_data, source_x, source_y, source_z, listener_x, listener_y, listener_z, max_distance, rolloff) {
|
|
261
|
+
const ptr0 = passArray8ToWasm0(asset_data, wasm.__wbindgen_malloc);
|
|
262
|
+
const len0 = WASM_VECTOR_LEN;
|
|
263
|
+
const ret = wasm.wasmgame_audio_play_spatial_3d(this.__wbg_ptr, ptr0, len0, source_x, source_y, source_z, listener_x, listener_y, listener_z, max_distance, rolloff);
|
|
264
|
+
return ret;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Resumes a paused player.
|
|
268
|
+
* @param {number} player_id
|
|
269
|
+
* @returns {number}
|
|
270
|
+
*/
|
|
271
|
+
audio_resume(player_id) {
|
|
272
|
+
const ret = wasm.wasmgame_audio_resume(this.__wbg_ptr, player_id);
|
|
273
|
+
return ret;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Sets the global spatial listener position in 2D (`z = 0`).
|
|
277
|
+
* @param {number} x
|
|
278
|
+
* @param {number} y
|
|
279
|
+
* @returns {number}
|
|
280
|
+
*/
|
|
281
|
+
audio_set_listener_position(x, y) {
|
|
282
|
+
const ret = wasm.wasmgame_audio_set_listener_position(this.__wbg_ptr, x, y);
|
|
283
|
+
return ret;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Sets the global spatial listener position in 3D.
|
|
287
|
+
* @param {number} x
|
|
288
|
+
* @param {number} y
|
|
289
|
+
* @param {number} z
|
|
290
|
+
* @returns {number}
|
|
291
|
+
*/
|
|
292
|
+
audio_set_listener_position_3d(x, y, z) {
|
|
293
|
+
const ret = wasm.wasmgame_audio_set_listener_position_3d(this.__wbg_ptr, x, y, z);
|
|
294
|
+
return ret;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Sets a player's playback speed in `[0.1, 10.0]`.
|
|
298
|
+
* @param {number} player_id
|
|
299
|
+
* @param {number} speed
|
|
300
|
+
* @returns {number}
|
|
301
|
+
*/
|
|
302
|
+
audio_set_player_speed(player_id, speed) {
|
|
303
|
+
const ret = wasm.wasmgame_audio_set_player_speed(this.__wbg_ptr, player_id, speed);
|
|
304
|
+
return ret;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Sets a player's base volume in `[0, 1]`.
|
|
308
|
+
* @param {number} player_id
|
|
309
|
+
* @param {number} volume
|
|
310
|
+
* @returns {number}
|
|
311
|
+
*/
|
|
312
|
+
audio_set_player_volume(player_id, volume) {
|
|
313
|
+
const ret = wasm.wasmgame_audio_set_player_volume(this.__wbg_ptr, player_id, volume);
|
|
314
|
+
return ret;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Sets (or updates) a player source position in 2D (`z = 0`).
|
|
318
|
+
* @param {number} player_id
|
|
319
|
+
* @param {number} x
|
|
320
|
+
* @param {number} y
|
|
321
|
+
* @param {number} max_distance
|
|
322
|
+
* @param {number} rolloff
|
|
323
|
+
* @returns {number}
|
|
324
|
+
*/
|
|
325
|
+
audio_set_source_position(player_id, x, y, max_distance, rolloff) {
|
|
326
|
+
const ret = wasm.wasmgame_audio_set_source_position(this.__wbg_ptr, player_id, x, y, max_distance, rolloff);
|
|
327
|
+
return ret;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Sets (or updates) a player source position in 3D.
|
|
331
|
+
* @param {number} player_id
|
|
332
|
+
* @param {number} x
|
|
333
|
+
* @param {number} y
|
|
334
|
+
* @param {number} z
|
|
335
|
+
* @param {number} max_distance
|
|
336
|
+
* @param {number} rolloff
|
|
337
|
+
* @returns {number}
|
|
338
|
+
*/
|
|
339
|
+
audio_set_source_position_3d(player_id, x, y, z, max_distance, rolloff) {
|
|
340
|
+
const ret = wasm.wasmgame_audio_set_source_position_3d(this.__wbg_ptr, player_id, x, y, z, max_distance, rolloff);
|
|
341
|
+
return ret;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Stops a player and releases its WebAudio resources.
|
|
345
|
+
* @param {number} player_id
|
|
346
|
+
* @returns {number}
|
|
347
|
+
*/
|
|
348
|
+
audio_stop(player_id) {
|
|
349
|
+
const ret = wasm.wasmgame_audio_stop(this.__wbg_ptr, player_id);
|
|
350
|
+
return ret;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Stops all active players and releases their WebAudio resources.
|
|
354
|
+
* @returns {number}
|
|
355
|
+
*/
|
|
356
|
+
audio_stop_all() {
|
|
357
|
+
const ret = wasm.wasmgame_audio_stop_all(this.__wbg_ptr);
|
|
358
|
+
return ret;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Updates attenuation for a playing spatial source in 2D (`z = 0`).
|
|
362
|
+
* @param {number} player_id
|
|
363
|
+
* @param {number} source_x
|
|
364
|
+
* @param {number} source_y
|
|
365
|
+
* @param {number} listener_x
|
|
366
|
+
* @param {number} listener_y
|
|
367
|
+
* @param {number} max_distance
|
|
368
|
+
* @param {number} rolloff
|
|
369
|
+
* @returns {number}
|
|
370
|
+
*/
|
|
371
|
+
audio_update_spatial_volume(player_id, source_x, source_y, listener_x, listener_y, max_distance, rolloff) {
|
|
372
|
+
const ret = wasm.wasmgame_audio_update_spatial_volume(this.__wbg_ptr, player_id, source_x, source_y, listener_x, listener_y, max_distance, rolloff);
|
|
373
|
+
return ret;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Updates attenuation for a playing spatial source in 3D.
|
|
377
|
+
* @param {number} player_id
|
|
378
|
+
* @param {number} source_x
|
|
379
|
+
* @param {number} source_y
|
|
380
|
+
* @param {number} source_z
|
|
381
|
+
* @param {number} listener_x
|
|
382
|
+
* @param {number} listener_y
|
|
383
|
+
* @param {number} listener_z
|
|
384
|
+
* @param {number} max_distance
|
|
385
|
+
* @param {number} rolloff
|
|
386
|
+
* @returns {number}
|
|
387
|
+
*/
|
|
388
|
+
audio_update_spatial_volume_3d(player_id, source_x, source_y, source_z, listener_x, listener_y, listener_z, max_distance, rolloff) {
|
|
389
|
+
const ret = wasm.wasmgame_audio_update_spatial_volume_3d(this.__wbg_ptr, player_id, source_x, source_y, source_z, listener_x, listener_y, listener_z, max_distance, rolloff);
|
|
390
|
+
return ret;
|
|
391
|
+
}
|
|
170
392
|
/**
|
|
171
393
|
* Advances frame timing and prepares the wgpu surface for drawing.
|
|
172
394
|
*
|
|
@@ -177,6 +399,30 @@ export class WasmGame {
|
|
|
177
399
|
wasm.wasmgame_begin_frame(this.__wbg_ptr, delta_time);
|
|
178
400
|
}
|
|
179
401
|
/**
|
|
402
|
+
* Capture the canvas as a base64-encoded PNG data URL.
|
|
403
|
+
* The actual canvas capture is done in JS via canvas.toDataURL().
|
|
404
|
+
* @returns {string}
|
|
405
|
+
*/
|
|
406
|
+
captureCanvasBase64() {
|
|
407
|
+
let deferred2_0;
|
|
408
|
+
let deferred2_1;
|
|
409
|
+
try {
|
|
410
|
+
const ret = wasm.wasmgame_captureCanvasBase64(this.__wbg_ptr);
|
|
411
|
+
var ptr1 = ret[0];
|
|
412
|
+
var len1 = ret[1];
|
|
413
|
+
if (ret[3]) {
|
|
414
|
+
ptr1 = 0; len1 = 0;
|
|
415
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
416
|
+
}
|
|
417
|
+
deferred2_0 = ptr1;
|
|
418
|
+
deferred2_1 = len1;
|
|
419
|
+
return getStringFromWasm0(ptr1, len1);
|
|
420
|
+
} finally {
|
|
421
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Returns whether two circles overlap.
|
|
180
426
|
* @param {number} x1
|
|
181
427
|
* @param {number} y1
|
|
182
428
|
* @param {number} r1
|
|
@@ -190,6 +436,24 @@ export class WasmGame {
|
|
|
190
436
|
return ret !== 0;
|
|
191
437
|
}
|
|
192
438
|
/**
|
|
439
|
+
* Overlay handle selection is unsupported in browser networking mode.
|
|
440
|
+
* @returns {number}
|
|
441
|
+
*/
|
|
442
|
+
clear_network_overlay_handle() {
|
|
443
|
+
const ret = wasm.wasmgame_clear_network_overlay_handle(this.__wbg_ptr);
|
|
444
|
+
return ret;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Network simulation controls are unsupported in browser networking mode.
|
|
448
|
+
* @param {number} _handle
|
|
449
|
+
* @returns {number}
|
|
450
|
+
*/
|
|
451
|
+
clear_network_simulation(_handle) {
|
|
452
|
+
const ret = wasm.wasmgame_clear_network_simulation(this.__wbg_ptr, _handle);
|
|
453
|
+
return ret;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Tests axis-aligned box vs axis-aligned box overlap and returns contact data.
|
|
193
457
|
* @param {number} center_ax
|
|
194
458
|
* @param {number} center_ay
|
|
195
459
|
* @param {number} half_wa
|
|
@@ -205,6 +469,7 @@ export class WasmGame {
|
|
|
205
469
|
return ret === 0 ? undefined : WasmContact.__wrap(ret);
|
|
206
470
|
}
|
|
207
471
|
/**
|
|
472
|
+
* Tests circle vs axis-aligned box overlap and returns contact data.
|
|
208
473
|
* @param {number} cx
|
|
209
474
|
* @param {number} cy
|
|
210
475
|
* @param {number} cr
|
|
@@ -219,6 +484,7 @@ export class WasmGame {
|
|
|
219
484
|
return ret === 0 ? undefined : WasmContact.__wrap(ret);
|
|
220
485
|
}
|
|
221
486
|
/**
|
|
487
|
+
* Tests circle vs circle overlap and returns contact data.
|
|
222
488
|
* @param {number} center_ax
|
|
223
489
|
* @param {number} center_ay
|
|
224
490
|
* @param {number} radius_a
|
|
@@ -254,6 +520,7 @@ export class WasmGame {
|
|
|
254
520
|
return ret;
|
|
255
521
|
}
|
|
256
522
|
/**
|
|
523
|
+
* Despawns an entity by packed entity bits.
|
|
257
524
|
* @param {bigint} entity_bits
|
|
258
525
|
* @returns {boolean}
|
|
259
526
|
*/
|
|
@@ -274,12 +541,45 @@ export class WasmGame {
|
|
|
274
541
|
return ret >>> 0;
|
|
275
542
|
}
|
|
276
543
|
/**
|
|
544
|
+
* Destroys a loaded font and any backing atlas textures.
|
|
545
|
+
* @param {number} handle
|
|
546
|
+
* @returns {boolean}
|
|
547
|
+
*/
|
|
548
|
+
destroy_font(handle) {
|
|
549
|
+
const ret = wasm.wasmgame_destroy_font(this.__wbg_ptr, handle);
|
|
550
|
+
return ret !== 0;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Releases a previously registered texture handle.
|
|
554
|
+
*
|
|
555
|
+
* Handle `0` is reserved and ignored.
|
|
277
556
|
* @param {number} handle
|
|
278
557
|
*/
|
|
279
558
|
destroy_texture(handle) {
|
|
280
559
|
wasm.wasmgame_destroy_texture(this.__wbg_ptr, handle);
|
|
281
560
|
}
|
|
282
561
|
/**
|
|
562
|
+
* Dispatch a JSON debugger request and return the JSON response.
|
|
563
|
+
* Used by the WebSocket relay to forward IPC verbs.
|
|
564
|
+
* @param {string} json
|
|
565
|
+
* @returns {string}
|
|
566
|
+
*/
|
|
567
|
+
dispatchDebuggerRequest(json) {
|
|
568
|
+
let deferred2_0;
|
|
569
|
+
let deferred2_1;
|
|
570
|
+
try {
|
|
571
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
572
|
+
const len0 = WASM_VECTOR_LEN;
|
|
573
|
+
const ret = wasm.wasmgame_dispatchDebuggerRequest(this.__wbg_ptr, ptr0, len0);
|
|
574
|
+
deferred2_0 = ret[0];
|
|
575
|
+
deferred2_1 = ret[1];
|
|
576
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
577
|
+
} finally {
|
|
578
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Returns Euclidean distance between two points.
|
|
283
583
|
* @param {number} x1
|
|
284
584
|
* @param {number} y1
|
|
285
585
|
* @param {number} x2
|
|
@@ -291,6 +591,7 @@ export class WasmGame {
|
|
|
291
591
|
return ret;
|
|
292
592
|
}
|
|
293
593
|
/**
|
|
594
|
+
* Returns squared Euclidean distance between two points.
|
|
294
595
|
* @param {number} x1
|
|
295
596
|
* @param {number} y1
|
|
296
597
|
* @param {number} x2
|
|
@@ -302,6 +603,7 @@ export class WasmGame {
|
|
|
302
603
|
return ret;
|
|
303
604
|
}
|
|
304
605
|
/**
|
|
606
|
+
* Draws a solid-color quad using the renderer fallback texture.
|
|
305
607
|
* @param {number} x
|
|
306
608
|
* @param {number} y
|
|
307
609
|
* @param {number} w
|
|
@@ -315,6 +617,9 @@ export class WasmGame {
|
|
|
315
617
|
wasm.wasmgame_draw_quad(this.__wbg_ptr, x, y, w, h, r, g, b, a);
|
|
316
618
|
}
|
|
317
619
|
/**
|
|
620
|
+
* Draws a textured sprite in world or screen space.
|
|
621
|
+
*
|
|
622
|
+
* `texture` is a 1-based handle returned by `register_texture_from_bytes`.
|
|
318
623
|
* @param {number} texture
|
|
319
624
|
* @param {number} x
|
|
320
625
|
* @param {number} y
|
|
@@ -330,6 +635,9 @@ export class WasmGame {
|
|
|
330
635
|
wasm.wasmgame_draw_sprite(this.__wbg_ptr, texture, x, y, w, h, rotation, r, g, b, a);
|
|
331
636
|
}
|
|
332
637
|
/**
|
|
638
|
+
* Draws a textured sprite using a source rectangle in texture UV space.
|
|
639
|
+
*
|
|
640
|
+
* Returns `true` when the draw command is queued.
|
|
333
641
|
* @param {number} texture
|
|
334
642
|
* @param {number} x
|
|
335
643
|
* @param {number} y
|
|
@@ -350,6 +658,32 @@ export class WasmGame {
|
|
|
350
658
|
const ret = wasm.wasmgame_draw_sprite_rect(this.__wbg_ptr, texture, x, y, w, h, rotation, src_x, src_y, src_w, src_h, r, g, b, a);
|
|
351
659
|
return ret !== 0;
|
|
352
660
|
}
|
|
661
|
+
/**
|
|
662
|
+
* Draws shaped text with alignment, wrapping, spacing, direction, and tint.
|
|
663
|
+
*
|
|
664
|
+
* `alignment`: 0 = Left, 1 = Center, 2 = Right
|
|
665
|
+
* `direction`: 0 = Auto, 1 = LTR, 2 = RTL
|
|
666
|
+
* @param {number} font_handle
|
|
667
|
+
* @param {string} text
|
|
668
|
+
* @param {number} x
|
|
669
|
+
* @param {number} y
|
|
670
|
+
* @param {number} font_size
|
|
671
|
+
* @param {number} alignment
|
|
672
|
+
* @param {number} max_width
|
|
673
|
+
* @param {number} line_spacing
|
|
674
|
+
* @param {number} direction
|
|
675
|
+
* @param {number} r
|
|
676
|
+
* @param {number} g
|
|
677
|
+
* @param {number} b
|
|
678
|
+
* @param {number} a
|
|
679
|
+
* @returns {boolean}
|
|
680
|
+
*/
|
|
681
|
+
draw_text(font_handle, text, x, y, font_size, alignment, max_width, line_spacing, direction, r, g, b, a) {
|
|
682
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
683
|
+
const len0 = WASM_VECTOR_LEN;
|
|
684
|
+
const ret = wasm.wasmgame_draw_text(this.__wbg_ptr, font_handle, ptr0, len0, x, y, font_size, alignment, max_width, line_spacing, direction, r, g, b, a);
|
|
685
|
+
return ret !== 0;
|
|
686
|
+
}
|
|
353
687
|
/**
|
|
354
688
|
* Flushes queued draw calls and presents the frame to the canvas.
|
|
355
689
|
*
|
|
@@ -359,6 +693,7 @@ export class WasmGame {
|
|
|
359
693
|
wasm.wasmgame_end_frame(this.__wbg_ptr);
|
|
360
694
|
}
|
|
361
695
|
/**
|
|
696
|
+
* Returns the number of currently alive entities.
|
|
362
697
|
* @returns {number}
|
|
363
698
|
*/
|
|
364
699
|
entity_count() {
|
|
@@ -382,6 +717,23 @@ export class WasmGame {
|
|
|
382
717
|
return BigInt.asUintN(64, ret);
|
|
383
718
|
}
|
|
384
719
|
/**
|
|
720
|
+
* Get the debugger snapshot as JSON.
|
|
721
|
+
* @returns {string}
|
|
722
|
+
*/
|
|
723
|
+
getDebuggerSnapshotJson() {
|
|
724
|
+
let deferred1_0;
|
|
725
|
+
let deferred1_1;
|
|
726
|
+
try {
|
|
727
|
+
const ret = wasm.wasmgame_getDebuggerSnapshotJson(this.__wbg_ptr);
|
|
728
|
+
deferred1_0 = ret[0];
|
|
729
|
+
deferred1_1 = ret[1];
|
|
730
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
731
|
+
} finally {
|
|
732
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Gets the entity's `Name`.
|
|
385
737
|
* @param {bigint} entity_bits
|
|
386
738
|
* @returns {string | undefined}
|
|
387
739
|
*/
|
|
@@ -394,6 +746,23 @@ export class WasmGame {
|
|
|
394
746
|
}
|
|
395
747
|
return v1;
|
|
396
748
|
}
|
|
749
|
+
/**
|
|
750
|
+
* Returns network capabilities for browser/WebSocket mode.
|
|
751
|
+
* @returns {WasmNetworkCapabilities}
|
|
752
|
+
*/
|
|
753
|
+
get_network_capabilities() {
|
|
754
|
+
const ret = wasm.wasmgame_get_network_capabilities(this.__wbg_ptr);
|
|
755
|
+
return WasmNetworkCapabilities.__wrap(ret);
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Returns aggregate stats for a specific network handle.
|
|
759
|
+
* @param {number} handle
|
|
760
|
+
* @returns {WasmNetworkStats}
|
|
761
|
+
*/
|
|
762
|
+
get_network_stats(handle) {
|
|
763
|
+
const ret = wasm.wasmgame_get_network_stats(this.__wbg_ptr, handle);
|
|
764
|
+
return WasmNetworkStats.__wrap(ret);
|
|
765
|
+
}
|
|
397
766
|
/**
|
|
398
767
|
* Returns render statistics for the current frame, or `None` if
|
|
399
768
|
* rendering is not active.
|
|
@@ -404,6 +773,7 @@ export class WasmGame {
|
|
|
404
773
|
return ret === 0 ? undefined : WasmRenderStats.__wrap(ret);
|
|
405
774
|
}
|
|
406
775
|
/**
|
|
776
|
+
* Gets the entity's `Sprite` as a wasm-safe DTO.
|
|
407
777
|
* @param {bigint} entity_bits
|
|
408
778
|
* @returns {WasmSprite | undefined}
|
|
409
779
|
*/
|
|
@@ -412,6 +782,7 @@ export class WasmGame {
|
|
|
412
782
|
return ret === 0 ? undefined : WasmSprite.__wrap(ret);
|
|
413
783
|
}
|
|
414
784
|
/**
|
|
785
|
+
* Gets the entity's `Transform2D` as a wasm-safe DTO.
|
|
415
786
|
* @param {bigint} entity_bits
|
|
416
787
|
* @returns {WasmTransform2D | undefined}
|
|
417
788
|
*/
|
|
@@ -420,6 +791,7 @@ export class WasmGame {
|
|
|
420
791
|
return ret === 0 ? undefined : WasmTransform2D.__wrap(ret);
|
|
421
792
|
}
|
|
422
793
|
/**
|
|
794
|
+
* Returns whether the entity has a `Name` component.
|
|
423
795
|
* @param {bigint} entity_bits
|
|
424
796
|
* @returns {boolean}
|
|
425
797
|
*/
|
|
@@ -437,6 +809,7 @@ export class WasmGame {
|
|
|
437
809
|
return ret !== 0;
|
|
438
810
|
}
|
|
439
811
|
/**
|
|
812
|
+
* Returns whether the entity has a `Sprite` component.
|
|
440
813
|
* @param {bigint} entity_bits
|
|
441
814
|
* @returns {boolean}
|
|
442
815
|
*/
|
|
@@ -445,6 +818,7 @@ export class WasmGame {
|
|
|
445
818
|
return ret !== 0;
|
|
446
819
|
}
|
|
447
820
|
/**
|
|
821
|
+
* Returns whether the entity has a `Transform2D` component.
|
|
448
822
|
* @param {bigint} entity_bits
|
|
449
823
|
* @returns {boolean}
|
|
450
824
|
*/
|
|
@@ -452,6 +826,16 @@ export class WasmGame {
|
|
|
452
826
|
const ret = wasm.wasmgame_has_transform2d(this.__wbg_ptr, entity_bits);
|
|
453
827
|
return ret !== 0;
|
|
454
828
|
}
|
|
829
|
+
/**
|
|
830
|
+
* Initialize the debugger route for this game instance.
|
|
831
|
+
* Call this once after construction to enable debugger support.
|
|
832
|
+
* @param {string} route_label
|
|
833
|
+
*/
|
|
834
|
+
initDebugger(route_label) {
|
|
835
|
+
const ptr0 = passStringToWasm0(route_label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
836
|
+
const len0 = WASM_VECTOR_LEN;
|
|
837
|
+
wasm.wasmgame_initDebugger(this.__wbg_ptr, ptr0, len0);
|
|
838
|
+
}
|
|
455
839
|
/**
|
|
456
840
|
* Returns `true` if any key mapped to the given action was just pressed
|
|
457
841
|
* this frame (not held from previous frame).
|
|
@@ -488,6 +872,7 @@ export class WasmGame {
|
|
|
488
872
|
return ret !== 0;
|
|
489
873
|
}
|
|
490
874
|
/**
|
|
875
|
+
* Returns whether the entity bits identify a live entity.
|
|
491
876
|
* @param {bigint} entity_bits
|
|
492
877
|
* @returns {boolean}
|
|
493
878
|
*/
|
|
@@ -496,6 +881,7 @@ export class WasmGame {
|
|
|
496
881
|
return ret !== 0;
|
|
497
882
|
}
|
|
498
883
|
/**
|
|
884
|
+
* Returns whether a key transitioned to pressed in this frame.
|
|
499
885
|
* @param {number} key_code
|
|
500
886
|
* @returns {boolean}
|
|
501
887
|
*/
|
|
@@ -504,6 +890,7 @@ export class WasmGame {
|
|
|
504
890
|
return ret !== 0;
|
|
505
891
|
}
|
|
506
892
|
/**
|
|
893
|
+
* Returns whether a key transitioned to released in this frame.
|
|
507
894
|
* @param {number} key_code
|
|
508
895
|
* @returns {boolean}
|
|
509
896
|
*/
|
|
@@ -512,6 +899,7 @@ export class WasmGame {
|
|
|
512
899
|
return ret !== 0;
|
|
513
900
|
}
|
|
514
901
|
/**
|
|
902
|
+
* Returns whether a key is currently held down.
|
|
515
903
|
* @param {number} key_code
|
|
516
904
|
* @returns {boolean}
|
|
517
905
|
*/
|
|
@@ -520,6 +908,7 @@ export class WasmGame {
|
|
|
520
908
|
return ret !== 0;
|
|
521
909
|
}
|
|
522
910
|
/**
|
|
911
|
+
* Returns whether a mouse button transitioned to pressed in this frame.
|
|
523
912
|
* @param {number} button
|
|
524
913
|
* @returns {boolean}
|
|
525
914
|
*/
|
|
@@ -528,6 +917,7 @@ export class WasmGame {
|
|
|
528
917
|
return ret !== 0;
|
|
529
918
|
}
|
|
530
919
|
/**
|
|
920
|
+
* Returns whether a mouse button transitioned to released in this frame.
|
|
531
921
|
* @param {number} button
|
|
532
922
|
* @returns {boolean}
|
|
533
923
|
*/
|
|
@@ -536,6 +926,7 @@ export class WasmGame {
|
|
|
536
926
|
return ret !== 0;
|
|
537
927
|
}
|
|
538
928
|
/**
|
|
929
|
+
* Returns whether a mouse button is currently held down.
|
|
539
930
|
* @param {number} button
|
|
540
931
|
* @returns {boolean}
|
|
541
932
|
*/
|
|
@@ -557,6 +948,7 @@ export class WasmGame {
|
|
|
557
948
|
return ret !== 0;
|
|
558
949
|
}
|
|
559
950
|
/**
|
|
951
|
+
* Returns the current mouse X position.
|
|
560
952
|
* @returns {number}
|
|
561
953
|
*/
|
|
562
954
|
mouse_x() {
|
|
@@ -564,12 +956,116 @@ export class WasmGame {
|
|
|
564
956
|
return ret;
|
|
565
957
|
}
|
|
566
958
|
/**
|
|
959
|
+
* Returns the current mouse Y position.
|
|
567
960
|
* @returns {number}
|
|
568
961
|
*/
|
|
569
962
|
mouse_y() {
|
|
570
963
|
const ret = wasm.wasmgame_mouse_y(this.__wbg_ptr);
|
|
571
964
|
return ret;
|
|
572
965
|
}
|
|
966
|
+
/**
|
|
967
|
+
* Convenience connect returning the connection handle only.
|
|
968
|
+
* @param {number} protocol
|
|
969
|
+
* @param {string} address
|
|
970
|
+
* @param {number} port
|
|
971
|
+
* @returns {number}
|
|
972
|
+
*/
|
|
973
|
+
network_connect(protocol, address, port) {
|
|
974
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
975
|
+
const len0 = WASM_VECTOR_LEN;
|
|
976
|
+
const ret = wasm.wasmgame_network_connect(this.__wbg_ptr, protocol, ptr0, len0, port);
|
|
977
|
+
if (ret[2]) {
|
|
978
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
979
|
+
}
|
|
980
|
+
return ret[0];
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* Connects to a remote WebSocket endpoint and returns a connection handle.
|
|
984
|
+
* @param {number} protocol
|
|
985
|
+
* @param {string} address
|
|
986
|
+
* @param {number} port
|
|
987
|
+
* @returns {WasmNetworkConnectResult}
|
|
988
|
+
*/
|
|
989
|
+
network_connect_with_peer(protocol, address, port) {
|
|
990
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
991
|
+
const len0 = WASM_VECTOR_LEN;
|
|
992
|
+
const ret = wasm.wasmgame_network_connect_with_peer(this.__wbg_ptr, protocol, ptr0, len0, port);
|
|
993
|
+
if (ret[2]) {
|
|
994
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
995
|
+
}
|
|
996
|
+
return WasmNetworkConnectResult.__wrap(ret[0]);
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* Disconnects and removes a network connection.
|
|
1000
|
+
* @param {number} handle
|
|
1001
|
+
* @returns {number}
|
|
1002
|
+
*/
|
|
1003
|
+
network_disconnect(handle) {
|
|
1004
|
+
const ret = wasm.wasmgame_network_disconnect(this.__wbg_ptr, handle);
|
|
1005
|
+
return ret;
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Browser-hosting is not supported for WASM networking.
|
|
1009
|
+
* @param {number} _protocol
|
|
1010
|
+
* @param {number} _port
|
|
1011
|
+
* @returns {number}
|
|
1012
|
+
*/
|
|
1013
|
+
network_host(_protocol, _port) {
|
|
1014
|
+
const ret = wasm.wasmgame_network_host(this.__wbg_ptr, _protocol, _port);
|
|
1015
|
+
return ret;
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* Returns active peer count for the connection.
|
|
1019
|
+
* @param {number} handle
|
|
1020
|
+
* @returns {number}
|
|
1021
|
+
*/
|
|
1022
|
+
network_peer_count(handle) {
|
|
1023
|
+
const ret = wasm.wasmgame_network_peer_count(this.__wbg_ptr, handle);
|
|
1024
|
+
return ret;
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Poll is a no-op for browser sockets (event-driven), but validates the handle.
|
|
1028
|
+
* @param {number} handle
|
|
1029
|
+
* @returns {number}
|
|
1030
|
+
*/
|
|
1031
|
+
network_poll(handle) {
|
|
1032
|
+
const ret = wasm.wasmgame_network_poll(this.__wbg_ptr, handle);
|
|
1033
|
+
return ret;
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Legacy receive path returning payload bytes only.
|
|
1037
|
+
* @param {number} handle
|
|
1038
|
+
* @returns {Uint8Array}
|
|
1039
|
+
*/
|
|
1040
|
+
network_receive(handle) {
|
|
1041
|
+
const ret = wasm.wasmgame_network_receive(this.__wbg_ptr, handle);
|
|
1042
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1043
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1044
|
+
return v1;
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Receives the next queued packet with peer metadata.
|
|
1048
|
+
* @param {number} handle
|
|
1049
|
+
* @returns {WasmNetworkPacket | undefined}
|
|
1050
|
+
*/
|
|
1051
|
+
network_receive_packet(handle) {
|
|
1052
|
+
const ret = wasm.wasmgame_network_receive_packet(this.__wbg_ptr, handle);
|
|
1053
|
+
return ret === 0 ? undefined : WasmNetworkPacket.__wrap(ret);
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* Sends a binary packet on an existing connection.
|
|
1057
|
+
* @param {number} handle
|
|
1058
|
+
* @param {bigint} _peer_id
|
|
1059
|
+
* @param {Uint8Array} data
|
|
1060
|
+
* @param {number} _channel
|
|
1061
|
+
* @returns {number}
|
|
1062
|
+
*/
|
|
1063
|
+
network_send(handle, _peer_id, data, _channel) {
|
|
1064
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1065
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1066
|
+
const ret = wasm.wasmgame_network_send(this.__wbg_ptr, handle, _peer_id, ptr0, len0, _channel);
|
|
1067
|
+
return ret;
|
|
1068
|
+
}
|
|
573
1069
|
/**
|
|
574
1070
|
* Creates a new game instance without rendering (ECS-only mode).
|
|
575
1071
|
* @param {number} width
|
|
@@ -585,6 +1081,7 @@ export class WasmGame {
|
|
|
585
1081
|
return this;
|
|
586
1082
|
}
|
|
587
1083
|
/**
|
|
1084
|
+
* Returns whether point `(px, py)` is inside the circle.
|
|
588
1085
|
* @param {number} px
|
|
589
1086
|
* @param {number} py
|
|
590
1087
|
* @param {number} cx
|
|
@@ -597,6 +1094,7 @@ export class WasmGame {
|
|
|
597
1094
|
return ret !== 0;
|
|
598
1095
|
}
|
|
599
1096
|
/**
|
|
1097
|
+
* Returns whether point `(px, py)` is inside the rectangle.
|
|
600
1098
|
* @param {number} px
|
|
601
1099
|
* @param {number} py
|
|
602
1100
|
* @param {number} rx
|
|
@@ -610,17 +1108,35 @@ export class WasmGame {
|
|
|
610
1108
|
return ret !== 0;
|
|
611
1109
|
}
|
|
612
1110
|
/**
|
|
1111
|
+
* Marks a key as pressed for the current frame.
|
|
613
1112
|
* @param {number} key_code
|
|
614
1113
|
*/
|
|
615
1114
|
press_key(key_code) {
|
|
616
1115
|
wasm.wasmgame_press_key(this.__wbg_ptr, key_code);
|
|
617
1116
|
}
|
|
618
1117
|
/**
|
|
1118
|
+
* Marks a mouse button as pressed for the current frame.
|
|
619
1119
|
* @param {number} button
|
|
620
1120
|
*/
|
|
621
1121
|
press_mouse_button(button) {
|
|
622
1122
|
wasm.wasmgame_press_mouse_button(this.__wbg_ptr, button);
|
|
623
1123
|
}
|
|
1124
|
+
/**
|
|
1125
|
+
* Registers a font from raw bytes.
|
|
1126
|
+
*
|
|
1127
|
+
* Returns a 1-based handle suitable for `draw_text`.
|
|
1128
|
+
* @param {Uint8Array} data
|
|
1129
|
+
* @returns {number}
|
|
1130
|
+
*/
|
|
1131
|
+
register_font_from_bytes(data) {
|
|
1132
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1133
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1134
|
+
const ret = wasm.wasmgame_register_font_from_bytes(this.__wbg_ptr, ptr0, len0);
|
|
1135
|
+
if (ret[2]) {
|
|
1136
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1137
|
+
}
|
|
1138
|
+
return ret[0] >>> 0;
|
|
1139
|
+
}
|
|
624
1140
|
/**
|
|
625
1141
|
* Registers a texture from raw image bytes (PNG, JPG, etc.).
|
|
626
1142
|
*
|
|
@@ -641,18 +1157,21 @@ export class WasmGame {
|
|
|
641
1157
|
return ret[0] >>> 0;
|
|
642
1158
|
}
|
|
643
1159
|
/**
|
|
1160
|
+
* Marks a key as released for the current frame.
|
|
644
1161
|
* @param {number} key_code
|
|
645
1162
|
*/
|
|
646
1163
|
release_key(key_code) {
|
|
647
1164
|
wasm.wasmgame_release_key(this.__wbg_ptr, key_code);
|
|
648
1165
|
}
|
|
649
1166
|
/**
|
|
1167
|
+
* Marks a mouse button as released for the current frame.
|
|
650
1168
|
* @param {number} button
|
|
651
1169
|
*/
|
|
652
1170
|
release_mouse_button(button) {
|
|
653
1171
|
wasm.wasmgame_release_mouse_button(this.__wbg_ptr, button);
|
|
654
1172
|
}
|
|
655
1173
|
/**
|
|
1174
|
+
* Removes `Name` from the entity.
|
|
656
1175
|
* @param {bigint} entity_bits
|
|
657
1176
|
* @returns {boolean}
|
|
658
1177
|
*/
|
|
@@ -661,6 +1180,7 @@ export class WasmGame {
|
|
|
661
1180
|
return ret !== 0;
|
|
662
1181
|
}
|
|
663
1182
|
/**
|
|
1183
|
+
* Removes `Sprite` from the entity.
|
|
664
1184
|
* @param {bigint} entity_bits
|
|
665
1185
|
* @returns {boolean}
|
|
666
1186
|
*/
|
|
@@ -669,6 +1189,7 @@ export class WasmGame {
|
|
|
669
1189
|
return ret !== 0;
|
|
670
1190
|
}
|
|
671
1191
|
/**
|
|
1192
|
+
* Removes `Transform2D` from the entity.
|
|
672
1193
|
* @param {bigint} entity_bits
|
|
673
1194
|
* @returns {boolean}
|
|
674
1195
|
*/
|
|
@@ -677,6 +1198,7 @@ export class WasmGame {
|
|
|
677
1198
|
return ret !== 0;
|
|
678
1199
|
}
|
|
679
1200
|
/**
|
|
1201
|
+
* Returns accumulated horizontal scroll delta.
|
|
680
1202
|
* @returns {number}
|
|
681
1203
|
*/
|
|
682
1204
|
scroll_dx() {
|
|
@@ -684,6 +1206,7 @@ export class WasmGame {
|
|
|
684
1206
|
return ret;
|
|
685
1207
|
}
|
|
686
1208
|
/**
|
|
1209
|
+
* Returns accumulated vertical scroll delta.
|
|
687
1210
|
* @returns {number}
|
|
688
1211
|
*/
|
|
689
1212
|
scroll_dy() {
|
|
@@ -711,6 +1234,7 @@ export class WasmGame {
|
|
|
711
1234
|
wasm.wasmgame_set_clear_color(this.__wbg_ptr, r, g, b, a);
|
|
712
1235
|
}
|
|
713
1236
|
/**
|
|
1237
|
+
* Updates the current mouse position in logical coordinates.
|
|
714
1238
|
* @param {number} x
|
|
715
1239
|
* @param {number} y
|
|
716
1240
|
*/
|
|
@@ -718,6 +1242,28 @@ export class WasmGame {
|
|
|
718
1242
|
wasm.wasmgame_set_mouse_position(this.__wbg_ptr, x, y);
|
|
719
1243
|
}
|
|
720
1244
|
/**
|
|
1245
|
+
* Overlay handle selection is unsupported in browser networking mode.
|
|
1246
|
+
* @param {number} _handle
|
|
1247
|
+
* @returns {number}
|
|
1248
|
+
*/
|
|
1249
|
+
set_network_overlay_handle(_handle) {
|
|
1250
|
+
const ret = wasm.wasmgame_set_network_overlay_handle(this.__wbg_ptr, _handle);
|
|
1251
|
+
return ret;
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Network simulation controls are unsupported in browser networking mode.
|
|
1255
|
+
* @param {number} _handle
|
|
1256
|
+
* @param {number} _one_way_latency_ms
|
|
1257
|
+
* @param {number} _jitter_ms
|
|
1258
|
+
* @param {number} _packet_loss_percent
|
|
1259
|
+
* @returns {number}
|
|
1260
|
+
*/
|
|
1261
|
+
set_network_simulation(_handle, _one_way_latency_ms, _jitter_ms, _packet_loss_percent) {
|
|
1262
|
+
const ret = wasm.wasmgame_set_network_simulation(this.__wbg_ptr, _handle, _one_way_latency_ms, _jitter_ms, _packet_loss_percent);
|
|
1263
|
+
return ret;
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Updates an existing `Sprite` if present.
|
|
721
1267
|
* @param {bigint} entity_bits
|
|
722
1268
|
* @param {number} texture_handle
|
|
723
1269
|
* @param {number} r
|
|
@@ -733,6 +1279,7 @@ export class WasmGame {
|
|
|
733
1279
|
wasm.wasmgame_set_sprite(this.__wbg_ptr, entity_bits, texture_handle, r, g, b, a, flip_x, flip_y, anchor_x, anchor_y);
|
|
734
1280
|
}
|
|
735
1281
|
/**
|
|
1282
|
+
* Updates an existing `Transform2D` if present.
|
|
736
1283
|
* @param {bigint} entity_bits
|
|
737
1284
|
* @param {number} px
|
|
738
1285
|
* @param {number} py
|
|
@@ -744,6 +1291,7 @@ export class WasmGame {
|
|
|
744
1291
|
wasm.wasmgame_set_transform2d(this.__wbg_ptr, entity_bits, px, py, rotation, sx, sy);
|
|
745
1292
|
}
|
|
746
1293
|
/**
|
|
1294
|
+
* Spawns `count` empty entities and returns their packed entity bits.
|
|
747
1295
|
* @param {number} count
|
|
748
1296
|
* @returns {BigUint64Array}
|
|
749
1297
|
*/
|
|
@@ -754,6 +1302,7 @@ export class WasmGame {
|
|
|
754
1302
|
return v1;
|
|
755
1303
|
}
|
|
756
1304
|
/**
|
|
1305
|
+
* Spawns a single empty entity and returns its packed entity bits.
|
|
757
1306
|
* @returns {bigint}
|
|
758
1307
|
*/
|
|
759
1308
|
spawn_empty() {
|
|
@@ -793,15 +1342,323 @@ export class WasmGame {
|
|
|
793
1342
|
return ret >>> 0;
|
|
794
1343
|
}
|
|
795
1344
|
/**
|
|
796
|
-
* Logical canvas width in pixels.
|
|
797
|
-
* @returns {number}
|
|
1345
|
+
* Logical canvas width in pixels.
|
|
1346
|
+
* @returns {number}
|
|
1347
|
+
*/
|
|
1348
|
+
get window_width() {
|
|
1349
|
+
const ret = wasm.wasmgame_window_width(this.__wbg_ptr);
|
|
1350
|
+
return ret >>> 0;
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
if (Symbol.dispose) WasmGame.prototype[Symbol.dispose] = WasmGame.prototype.free;
|
|
1354
|
+
|
|
1355
|
+
export class WasmNetworkCapabilities {
|
|
1356
|
+
static __wrap(ptr) {
|
|
1357
|
+
ptr = ptr >>> 0;
|
|
1358
|
+
const obj = Object.create(WasmNetworkCapabilities.prototype);
|
|
1359
|
+
obj.__wbg_ptr = ptr;
|
|
1360
|
+
WasmNetworkCapabilitiesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1361
|
+
return obj;
|
|
1362
|
+
}
|
|
1363
|
+
__destroy_into_raw() {
|
|
1364
|
+
const ptr = this.__wbg_ptr;
|
|
1365
|
+
this.__wbg_ptr = 0;
|
|
1366
|
+
WasmNetworkCapabilitiesFinalization.unregister(this);
|
|
1367
|
+
return ptr;
|
|
1368
|
+
}
|
|
1369
|
+
free() {
|
|
1370
|
+
const ptr = this.__destroy_into_raw();
|
|
1371
|
+
wasm.__wbg_wasmnetworkcapabilities_free(ptr, 0);
|
|
1372
|
+
}
|
|
1373
|
+
/**
|
|
1374
|
+
* @returns {number}
|
|
1375
|
+
*/
|
|
1376
|
+
get max_channels() {
|
|
1377
|
+
const ret = wasm.__wbg_get_wasmnetworkcapabilities_max_channels(this.__wbg_ptr);
|
|
1378
|
+
return ret;
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* @returns {number}
|
|
1382
|
+
*/
|
|
1383
|
+
get max_connections() {
|
|
1384
|
+
const ret = wasm.__wbg_get_wasmnetworkcapabilities_max_connections(this.__wbg_ptr);
|
|
1385
|
+
return ret >>> 0;
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* @returns {number}
|
|
1389
|
+
*/
|
|
1390
|
+
get max_message_size() {
|
|
1391
|
+
const ret = wasm.__wbg_get_wasmnetworkcapabilities_max_message_size(this.__wbg_ptr);
|
|
1392
|
+
return ret >>> 0;
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* @returns {boolean}
|
|
1396
|
+
*/
|
|
1397
|
+
get supports_hosting() {
|
|
1398
|
+
const ret = wasm.__wbg_get_wasmnetworkcapabilities_supports_hosting(this.__wbg_ptr);
|
|
1399
|
+
return ret !== 0;
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* @param {number} arg0
|
|
1403
|
+
*/
|
|
1404
|
+
set max_channels(arg0) {
|
|
1405
|
+
wasm.__wbg_set_wasmnetworkcapabilities_max_channels(this.__wbg_ptr, arg0);
|
|
1406
|
+
}
|
|
1407
|
+
/**
|
|
1408
|
+
* @param {number} arg0
|
|
1409
|
+
*/
|
|
1410
|
+
set max_connections(arg0) {
|
|
1411
|
+
wasm.__wbg_set_wasmnetworkcapabilities_max_connections(this.__wbg_ptr, arg0);
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* @param {number} arg0
|
|
1415
|
+
*/
|
|
1416
|
+
set max_message_size(arg0) {
|
|
1417
|
+
wasm.__wbg_set_wasmnetworkcapabilities_max_message_size(this.__wbg_ptr, arg0);
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* @param {boolean} arg0
|
|
1421
|
+
*/
|
|
1422
|
+
set supports_hosting(arg0) {
|
|
1423
|
+
wasm.__wbg_set_wasmnetworkcapabilities_supports_hosting(this.__wbg_ptr, arg0);
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
if (Symbol.dispose) WasmNetworkCapabilities.prototype[Symbol.dispose] = WasmNetworkCapabilities.prototype.free;
|
|
1427
|
+
|
|
1428
|
+
export class WasmNetworkConnectResult {
|
|
1429
|
+
static __wrap(ptr) {
|
|
1430
|
+
ptr = ptr >>> 0;
|
|
1431
|
+
const obj = Object.create(WasmNetworkConnectResult.prototype);
|
|
1432
|
+
obj.__wbg_ptr = ptr;
|
|
1433
|
+
WasmNetworkConnectResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1434
|
+
return obj;
|
|
1435
|
+
}
|
|
1436
|
+
__destroy_into_raw() {
|
|
1437
|
+
const ptr = this.__wbg_ptr;
|
|
1438
|
+
this.__wbg_ptr = 0;
|
|
1439
|
+
WasmNetworkConnectResultFinalization.unregister(this);
|
|
1440
|
+
return ptr;
|
|
1441
|
+
}
|
|
1442
|
+
free() {
|
|
1443
|
+
const ptr = this.__destroy_into_raw();
|
|
1444
|
+
wasm.__wbg_wasmnetworkconnectresult_free(ptr, 0);
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* @returns {number}
|
|
1448
|
+
*/
|
|
1449
|
+
get handle() {
|
|
1450
|
+
const ret = wasm.__wbg_get_wasmnetworkconnectresult_handle(this.__wbg_ptr);
|
|
1451
|
+
return ret;
|
|
1452
|
+
}
|
|
1453
|
+
/**
|
|
1454
|
+
* @returns {bigint}
|
|
1455
|
+
*/
|
|
1456
|
+
get peer_id() {
|
|
1457
|
+
const ret = wasm.__wbg_get_wasmnetworkconnectresult_peer_id(this.__wbg_ptr);
|
|
1458
|
+
return BigInt.asUintN(64, ret);
|
|
1459
|
+
}
|
|
1460
|
+
/**
|
|
1461
|
+
* @param {number} arg0
|
|
1462
|
+
*/
|
|
1463
|
+
set handle(arg0) {
|
|
1464
|
+
wasm.__wbg_set_wasmnetworkconnectresult_handle(this.__wbg_ptr, arg0);
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* @param {bigint} arg0
|
|
1468
|
+
*/
|
|
1469
|
+
set peer_id(arg0) {
|
|
1470
|
+
wasm.__wbg_set_wasmnetworkconnectresult_peer_id(this.__wbg_ptr, arg0);
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
if (Symbol.dispose) WasmNetworkConnectResult.prototype[Symbol.dispose] = WasmNetworkConnectResult.prototype.free;
|
|
1474
|
+
|
|
1475
|
+
export class WasmNetworkPacket {
|
|
1476
|
+
static __wrap(ptr) {
|
|
1477
|
+
ptr = ptr >>> 0;
|
|
1478
|
+
const obj = Object.create(WasmNetworkPacket.prototype);
|
|
1479
|
+
obj.__wbg_ptr = ptr;
|
|
1480
|
+
WasmNetworkPacketFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1481
|
+
return obj;
|
|
1482
|
+
}
|
|
1483
|
+
__destroy_into_raw() {
|
|
1484
|
+
const ptr = this.__wbg_ptr;
|
|
1485
|
+
this.__wbg_ptr = 0;
|
|
1486
|
+
WasmNetworkPacketFinalization.unregister(this);
|
|
1487
|
+
return ptr;
|
|
1488
|
+
}
|
|
1489
|
+
free() {
|
|
1490
|
+
const ptr = this.__destroy_into_raw();
|
|
1491
|
+
wasm.__wbg_wasmnetworkpacket_free(ptr, 0);
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1494
|
+
* @returns {Uint8Array}
|
|
1495
|
+
*/
|
|
1496
|
+
get data() {
|
|
1497
|
+
const ret = wasm.wasmnetworkpacket_data(this.__wbg_ptr);
|
|
1498
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1499
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1500
|
+
return v1;
|
|
1501
|
+
}
|
|
1502
|
+
/**
|
|
1503
|
+
* @returns {bigint}
|
|
1504
|
+
*/
|
|
1505
|
+
get peer_id() {
|
|
1506
|
+
const ret = wasm.wasmnetworkpacket_peer_id(this.__wbg_ptr);
|
|
1507
|
+
return BigInt.asUintN(64, ret);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
if (Symbol.dispose) WasmNetworkPacket.prototype[Symbol.dispose] = WasmNetworkPacket.prototype.free;
|
|
1511
|
+
|
|
1512
|
+
export class WasmNetworkStats {
|
|
1513
|
+
static __wrap(ptr) {
|
|
1514
|
+
ptr = ptr >>> 0;
|
|
1515
|
+
const obj = Object.create(WasmNetworkStats.prototype);
|
|
1516
|
+
obj.__wbg_ptr = ptr;
|
|
1517
|
+
WasmNetworkStatsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1518
|
+
return obj;
|
|
1519
|
+
}
|
|
1520
|
+
__destroy_into_raw() {
|
|
1521
|
+
const ptr = this.__wbg_ptr;
|
|
1522
|
+
this.__wbg_ptr = 0;
|
|
1523
|
+
WasmNetworkStatsFinalization.unregister(this);
|
|
1524
|
+
return ptr;
|
|
1525
|
+
}
|
|
1526
|
+
free() {
|
|
1527
|
+
const ptr = this.__destroy_into_raw();
|
|
1528
|
+
wasm.__wbg_wasmnetworkstats_free(ptr, 0);
|
|
1529
|
+
}
|
|
1530
|
+
/**
|
|
1531
|
+
* @returns {bigint}
|
|
1532
|
+
*/
|
|
1533
|
+
get bytes_received() {
|
|
1534
|
+
const ret = wasm.__wbg_get_wasmnetworkstats_bytes_received(this.__wbg_ptr);
|
|
1535
|
+
return BigInt.asUintN(64, ret);
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* @returns {bigint}
|
|
1539
|
+
*/
|
|
1540
|
+
get bytes_sent() {
|
|
1541
|
+
const ret = wasm.__wbg_get_wasmnetworkstats_bytes_sent(this.__wbg_ptr);
|
|
1542
|
+
return BigInt.asUintN(64, ret);
|
|
1543
|
+
}
|
|
1544
|
+
/**
|
|
1545
|
+
* @returns {number}
|
|
1546
|
+
*/
|
|
1547
|
+
get jitter_ms() {
|
|
1548
|
+
const ret = wasm.__wbg_get_wasmnetworkstats_jitter_ms(this.__wbg_ptr);
|
|
1549
|
+
return ret;
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* @returns {number}
|
|
1553
|
+
*/
|
|
1554
|
+
get packet_loss_percent() {
|
|
1555
|
+
const ret = wasm.__wbg_get_wasmnetworkstats_packet_loss_percent(this.__wbg_ptr);
|
|
1556
|
+
return ret;
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
* @returns {bigint}
|
|
1560
|
+
*/
|
|
1561
|
+
get packets_lost() {
|
|
1562
|
+
const ret = wasm.__wbg_get_wasmnetworkstats_packets_lost(this.__wbg_ptr);
|
|
1563
|
+
return BigInt.asUintN(64, ret);
|
|
1564
|
+
}
|
|
1565
|
+
/**
|
|
1566
|
+
* @returns {bigint}
|
|
1567
|
+
*/
|
|
1568
|
+
get packets_received() {
|
|
1569
|
+
const ret = wasm.__wbg_get_wasmnetworkstats_packets_received(this.__wbg_ptr);
|
|
1570
|
+
return BigInt.asUintN(64, ret);
|
|
1571
|
+
}
|
|
1572
|
+
/**
|
|
1573
|
+
* @returns {bigint}
|
|
1574
|
+
*/
|
|
1575
|
+
get packets_sent() {
|
|
1576
|
+
const ret = wasm.__wbg_get_wasmnetworkstats_packets_sent(this.__wbg_ptr);
|
|
1577
|
+
return BigInt.asUintN(64, ret);
|
|
1578
|
+
}
|
|
1579
|
+
/**
|
|
1580
|
+
* @returns {number}
|
|
1581
|
+
*/
|
|
1582
|
+
get receive_bandwidth_bytes_per_sec() {
|
|
1583
|
+
const ret = wasm.__wbg_get_wasmnetworkstats_receive_bandwidth_bytes_per_sec(this.__wbg_ptr);
|
|
1584
|
+
return ret;
|
|
1585
|
+
}
|
|
1586
|
+
/**
|
|
1587
|
+
* @returns {number}
|
|
1588
|
+
*/
|
|
1589
|
+
get rtt_ms() {
|
|
1590
|
+
const ret = wasm.__wbg_get_wasmnetworkstats_rtt_ms(this.__wbg_ptr);
|
|
1591
|
+
return ret;
|
|
1592
|
+
}
|
|
1593
|
+
/**
|
|
1594
|
+
* @returns {number}
|
|
1595
|
+
*/
|
|
1596
|
+
get send_bandwidth_bytes_per_sec() {
|
|
1597
|
+
const ret = wasm.__wbg_get_wasmnetworkstats_send_bandwidth_bytes_per_sec(this.__wbg_ptr);
|
|
1598
|
+
return ret;
|
|
1599
|
+
}
|
|
1600
|
+
/**
|
|
1601
|
+
* @param {bigint} arg0
|
|
1602
|
+
*/
|
|
1603
|
+
set bytes_received(arg0) {
|
|
1604
|
+
wasm.__wbg_set_wasmnetworkstats_bytes_received(this.__wbg_ptr, arg0);
|
|
1605
|
+
}
|
|
1606
|
+
/**
|
|
1607
|
+
* @param {bigint} arg0
|
|
1608
|
+
*/
|
|
1609
|
+
set bytes_sent(arg0) {
|
|
1610
|
+
wasm.__wbg_set_wasmnetworkstats_bytes_sent(this.__wbg_ptr, arg0);
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* @param {number} arg0
|
|
1614
|
+
*/
|
|
1615
|
+
set jitter_ms(arg0) {
|
|
1616
|
+
wasm.__wbg_set_wasmnetworkstats_jitter_ms(this.__wbg_ptr, arg0);
|
|
1617
|
+
}
|
|
1618
|
+
/**
|
|
1619
|
+
* @param {number} arg0
|
|
1620
|
+
*/
|
|
1621
|
+
set packet_loss_percent(arg0) {
|
|
1622
|
+
wasm.__wbg_set_wasmnetworkstats_packet_loss_percent(this.__wbg_ptr, arg0);
|
|
1623
|
+
}
|
|
1624
|
+
/**
|
|
1625
|
+
* @param {bigint} arg0
|
|
1626
|
+
*/
|
|
1627
|
+
set packets_lost(arg0) {
|
|
1628
|
+
wasm.__wbg_set_wasmnetworkstats_packets_lost(this.__wbg_ptr, arg0);
|
|
1629
|
+
}
|
|
1630
|
+
/**
|
|
1631
|
+
* @param {bigint} arg0
|
|
1632
|
+
*/
|
|
1633
|
+
set packets_received(arg0) {
|
|
1634
|
+
wasm.__wbg_set_wasmnetworkstats_packets_received(this.__wbg_ptr, arg0);
|
|
1635
|
+
}
|
|
1636
|
+
/**
|
|
1637
|
+
* @param {bigint} arg0
|
|
1638
|
+
*/
|
|
1639
|
+
set packets_sent(arg0) {
|
|
1640
|
+
wasm.__wbg_set_wasmnetworkstats_packets_sent(this.__wbg_ptr, arg0);
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* @param {number} arg0
|
|
1644
|
+
*/
|
|
1645
|
+
set receive_bandwidth_bytes_per_sec(arg0) {
|
|
1646
|
+
wasm.__wbg_set_wasmnetworkstats_receive_bandwidth_bytes_per_sec(this.__wbg_ptr, arg0);
|
|
1647
|
+
}
|
|
1648
|
+
/**
|
|
1649
|
+
* @param {number} arg0
|
|
1650
|
+
*/
|
|
1651
|
+
set rtt_ms(arg0) {
|
|
1652
|
+
wasm.__wbg_set_wasmnetworkstats_rtt_ms(this.__wbg_ptr, arg0);
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1655
|
+
* @param {number} arg0
|
|
798
1656
|
*/
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
return ret >>> 0;
|
|
1657
|
+
set send_bandwidth_bytes_per_sec(arg0) {
|
|
1658
|
+
wasm.__wbg_set_wasmnetworkstats_send_bandwidth_bytes_per_sec(this.__wbg_ptr, arg0);
|
|
802
1659
|
}
|
|
803
1660
|
}
|
|
804
|
-
if (Symbol.dispose)
|
|
1661
|
+
if (Symbol.dispose) WasmNetworkStats.prototype[Symbol.dispose] = WasmNetworkStats.prototype.free;
|
|
805
1662
|
|
|
806
1663
|
/**
|
|
807
1664
|
* Per-frame rendering statistics exposed to JavaScript.
|
|
@@ -825,6 +1682,7 @@ export class WasmRenderStats {
|
|
|
825
1682
|
wasm.__wbg_wasmrenderstats_free(ptr, 0);
|
|
826
1683
|
}
|
|
827
1684
|
/**
|
|
1685
|
+
* Number of draw calls submitted this frame.
|
|
828
1686
|
* @returns {number}
|
|
829
1687
|
*/
|
|
830
1688
|
get draw_calls() {
|
|
@@ -832,6 +1690,7 @@ export class WasmRenderStats {
|
|
|
832
1690
|
return ret >>> 0;
|
|
833
1691
|
}
|
|
834
1692
|
/**
|
|
1693
|
+
* Number of texture bind switches this frame.
|
|
835
1694
|
* @returns {number}
|
|
836
1695
|
*/
|
|
837
1696
|
get texture_binds() {
|
|
@@ -839,6 +1698,7 @@ export class WasmRenderStats {
|
|
|
839
1698
|
return ret >>> 0;
|
|
840
1699
|
}
|
|
841
1700
|
/**
|
|
1701
|
+
* Number of triangles submitted this frame.
|
|
842
1702
|
* @returns {number}
|
|
843
1703
|
*/
|
|
844
1704
|
get triangles() {
|
|
@@ -846,18 +1706,21 @@ export class WasmRenderStats {
|
|
|
846
1706
|
return ret >>> 0;
|
|
847
1707
|
}
|
|
848
1708
|
/**
|
|
1709
|
+
* Number of draw calls submitted this frame.
|
|
849
1710
|
* @param {number} arg0
|
|
850
1711
|
*/
|
|
851
1712
|
set draw_calls(arg0) {
|
|
852
1713
|
wasm.__wbg_set_wasmrenderstats_draw_calls(this.__wbg_ptr, arg0);
|
|
853
1714
|
}
|
|
854
1715
|
/**
|
|
1716
|
+
* Number of texture bind switches this frame.
|
|
855
1717
|
* @param {number} arg0
|
|
856
1718
|
*/
|
|
857
1719
|
set texture_binds(arg0) {
|
|
858
1720
|
wasm.__wbg_set_wasmrenderstats_texture_binds(this.__wbg_ptr, arg0);
|
|
859
1721
|
}
|
|
860
1722
|
/**
|
|
1723
|
+
* Number of triangles submitted this frame.
|
|
861
1724
|
* @param {number} arg0
|
|
862
1725
|
*/
|
|
863
1726
|
set triangles(arg0) {
|
|
@@ -889,6 +1752,7 @@ export class WasmSprite {
|
|
|
889
1752
|
wasm.__wbg_wasmsprite_free(ptr, 0);
|
|
890
1753
|
}
|
|
891
1754
|
/**
|
|
1755
|
+
* Alpha channel tint.
|
|
892
1756
|
* @returns {number}
|
|
893
1757
|
*/
|
|
894
1758
|
get a() {
|
|
@@ -896,6 +1760,7 @@ export class WasmSprite {
|
|
|
896
1760
|
return ret;
|
|
897
1761
|
}
|
|
898
1762
|
/**
|
|
1763
|
+
* X anchor in normalized sprite space.
|
|
899
1764
|
* @returns {number}
|
|
900
1765
|
*/
|
|
901
1766
|
get anchor_x() {
|
|
@@ -903,6 +1768,7 @@ export class WasmSprite {
|
|
|
903
1768
|
return ret;
|
|
904
1769
|
}
|
|
905
1770
|
/**
|
|
1771
|
+
* Y anchor in normalized sprite space.
|
|
906
1772
|
* @returns {number}
|
|
907
1773
|
*/
|
|
908
1774
|
get anchor_y() {
|
|
@@ -910,6 +1776,7 @@ export class WasmSprite {
|
|
|
910
1776
|
return ret;
|
|
911
1777
|
}
|
|
912
1778
|
/**
|
|
1779
|
+
* Blue channel tint.
|
|
913
1780
|
* @returns {number}
|
|
914
1781
|
*/
|
|
915
1782
|
get b() {
|
|
@@ -917,6 +1784,7 @@ export class WasmSprite {
|
|
|
917
1784
|
return ret;
|
|
918
1785
|
}
|
|
919
1786
|
/**
|
|
1787
|
+
* Horizontal texture flip flag.
|
|
920
1788
|
* @returns {boolean}
|
|
921
1789
|
*/
|
|
922
1790
|
get flip_x() {
|
|
@@ -924,6 +1792,7 @@ export class WasmSprite {
|
|
|
924
1792
|
return ret !== 0;
|
|
925
1793
|
}
|
|
926
1794
|
/**
|
|
1795
|
+
* Vertical texture flip flag.
|
|
927
1796
|
* @returns {boolean}
|
|
928
1797
|
*/
|
|
929
1798
|
get flip_y() {
|
|
@@ -931,6 +1800,7 @@ export class WasmSprite {
|
|
|
931
1800
|
return ret !== 0;
|
|
932
1801
|
}
|
|
933
1802
|
/**
|
|
1803
|
+
* Green channel tint.
|
|
934
1804
|
* @returns {number}
|
|
935
1805
|
*/
|
|
936
1806
|
get g() {
|
|
@@ -938,6 +1808,7 @@ export class WasmSprite {
|
|
|
938
1808
|
return ret;
|
|
939
1809
|
}
|
|
940
1810
|
/**
|
|
1811
|
+
* Red channel tint.
|
|
941
1812
|
* @returns {number}
|
|
942
1813
|
*/
|
|
943
1814
|
get r() {
|
|
@@ -945,6 +1816,7 @@ export class WasmSprite {
|
|
|
945
1816
|
return ret;
|
|
946
1817
|
}
|
|
947
1818
|
/**
|
|
1819
|
+
* Texture handle backing this sprite.
|
|
948
1820
|
* @returns {number}
|
|
949
1821
|
*/
|
|
950
1822
|
get texture_handle() {
|
|
@@ -952,54 +1824,63 @@ export class WasmSprite {
|
|
|
952
1824
|
return ret >>> 0;
|
|
953
1825
|
}
|
|
954
1826
|
/**
|
|
1827
|
+
* Alpha channel tint.
|
|
955
1828
|
* @param {number} arg0
|
|
956
1829
|
*/
|
|
957
1830
|
set a(arg0) {
|
|
958
1831
|
wasm.__wbg_set_wasmsprite_a(this.__wbg_ptr, arg0);
|
|
959
1832
|
}
|
|
960
1833
|
/**
|
|
1834
|
+
* X anchor in normalized sprite space.
|
|
961
1835
|
* @param {number} arg0
|
|
962
1836
|
*/
|
|
963
1837
|
set anchor_x(arg0) {
|
|
964
1838
|
wasm.__wbg_set_wasmsprite_anchor_x(this.__wbg_ptr, arg0);
|
|
965
1839
|
}
|
|
966
1840
|
/**
|
|
1841
|
+
* Y anchor in normalized sprite space.
|
|
967
1842
|
* @param {number} arg0
|
|
968
1843
|
*/
|
|
969
1844
|
set anchor_y(arg0) {
|
|
970
1845
|
wasm.__wbg_set_wasmsprite_anchor_y(this.__wbg_ptr, arg0);
|
|
971
1846
|
}
|
|
972
1847
|
/**
|
|
1848
|
+
* Blue channel tint.
|
|
973
1849
|
* @param {number} arg0
|
|
974
1850
|
*/
|
|
975
1851
|
set b(arg0) {
|
|
976
1852
|
wasm.__wbg_set_wasmsprite_b(this.__wbg_ptr, arg0);
|
|
977
1853
|
}
|
|
978
1854
|
/**
|
|
1855
|
+
* Horizontal texture flip flag.
|
|
979
1856
|
* @param {boolean} arg0
|
|
980
1857
|
*/
|
|
981
1858
|
set flip_x(arg0) {
|
|
982
1859
|
wasm.__wbg_set_wasmsprite_flip_x(this.__wbg_ptr, arg0);
|
|
983
1860
|
}
|
|
984
1861
|
/**
|
|
1862
|
+
* Vertical texture flip flag.
|
|
985
1863
|
* @param {boolean} arg0
|
|
986
1864
|
*/
|
|
987
1865
|
set flip_y(arg0) {
|
|
988
1866
|
wasm.__wbg_set_wasmsprite_flip_y(this.__wbg_ptr, arg0);
|
|
989
1867
|
}
|
|
990
1868
|
/**
|
|
1869
|
+
* Green channel tint.
|
|
991
1870
|
* @param {number} arg0
|
|
992
1871
|
*/
|
|
993
1872
|
set g(arg0) {
|
|
994
1873
|
wasm.__wbg_set_wasmsprite_g(this.__wbg_ptr, arg0);
|
|
995
1874
|
}
|
|
996
1875
|
/**
|
|
1876
|
+
* Red channel tint.
|
|
997
1877
|
* @param {number} arg0
|
|
998
1878
|
*/
|
|
999
1879
|
set r(arg0) {
|
|
1000
1880
|
wasm.__wbg_set_wasmsprite_r(this.__wbg_ptr, arg0);
|
|
1001
1881
|
}
|
|
1002
1882
|
/**
|
|
1883
|
+
* Texture handle backing this sprite.
|
|
1003
1884
|
* @param {number} arg0
|
|
1004
1885
|
*/
|
|
1005
1886
|
set texture_handle(arg0) {
|
|
@@ -1031,6 +1912,7 @@ export class WasmTransform2D {
|
|
|
1031
1912
|
wasm.__wbg_wasmtransform2d_free(ptr, 0);
|
|
1032
1913
|
}
|
|
1033
1914
|
/**
|
|
1915
|
+
* X position.
|
|
1034
1916
|
* @returns {number}
|
|
1035
1917
|
*/
|
|
1036
1918
|
get position_x() {
|
|
@@ -1038,6 +1920,7 @@ export class WasmTransform2D {
|
|
|
1038
1920
|
return ret;
|
|
1039
1921
|
}
|
|
1040
1922
|
/**
|
|
1923
|
+
* Y position.
|
|
1041
1924
|
* @returns {number}
|
|
1042
1925
|
*/
|
|
1043
1926
|
get position_y() {
|
|
@@ -1045,6 +1928,7 @@ export class WasmTransform2D {
|
|
|
1045
1928
|
return ret;
|
|
1046
1929
|
}
|
|
1047
1930
|
/**
|
|
1931
|
+
* Rotation in radians.
|
|
1048
1932
|
* @returns {number}
|
|
1049
1933
|
*/
|
|
1050
1934
|
get rotation() {
|
|
@@ -1052,6 +1936,7 @@ export class WasmTransform2D {
|
|
|
1052
1936
|
return ret;
|
|
1053
1937
|
}
|
|
1054
1938
|
/**
|
|
1939
|
+
* X scale.
|
|
1055
1940
|
* @returns {number}
|
|
1056
1941
|
*/
|
|
1057
1942
|
get scale_x() {
|
|
@@ -1059,6 +1944,7 @@ export class WasmTransform2D {
|
|
|
1059
1944
|
return ret;
|
|
1060
1945
|
}
|
|
1061
1946
|
/**
|
|
1947
|
+
* Y scale.
|
|
1062
1948
|
* @returns {number}
|
|
1063
1949
|
*/
|
|
1064
1950
|
get scale_y() {
|
|
@@ -1066,30 +1952,35 @@ export class WasmTransform2D {
|
|
|
1066
1952
|
return ret;
|
|
1067
1953
|
}
|
|
1068
1954
|
/**
|
|
1955
|
+
* X position.
|
|
1069
1956
|
* @param {number} arg0
|
|
1070
1957
|
*/
|
|
1071
1958
|
set position_x(arg0) {
|
|
1072
1959
|
wasm.__wbg_set_wasmtransform2d_position_x(this.__wbg_ptr, arg0);
|
|
1073
1960
|
}
|
|
1074
1961
|
/**
|
|
1962
|
+
* Y position.
|
|
1075
1963
|
* @param {number} arg0
|
|
1076
1964
|
*/
|
|
1077
1965
|
set position_y(arg0) {
|
|
1078
1966
|
wasm.__wbg_set_wasmtransform2d_position_y(this.__wbg_ptr, arg0);
|
|
1079
1967
|
}
|
|
1080
1968
|
/**
|
|
1969
|
+
* Rotation in radians.
|
|
1081
1970
|
* @param {number} arg0
|
|
1082
1971
|
*/
|
|
1083
1972
|
set rotation(arg0) {
|
|
1084
1973
|
wasm.__wbg_set_wasmtransform2d_rotation(this.__wbg_ptr, arg0);
|
|
1085
1974
|
}
|
|
1086
1975
|
/**
|
|
1976
|
+
* X scale.
|
|
1087
1977
|
* @param {number} arg0
|
|
1088
1978
|
*/
|
|
1089
1979
|
set scale_x(arg0) {
|
|
1090
1980
|
wasm.__wbg_set_wasmtransform2d_scale_x(this.__wbg_ptr, arg0);
|
|
1091
1981
|
}
|
|
1092
1982
|
/**
|
|
1983
|
+
* Y scale.
|
|
1093
1984
|
* @param {number} arg0
|
|
1094
1985
|
*/
|
|
1095
1986
|
set scale_y(arg0) {
|
|
@@ -1098,6 +1989,299 @@ export class WasmTransform2D {
|
|
|
1098
1989
|
}
|
|
1099
1990
|
if (Symbol.dispose) WasmTransform2D.prototype[Symbol.dispose] = WasmTransform2D.prototype.free;
|
|
1100
1991
|
|
|
1992
|
+
/**
|
|
1993
|
+
* Serializable UI event record exposed to JavaScript.
|
|
1994
|
+
*/
|
|
1995
|
+
export class WasmUiEvent {
|
|
1996
|
+
static __wrap(ptr) {
|
|
1997
|
+
ptr = ptr >>> 0;
|
|
1998
|
+
const obj = Object.create(WasmUiEvent.prototype);
|
|
1999
|
+
obj.__wbg_ptr = ptr;
|
|
2000
|
+
WasmUiEventFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2001
|
+
return obj;
|
|
2002
|
+
}
|
|
2003
|
+
__destroy_into_raw() {
|
|
2004
|
+
const ptr = this.__wbg_ptr;
|
|
2005
|
+
this.__wbg_ptr = 0;
|
|
2006
|
+
WasmUiEventFinalization.unregister(this);
|
|
2007
|
+
return ptr;
|
|
2008
|
+
}
|
|
2009
|
+
free() {
|
|
2010
|
+
const ptr = this.__destroy_into_raw();
|
|
2011
|
+
wasm.__wbg_wasmuievent_free(ptr, 0);
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* Packed current focus/hover node or `u64::MAX`.
|
|
2015
|
+
* @returns {bigint}
|
|
2016
|
+
*/
|
|
2017
|
+
get current_node_id() {
|
|
2018
|
+
const ret = wasm.__wbg_get_wasmuievent_current_node_id(this.__wbg_ptr);
|
|
2019
|
+
return BigInt.asUintN(64, ret);
|
|
2020
|
+
}
|
|
2021
|
+
/**
|
|
2022
|
+
* Numeric UI event kind.
|
|
2023
|
+
* @returns {number}
|
|
2024
|
+
*/
|
|
2025
|
+
get event_kind() {
|
|
2026
|
+
const ret = wasm.__wbg_get_wasmuievent_event_kind(this.__wbg_ptr);
|
|
2027
|
+
return ret >>> 0;
|
|
2028
|
+
}
|
|
2029
|
+
/**
|
|
2030
|
+
* Packed `UiNodeId` for the source node.
|
|
2031
|
+
* @returns {bigint}
|
|
2032
|
+
*/
|
|
2033
|
+
get node_id() {
|
|
2034
|
+
const ret = wasm.__wbg_get_wasmuievent_node_id(this.__wbg_ptr);
|
|
2035
|
+
return BigInt.asUintN(64, ret);
|
|
2036
|
+
}
|
|
2037
|
+
/**
|
|
2038
|
+
* Packed previous focus/hover node or `u64::MAX`.
|
|
2039
|
+
* @returns {bigint}
|
|
2040
|
+
*/
|
|
2041
|
+
get previous_node_id() {
|
|
2042
|
+
const ret = wasm.__wbg_get_wasmuievent_previous_node_id(this.__wbg_ptr);
|
|
2043
|
+
return BigInt.asUintN(64, ret);
|
|
2044
|
+
}
|
|
2045
|
+
/**
|
|
2046
|
+
* Packed current focus/hover node or `u64::MAX`.
|
|
2047
|
+
* @param {bigint} arg0
|
|
2048
|
+
*/
|
|
2049
|
+
set current_node_id(arg0) {
|
|
2050
|
+
wasm.__wbg_set_wasmuievent_current_node_id(this.__wbg_ptr, arg0);
|
|
2051
|
+
}
|
|
2052
|
+
/**
|
|
2053
|
+
* Numeric UI event kind.
|
|
2054
|
+
* @param {number} arg0
|
|
2055
|
+
*/
|
|
2056
|
+
set event_kind(arg0) {
|
|
2057
|
+
wasm.__wbg_set_wasmuievent_event_kind(this.__wbg_ptr, arg0);
|
|
2058
|
+
}
|
|
2059
|
+
/**
|
|
2060
|
+
* Packed `UiNodeId` for the source node.
|
|
2061
|
+
* @param {bigint} arg0
|
|
2062
|
+
*/
|
|
2063
|
+
set node_id(arg0) {
|
|
2064
|
+
wasm.__wbg_set_wasmuievent_node_id(this.__wbg_ptr, arg0);
|
|
2065
|
+
}
|
|
2066
|
+
/**
|
|
2067
|
+
* Packed previous focus/hover node or `u64::MAX`.
|
|
2068
|
+
* @param {bigint} arg0
|
|
2069
|
+
*/
|
|
2070
|
+
set previous_node_id(arg0) {
|
|
2071
|
+
wasm.__wbg_set_wasmuievent_previous_node_id(this.__wbg_ptr, arg0);
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
if (Symbol.dispose) WasmUiEvent.prototype[Symbol.dispose] = WasmUiEvent.prototype.free;
|
|
2075
|
+
|
|
2076
|
+
/**
|
|
2077
|
+
* Standalone UI manager exported for browser/WASM SDK consumers.
|
|
2078
|
+
*
|
|
2079
|
+
* This mirrors the native `UiManager` lifecycle and widget/style/event APIs
|
|
2080
|
+
* while preserving Rust-side ownership of layout and event processing.
|
|
2081
|
+
*/
|
|
2082
|
+
export class WasmUiManager {
|
|
2083
|
+
__destroy_into_raw() {
|
|
2084
|
+
const ptr = this.__wbg_ptr;
|
|
2085
|
+
this.__wbg_ptr = 0;
|
|
2086
|
+
WasmUiManagerFinalization.unregister(this);
|
|
2087
|
+
return ptr;
|
|
2088
|
+
}
|
|
2089
|
+
free() {
|
|
2090
|
+
const ptr = this.__destroy_into_raw();
|
|
2091
|
+
wasm.__wbg_wasmuimanager_free(ptr, 0);
|
|
2092
|
+
}
|
|
2093
|
+
/**
|
|
2094
|
+
* Creates a UI node with the given component type code.
|
|
2095
|
+
* @param {number} component_type
|
|
2096
|
+
* @returns {bigint}
|
|
2097
|
+
*/
|
|
2098
|
+
create_node(component_type) {
|
|
2099
|
+
const ret = wasm.wasmuimanager_create_node(this.__wbg_ptr, component_type);
|
|
2100
|
+
return BigInt.asUintN(64, ret);
|
|
2101
|
+
}
|
|
2102
|
+
/**
|
|
2103
|
+
* Returns the count of events captured during the latest `update`.
|
|
2104
|
+
* @returns {number}
|
|
2105
|
+
*/
|
|
2106
|
+
event_count() {
|
|
2107
|
+
const ret = wasm.wasmuimanager_event_count(this.__wbg_ptr);
|
|
2108
|
+
return ret >>> 0;
|
|
2109
|
+
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Reads one captured event by index.
|
|
2112
|
+
* @param {number} index
|
|
2113
|
+
* @returns {WasmUiEvent | undefined}
|
|
2114
|
+
*/
|
|
2115
|
+
event_read(index) {
|
|
2116
|
+
const ret = wasm.wasmuimanager_event_read(this.__wbg_ptr, index);
|
|
2117
|
+
return ret === 0 ? undefined : WasmUiEvent.__wrap(ret);
|
|
2118
|
+
}
|
|
2119
|
+
/**
|
|
2120
|
+
* Returns the child at an index, or `u64::MAX` if out of bounds.
|
|
2121
|
+
* @param {bigint} node_id
|
|
2122
|
+
* @param {number} index
|
|
2123
|
+
* @returns {bigint}
|
|
2124
|
+
*/
|
|
2125
|
+
get_child_at(node_id, index) {
|
|
2126
|
+
const ret = wasm.wasmuimanager_get_child_at(this.__wbg_ptr, node_id, index);
|
|
2127
|
+
return BigInt.asUintN(64, ret);
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* Returns the number of children for the given node.
|
|
2131
|
+
* @param {bigint} node_id
|
|
2132
|
+
* @returns {number}
|
|
2133
|
+
*/
|
|
2134
|
+
get_child_count(node_id) {
|
|
2135
|
+
const ret = wasm.wasmuimanager_get_child_count(this.__wbg_ptr, node_id);
|
|
2136
|
+
return ret >>> 0;
|
|
2137
|
+
}
|
|
2138
|
+
/**
|
|
2139
|
+
* Returns a node's parent, or `u64::MAX` if missing/root.
|
|
2140
|
+
* @param {bigint} node_id
|
|
2141
|
+
* @returns {bigint}
|
|
2142
|
+
*/
|
|
2143
|
+
get_parent(node_id) {
|
|
2144
|
+
const ret = wasm.wasmuimanager_get_parent(this.__wbg_ptr, node_id);
|
|
2145
|
+
return BigInt.asUintN(64, ret);
|
|
2146
|
+
}
|
|
2147
|
+
/**
|
|
2148
|
+
* Creates a standalone UI manager for web/WASM consumers.
|
|
2149
|
+
*/
|
|
2150
|
+
constructor() {
|
|
2151
|
+
const ret = wasm.wasmuimanager_new();
|
|
2152
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2153
|
+
WasmUiManagerFinalization.register(this, this.__wbg_ptr, this);
|
|
2154
|
+
return this;
|
|
2155
|
+
}
|
|
2156
|
+
/**
|
|
2157
|
+
* Returns the number of live UI nodes.
|
|
2158
|
+
* @returns {number}
|
|
2159
|
+
*/
|
|
2160
|
+
node_count() {
|
|
2161
|
+
const ret = wasm.wasmuimanager_node_count(this.__wbg_ptr);
|
|
2162
|
+
return ret >>> 0;
|
|
2163
|
+
}
|
|
2164
|
+
/**
|
|
2165
|
+
* Removes a UI node and its subtree.
|
|
2166
|
+
* @param {bigint} node_id
|
|
2167
|
+
* @returns {number}
|
|
2168
|
+
*/
|
|
2169
|
+
remove_node(node_id) {
|
|
2170
|
+
const ret = wasm.wasmuimanager_remove_node(this.__wbg_ptr, node_id);
|
|
2171
|
+
return ret;
|
|
2172
|
+
}
|
|
2173
|
+
/**
|
|
2174
|
+
* Builds render commands for the current UI tree.
|
|
2175
|
+
*/
|
|
2176
|
+
render() {
|
|
2177
|
+
wasm.wasmuimanager_render(this.__wbg_ptr);
|
|
2178
|
+
}
|
|
2179
|
+
/**
|
|
2180
|
+
* Sets/creates a button widget and updates its enabled flag.
|
|
2181
|
+
* @param {bigint} node_id
|
|
2182
|
+
* @param {boolean} enabled
|
|
2183
|
+
* @returns {number}
|
|
2184
|
+
*/
|
|
2185
|
+
set_button_enabled(node_id, enabled) {
|
|
2186
|
+
const ret = wasm.wasmuimanager_set_button_enabled(this.__wbg_ptr, node_id, enabled);
|
|
2187
|
+
return ret;
|
|
2188
|
+
}
|
|
2189
|
+
/**
|
|
2190
|
+
* Sets/creates an image widget and updates its texture path.
|
|
2191
|
+
* @param {bigint} node_id
|
|
2192
|
+
* @param {string} path
|
|
2193
|
+
* @returns {number}
|
|
2194
|
+
*/
|
|
2195
|
+
set_image_texture_path(node_id, path) {
|
|
2196
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2197
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2198
|
+
const ret = wasm.wasmuimanager_set_image_texture_path(this.__wbg_ptr, node_id, ptr0, len0);
|
|
2199
|
+
return ret;
|
|
2200
|
+
}
|
|
2201
|
+
/**
|
|
2202
|
+
* Sets/creates a label widget and updates its text.
|
|
2203
|
+
* @param {bigint} node_id
|
|
2204
|
+
* @param {string} text
|
|
2205
|
+
* @returns {number}
|
|
2206
|
+
*/
|
|
2207
|
+
set_label_text(node_id, text) {
|
|
2208
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2209
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2210
|
+
const ret = wasm.wasmuimanager_set_label_text(this.__wbg_ptr, node_id, ptr0, len0);
|
|
2211
|
+
return ret;
|
|
2212
|
+
}
|
|
2213
|
+
/**
|
|
2214
|
+
* Sets or clears a node's parent (`u64::MAX` detaches to root).
|
|
2215
|
+
* @param {bigint} child_id
|
|
2216
|
+
* @param {bigint} parent_id
|
|
2217
|
+
* @returns {number}
|
|
2218
|
+
*/
|
|
2219
|
+
set_parent(child_id, parent_id) {
|
|
2220
|
+
const ret = wasm.wasmuimanager_set_parent(this.__wbg_ptr, child_id, parent_id);
|
|
2221
|
+
return ret;
|
|
2222
|
+
}
|
|
2223
|
+
/**
|
|
2224
|
+
* Sets/creates a slider widget and updates range/value/enabled state.
|
|
2225
|
+
* @param {bigint} node_id
|
|
2226
|
+
* @param {number} min
|
|
2227
|
+
* @param {number} max
|
|
2228
|
+
* @param {number} value
|
|
2229
|
+
* @param {boolean} enabled
|
|
2230
|
+
* @returns {number}
|
|
2231
|
+
*/
|
|
2232
|
+
set_slider(node_id, min, max, value, enabled) {
|
|
2233
|
+
const ret = wasm.wasmuimanager_set_slider(this.__wbg_ptr, node_id, min, max, value, enabled);
|
|
2234
|
+
return ret;
|
|
2235
|
+
}
|
|
2236
|
+
/**
|
|
2237
|
+
* Applies per-node visual style overrides.
|
|
2238
|
+
* @param {bigint} node_id
|
|
2239
|
+
* @param {number | null} [background_r]
|
|
2240
|
+
* @param {number | null} [background_g]
|
|
2241
|
+
* @param {number | null} [background_b]
|
|
2242
|
+
* @param {number | null} [background_a]
|
|
2243
|
+
* @param {number | null} [foreground_r]
|
|
2244
|
+
* @param {number | null} [foreground_g]
|
|
2245
|
+
* @param {number | null} [foreground_b]
|
|
2246
|
+
* @param {number | null} [foreground_a]
|
|
2247
|
+
* @param {number | null} [border_r]
|
|
2248
|
+
* @param {number | null} [border_g]
|
|
2249
|
+
* @param {number | null} [border_b]
|
|
2250
|
+
* @param {number | null} [border_a]
|
|
2251
|
+
* @param {number | null} [border_width]
|
|
2252
|
+
* @param {string | null} [font_family]
|
|
2253
|
+
* @param {number | null} [font_size]
|
|
2254
|
+
* @param {string | null} [texture_path]
|
|
2255
|
+
* @param {number | null} [widget_spacing]
|
|
2256
|
+
* @returns {number}
|
|
2257
|
+
*/
|
|
2258
|
+
set_style(node_id, background_r, background_g, background_b, background_a, foreground_r, foreground_g, foreground_b, foreground_a, border_r, border_g, border_b, border_a, border_width, font_family, font_size, texture_path, widget_spacing) {
|
|
2259
|
+
var ptr0 = isLikeNone(font_family) ? 0 : passStringToWasm0(font_family, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2260
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2261
|
+
var ptr1 = isLikeNone(texture_path) ? 0 : passStringToWasm0(texture_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2262
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2263
|
+
const ret = wasm.wasmuimanager_set_style(this.__wbg_ptr, node_id, isLikeNone(background_r) ? 0x100000001 : Math.fround(background_r), isLikeNone(background_g) ? 0x100000001 : Math.fround(background_g), isLikeNone(background_b) ? 0x100000001 : Math.fround(background_b), isLikeNone(background_a) ? 0x100000001 : Math.fround(background_a), isLikeNone(foreground_r) ? 0x100000001 : Math.fround(foreground_r), isLikeNone(foreground_g) ? 0x100000001 : Math.fround(foreground_g), isLikeNone(foreground_b) ? 0x100000001 : Math.fround(foreground_b), isLikeNone(foreground_a) ? 0x100000001 : Math.fround(foreground_a), isLikeNone(border_r) ? 0x100000001 : Math.fround(border_r), isLikeNone(border_g) ? 0x100000001 : Math.fround(border_g), isLikeNone(border_b) ? 0x100000001 : Math.fround(border_b), isLikeNone(border_a) ? 0x100000001 : Math.fround(border_a), isLikeNone(border_width) ? 0x100000001 : Math.fround(border_width), ptr0, len0, isLikeNone(font_size) ? 0x100000001 : Math.fround(font_size), ptr1, len1, isLikeNone(widget_spacing) ? 0x100000001 : Math.fround(widget_spacing));
|
|
2264
|
+
return ret;
|
|
2265
|
+
}
|
|
2266
|
+
/**
|
|
2267
|
+
* Sets or clears the node widget component by widget-kind code.
|
|
2268
|
+
* @param {bigint} node_id
|
|
2269
|
+
* @param {number} widget_kind
|
|
2270
|
+
* @returns {number}
|
|
2271
|
+
*/
|
|
2272
|
+
set_widget(node_id, widget_kind) {
|
|
2273
|
+
const ret = wasm.wasmuimanager_set_widget(this.__wbg_ptr, node_id, widget_kind);
|
|
2274
|
+
return ret;
|
|
2275
|
+
}
|
|
2276
|
+
/**
|
|
2277
|
+
* Runs a layout/input update tick and snapshots the emitted UI events.
|
|
2278
|
+
*/
|
|
2279
|
+
update() {
|
|
2280
|
+
wasm.wasmuimanager_update(this.__wbg_ptr);
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
if (Symbol.dispose) WasmUiManager.prototype[Symbol.dispose] = WasmUiManager.prototype.free;
|
|
2284
|
+
|
|
1101
2285
|
function __wbg_get_imports() {
|
|
1102
2286
|
const import0 = {
|
|
1103
2287
|
__proto__: null,
|
|
@@ -1146,9 +2330,16 @@ function __wbg_get_imports() {
|
|
|
1146
2330
|
const ret = arg0.call(arg1, arg2);
|
|
1147
2331
|
return ret;
|
|
1148
2332
|
}, arguments); },
|
|
2333
|
+
__wbg_close_af26905c832a88cb: function() { return handleError(function (arg0) {
|
|
2334
|
+
arg0.close();
|
|
2335
|
+
}, arguments); },
|
|
1149
2336
|
__wbg_configure_3800e43cc1d4df6c: function() { return handleError(function (arg0, arg1) {
|
|
1150
2337
|
arg0.configure(arg1);
|
|
1151
2338
|
}, arguments); },
|
|
2339
|
+
__wbg_connect_3ca85e8e3b8d9828: function() { return handleError(function (arg0, arg1) {
|
|
2340
|
+
const ret = arg0.connect(arg1);
|
|
2341
|
+
return ret;
|
|
2342
|
+
}, arguments); },
|
|
1152
2343
|
__wbg_createBindGroupLayout_38abd4e4c5dded7c: function() { return handleError(function (arg0, arg1) {
|
|
1153
2344
|
const ret = arg0.createBindGroupLayout(arg1);
|
|
1154
2345
|
return ret;
|
|
@@ -1165,6 +2356,21 @@ function __wbg_get_imports() {
|
|
|
1165
2356
|
const ret = arg0.createCommandEncoder(arg1);
|
|
1166
2357
|
return ret;
|
|
1167
2358
|
},
|
|
2359
|
+
__wbg_createGain_94d1140dbe2da90d: function() { return handleError(function (arg0) {
|
|
2360
|
+
const ret = arg0.createGain();
|
|
2361
|
+
return ret;
|
|
2362
|
+
}, arguments); },
|
|
2363
|
+
__wbg_createMediaElementSource_bfc16374db84a671: function() { return handleError(function (arg0, arg1) {
|
|
2364
|
+
const ret = arg0.createMediaElementSource(arg1);
|
|
2365
|
+
return ret;
|
|
2366
|
+
}, arguments); },
|
|
2367
|
+
__wbg_createObjectURL_f141426bcc1f70aa: function() { return handleError(function (arg0, arg1) {
|
|
2368
|
+
const ret = URL.createObjectURL(arg1);
|
|
2369
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2370
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2371
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2372
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2373
|
+
}, arguments); },
|
|
1168
2374
|
__wbg_createPipelineLayout_10a02d78a5e801aa: function(arg0, arg1) {
|
|
1169
2375
|
const ret = arg0.createPipelineLayout(arg1);
|
|
1170
2376
|
return ret;
|
|
@@ -1181,6 +2387,10 @@ function __wbg_get_imports() {
|
|
|
1181
2387
|
const ret = arg0.createShaderModule(arg1);
|
|
1182
2388
|
return ret;
|
|
1183
2389
|
},
|
|
2390
|
+
__wbg_createStereoPanner_e8bc9c6bea047898: function() { return handleError(function (arg0) {
|
|
2391
|
+
const ret = arg0.createStereoPanner();
|
|
2392
|
+
return ret;
|
|
2393
|
+
}, arguments); },
|
|
1184
2394
|
__wbg_createTexture_7de0f1ac17578a0c: function() { return handleError(function (arg0, arg1) {
|
|
1185
2395
|
const ret = arg0.createTexture(arg1);
|
|
1186
2396
|
return ret;
|
|
@@ -1189,6 +2399,14 @@ function __wbg_get_imports() {
|
|
|
1189
2399
|
const ret = arg0.createView(arg1);
|
|
1190
2400
|
return ret;
|
|
1191
2401
|
}, arguments); },
|
|
2402
|
+
__wbg_data_a3d9ff9cdd801002: function(arg0) {
|
|
2403
|
+
const ret = arg0.data;
|
|
2404
|
+
return ret;
|
|
2405
|
+
},
|
|
2406
|
+
__wbg_destination_d1f70fe081ff0932: function(arg0) {
|
|
2407
|
+
const ret = arg0.destination;
|
|
2408
|
+
return ret;
|
|
2409
|
+
},
|
|
1192
2410
|
__wbg_document_c0320cd4183c6d9b: function(arg0) {
|
|
1193
2411
|
const ret = arg0.document;
|
|
1194
2412
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -1210,6 +2428,10 @@ function __wbg_get_imports() {
|
|
|
1210
2428
|
const ret = arg0.finish();
|
|
1211
2429
|
return ret;
|
|
1212
2430
|
},
|
|
2431
|
+
__wbg_gain_c5b40ffb38909ac5: function(arg0) {
|
|
2432
|
+
const ret = arg0.gain;
|
|
2433
|
+
return ret;
|
|
2434
|
+
},
|
|
1213
2435
|
__wbg_getContext_a9236f98f1f7fe7c: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1214
2436
|
const ret = arg0.getContext(getStringFromWasm0(arg1, arg2));
|
|
1215
2437
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -1238,6 +2460,16 @@ function __wbg_get_imports() {
|
|
|
1238
2460
|
const ret = arg0.gpu;
|
|
1239
2461
|
return ret;
|
|
1240
2462
|
},
|
|
2463
|
+
__wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
|
|
2464
|
+
let result;
|
|
2465
|
+
try {
|
|
2466
|
+
result = arg0 instanceof ArrayBuffer;
|
|
2467
|
+
} catch (_) {
|
|
2468
|
+
result = false;
|
|
2469
|
+
}
|
|
2470
|
+
const ret = result;
|
|
2471
|
+
return ret;
|
|
2472
|
+
},
|
|
1241
2473
|
__wbg_instanceof_GpuAdapter_b2c1300e425af95c: function(arg0) {
|
|
1242
2474
|
let result;
|
|
1243
2475
|
try {
|
|
@@ -1258,6 +2490,16 @@ function __wbg_get_imports() {
|
|
|
1258
2490
|
const ret = result;
|
|
1259
2491
|
return ret;
|
|
1260
2492
|
},
|
|
2493
|
+
__wbg_instanceof_Uint8Array_740438561a5b956d: function(arg0) {
|
|
2494
|
+
let result;
|
|
2495
|
+
try {
|
|
2496
|
+
result = arg0 instanceof Uint8Array;
|
|
2497
|
+
} catch (_) {
|
|
2498
|
+
result = false;
|
|
2499
|
+
}
|
|
2500
|
+
const ret = result;
|
|
2501
|
+
return ret;
|
|
2502
|
+
},
|
|
1261
2503
|
__wbg_instanceof_Window_23e677d2c6843922: function(arg0) {
|
|
1262
2504
|
let result;
|
|
1263
2505
|
try {
|
|
@@ -1291,10 +2533,26 @@ function __wbg_get_imports() {
|
|
|
1291
2533
|
const ret = arg0.navigator;
|
|
1292
2534
|
return ret;
|
|
1293
2535
|
},
|
|
2536
|
+
__wbg_new_5e532409c6c7bba4: function() { return handleError(function () {
|
|
2537
|
+
const ret = new lAudioContext();
|
|
2538
|
+
return ret;
|
|
2539
|
+
}, arguments); },
|
|
2540
|
+
__wbg_new_5f486cdf45a04d78: function(arg0) {
|
|
2541
|
+
const ret = new Uint8Array(arg0);
|
|
2542
|
+
return ret;
|
|
2543
|
+
},
|
|
2544
|
+
__wbg_new_a70fbab9066b301f: function() {
|
|
2545
|
+
const ret = new Array();
|
|
2546
|
+
return ret;
|
|
2547
|
+
},
|
|
1294
2548
|
__wbg_new_ab79df5bd7c26067: function() {
|
|
1295
2549
|
const ret = new Object();
|
|
1296
2550
|
return ret;
|
|
1297
2551
|
},
|
|
2552
|
+
__wbg_new_dd50bcc3f60ba434: function() { return handleError(function (arg0, arg1) {
|
|
2553
|
+
const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
|
|
2554
|
+
return ret;
|
|
2555
|
+
}, arguments); },
|
|
1298
2556
|
__wbg_new_from_slice_22da9388ac046e50: function(arg0, arg1) {
|
|
1299
2557
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1300
2558
|
return ret;
|
|
@@ -1306,7 +2564,7 @@ function __wbg_get_imports() {
|
|
|
1306
2564
|
const a = state0.a;
|
|
1307
2565
|
state0.a = 0;
|
|
1308
2566
|
try {
|
|
1309
|
-
return
|
|
2567
|
+
return wasm_bindgen__convert__closures_____invoke__h0f058dd9c7531832(a, state0.b, arg0, arg1);
|
|
1310
2568
|
} finally {
|
|
1311
2569
|
state0.a = a;
|
|
1312
2570
|
}
|
|
@@ -1325,10 +2583,33 @@ function __wbg_get_imports() {
|
|
|
1325
2583
|
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
1326
2584
|
return ret;
|
|
1327
2585
|
},
|
|
2586
|
+
__wbg_new_with_src_a50a81c022cd450e: function() { return handleError(function (arg0, arg1) {
|
|
2587
|
+
const ret = new Audio(getStringFromWasm0(arg0, arg1));
|
|
2588
|
+
return ret;
|
|
2589
|
+
}, arguments); },
|
|
2590
|
+
__wbg_new_with_u8_array_sequence_1366bd1ced0ec6b9: function() { return handleError(function (arg0) {
|
|
2591
|
+
const ret = new Blob(arg0);
|
|
2592
|
+
return ret;
|
|
2593
|
+
}, arguments); },
|
|
2594
|
+
__wbg_numberOfInputs_657d26b943855bfc: function(arg0) {
|
|
2595
|
+
const ret = arg0.numberOfInputs;
|
|
2596
|
+
return ret;
|
|
2597
|
+
},
|
|
1328
2598
|
__wbg_onSubmittedWorkDone_a33e32762de21b3d: function(arg0) {
|
|
1329
2599
|
const ret = arg0.onSubmittedWorkDone();
|
|
1330
2600
|
return ret;
|
|
1331
2601
|
},
|
|
2602
|
+
__wbg_pan_4182a9bbd48792d9: function(arg0) {
|
|
2603
|
+
const ret = arg0.pan;
|
|
2604
|
+
return ret;
|
|
2605
|
+
},
|
|
2606
|
+
__wbg_pause_fe6c9b27e2a39a14: function() { return handleError(function (arg0) {
|
|
2607
|
+
arg0.pause();
|
|
2608
|
+
}, arguments); },
|
|
2609
|
+
__wbg_play_61507f47e1a45940: function() { return handleError(function (arg0) {
|
|
2610
|
+
const ret = arg0.play();
|
|
2611
|
+
return ret;
|
|
2612
|
+
}, arguments); },
|
|
1332
2613
|
__wbg_prototypesetcall_d62e5099504357e6: function(arg0, arg1, arg2) {
|
|
1333
2614
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1334
2615
|
},
|
|
@@ -1351,6 +2632,10 @@ function __wbg_get_imports() {
|
|
|
1351
2632
|
const ret = arg0.queue;
|
|
1352
2633
|
return ret;
|
|
1353
2634
|
},
|
|
2635
|
+
__wbg_readyState_1f1e7f1bdf9f4d42: function(arg0) {
|
|
2636
|
+
const ret = arg0.readyState;
|
|
2637
|
+
return ret;
|
|
2638
|
+
},
|
|
1354
2639
|
__wbg_requestAdapter_3cddf363b0bc9baf: function(arg0, arg1) {
|
|
1355
2640
|
const ret = arg0.requestAdapter(arg1);
|
|
1356
2641
|
return ret;
|
|
@@ -1363,6 +2648,16 @@ function __wbg_get_imports() {
|
|
|
1363
2648
|
const ret = Promise.resolve(arg0);
|
|
1364
2649
|
return ret;
|
|
1365
2650
|
},
|
|
2651
|
+
__wbg_resume_7cf56c82bfdf6c58: function() { return handleError(function (arg0) {
|
|
2652
|
+
const ret = arg0.resume();
|
|
2653
|
+
return ret;
|
|
2654
|
+
}, arguments); },
|
|
2655
|
+
__wbg_revokeObjectURL_c4a7ed8e1908b794: function() { return handleError(function (arg0, arg1) {
|
|
2656
|
+
URL.revokeObjectURL(getStringFromWasm0(arg0, arg1));
|
|
2657
|
+
}, arguments); },
|
|
2658
|
+
__wbg_send_d31a693c975dea74: function() { return handleError(function (arg0, arg1, arg2) {
|
|
2659
|
+
arg0.send(getArrayU8FromWasm0(arg1, arg2));
|
|
2660
|
+
}, arguments); },
|
|
1366
2661
|
__wbg_setBindGroup_24fcfe125e006dd4: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
1367
2662
|
arg0.setBindGroup(arg1 >>> 0, arg2, getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
|
|
1368
2663
|
}, arguments); },
|
|
@@ -1433,6 +2728,9 @@ function __wbg_get_imports() {
|
|
|
1433
2728
|
__wbg_set_beginning_of_pass_write_index_ff16e69caf566bee: function(arg0, arg1) {
|
|
1434
2729
|
arg0.beginningOfPassWriteIndex = arg1 >>> 0;
|
|
1435
2730
|
},
|
|
2731
|
+
__wbg_set_binaryType_3dcf8281ec100a8f: function(arg0, arg1) {
|
|
2732
|
+
arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
|
|
2733
|
+
},
|
|
1436
2734
|
__wbg_set_bind_group_layouts_ddc70fed7170a2ee: function(arg0, arg1) {
|
|
1437
2735
|
arg0.bindGroupLayouts = arg1;
|
|
1438
2736
|
},
|
|
@@ -1481,6 +2779,9 @@ function __wbg_get_imports() {
|
|
|
1481
2779
|
__wbg_set_cull_mode_8c42221bd938897d: function(arg0, arg1) {
|
|
1482
2780
|
arg0.cullMode = __wbindgen_enum_GpuCullMode[arg1];
|
|
1483
2781
|
},
|
|
2782
|
+
__wbg_set_currentTime_0bd5c83ef1810a8f: function(arg0, arg1) {
|
|
2783
|
+
arg0.currentTime = arg1;
|
|
2784
|
+
},
|
|
1484
2785
|
__wbg_set_depth_bias_8de79219aa9d3e44: function(arg0, arg1) {
|
|
1485
2786
|
arg0.depthBias = arg1;
|
|
1486
2787
|
},
|
|
@@ -1652,6 +2953,9 @@ function __wbg_get_imports() {
|
|
|
1652
2953
|
__wbg_set_lod_min_clamp_35ccf45d8ee31c7e: function(arg0, arg1) {
|
|
1653
2954
|
arg0.lodMinClamp = arg1;
|
|
1654
2955
|
},
|
|
2956
|
+
__wbg_set_loop_3edfdf296459469a: function(arg0, arg1) {
|
|
2957
|
+
arg0.loop = arg1 !== 0;
|
|
2958
|
+
},
|
|
1655
2959
|
__wbg_set_mag_filter_8f8d84435d8db92a: function(arg0, arg1) {
|
|
1656
2960
|
arg0.magFilter = __wbindgen_enum_GpuFilterMode[arg1];
|
|
1657
2961
|
},
|
|
@@ -1703,6 +3007,18 @@ function __wbg_get_imports() {
|
|
|
1703
3007
|
__wbg_set_offset_fa633343238c309f: function(arg0, arg1) {
|
|
1704
3008
|
arg0.offset = arg1;
|
|
1705
3009
|
},
|
|
3010
|
+
__wbg_set_onclose_8da801226bdd7a7b: function(arg0, arg1) {
|
|
3011
|
+
arg0.onclose = arg1;
|
|
3012
|
+
},
|
|
3013
|
+
__wbg_set_onerror_901ca711f94a5bbb: function(arg0, arg1) {
|
|
3014
|
+
arg0.onerror = arg1;
|
|
3015
|
+
},
|
|
3016
|
+
__wbg_set_onmessage_6f80ab771bf151aa: function(arg0, arg1) {
|
|
3017
|
+
arg0.onmessage = arg1;
|
|
3018
|
+
},
|
|
3019
|
+
__wbg_set_onopen_34e3e24cf9337ddd: function(arg0, arg1) {
|
|
3020
|
+
arg0.onopen = arg1;
|
|
3021
|
+
},
|
|
1706
3022
|
__wbg_set_operation_3a748fcc4d122201: function(arg0, arg1) {
|
|
1707
3023
|
arg0.operation = __wbindgen_enum_GpuBlendOperation[arg1];
|
|
1708
3024
|
},
|
|
@@ -1712,9 +3028,15 @@ function __wbg_get_imports() {
|
|
|
1712
3028
|
__wbg_set_pass_op_e82189d4f2d5c48d: function(arg0, arg1) {
|
|
1713
3029
|
arg0.passOp = __wbindgen_enum_GpuStencilOperation[arg1];
|
|
1714
3030
|
},
|
|
3031
|
+
__wbg_set_playbackRate_4b4212c0d2c84b0e: function(arg0, arg1) {
|
|
3032
|
+
arg0.playbackRate = arg1;
|
|
3033
|
+
},
|
|
1715
3034
|
__wbg_set_power_preference_f8956c3fea27c41d: function(arg0, arg1) {
|
|
1716
3035
|
arg0.powerPreference = __wbindgen_enum_GpuPowerPreference[arg1];
|
|
1717
3036
|
},
|
|
3037
|
+
__wbg_set_preload_3c04b4c7f95193ba: function(arg0, arg1, arg2) {
|
|
3038
|
+
arg0.preload = getStringFromWasm0(arg1, arg2);
|
|
3039
|
+
},
|
|
1718
3040
|
__wbg_set_primitive_65a118359b90be29: function(arg0, arg1) {
|
|
1719
3041
|
arg0.primitive = arg1;
|
|
1720
3042
|
},
|
|
@@ -1832,6 +3154,9 @@ function __wbg_get_imports() {
|
|
|
1832
3154
|
__wbg_set_usage_ece80ba45b896722: function(arg0, arg1) {
|
|
1833
3155
|
arg0.usage = arg1 >>> 0;
|
|
1834
3156
|
},
|
|
3157
|
+
__wbg_set_value_4379db49464da2c7: function(arg0, arg1) {
|
|
3158
|
+
arg0.value = arg1;
|
|
3159
|
+
},
|
|
1835
3160
|
__wbg_set_vertex_879729b1ef5390a2: function(arg0, arg1) {
|
|
1836
3161
|
arg0.vertex = arg1;
|
|
1837
3162
|
},
|
|
@@ -1877,6 +3202,10 @@ function __wbg_get_imports() {
|
|
|
1877
3202
|
__wbg_set_z_bb89b8ff0b9f8f74: function(arg0, arg1) {
|
|
1878
3203
|
arg0.z = arg1 >>> 0;
|
|
1879
3204
|
},
|
|
3205
|
+
__wbg_state_a4d9e52dfc1783cb: function(arg0) {
|
|
3206
|
+
const ret = arg0.state;
|
|
3207
|
+
return (__wbindgen_enum_AudioContextState.indexOf(ret) + 1 || 4) - 1;
|
|
3208
|
+
},
|
|
1880
3209
|
__wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
|
|
1881
3210
|
const ret = typeof global === 'undefined' ? null : global;
|
|
1882
3211
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -1922,26 +3251,41 @@ function __wbg_get_imports() {
|
|
|
1922
3251
|
arg0.writeTexture(arg1, arg2, arg3, arg4);
|
|
1923
3252
|
}, arguments); },
|
|
1924
3253
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1925
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1926
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
3254
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1000, function: Function { arguments: [Externref], shim_idx: 1001, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
3255
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h789bc42e2f1b9970, wasm_bindgen__convert__closures_____invoke__he47406ccb328564e);
|
|
1927
3256
|
return ret;
|
|
1928
3257
|
},
|
|
1929
3258
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1930
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1931
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
3259
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 121, function: Function { arguments: [Externref], shim_idx: 122, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3260
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h8ef9cafea49c0c6c, wasm_bindgen__convert__closures_____invoke__h7379c539a866d2ef);
|
|
3261
|
+
return ret;
|
|
3262
|
+
},
|
|
3263
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
3264
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 46, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 47, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3265
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h173e94978d19fd44, wasm_bindgen__convert__closures_____invoke__h1155117ea4dcfb6a);
|
|
1932
3266
|
return ret;
|
|
1933
3267
|
},
|
|
1934
|
-
|
|
3268
|
+
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
3269
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 46, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 47, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3270
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h173e94978d19fd44, wasm_bindgen__convert__closures_____invoke__h1155117ea4dcfb6a_3);
|
|
3271
|
+
return ret;
|
|
3272
|
+
},
|
|
3273
|
+
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
3274
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 93, function: Function { arguments: [NamedExternref("Event")], shim_idx: 94, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3275
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h19c7764ad1550135, wasm_bindgen__convert__closures_____invoke__h20ce9aa610e9cd25);
|
|
3276
|
+
return ret;
|
|
3277
|
+
},
|
|
3278
|
+
__wbindgen_cast_0000000000000006: function(arg0) {
|
|
1935
3279
|
// Cast intrinsic for `F64 -> Externref`.
|
|
1936
3280
|
const ret = arg0;
|
|
1937
3281
|
return ret;
|
|
1938
3282
|
},
|
|
1939
|
-
|
|
3283
|
+
__wbindgen_cast_0000000000000007: function(arg0, arg1) {
|
|
1940
3284
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
1941
3285
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1942
3286
|
return ret;
|
|
1943
3287
|
},
|
|
1944
|
-
|
|
3288
|
+
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
1945
3289
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1946
3290
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1947
3291
|
return ret;
|
|
@@ -1962,22 +3306,41 @@ function __wbg_get_imports() {
|
|
|
1962
3306
|
};
|
|
1963
3307
|
}
|
|
1964
3308
|
|
|
1965
|
-
|
|
1966
|
-
|
|
3309
|
+
const lAudioContext = (typeof AudioContext !== 'undefined' ? AudioContext : (typeof webkitAudioContext !== 'undefined' ? webkitAudioContext : undefined));
|
|
3310
|
+
function wasm_bindgen__convert__closures_____invoke__h7379c539a866d2ef(arg0, arg1, arg2) {
|
|
3311
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h7379c539a866d2ef(arg0, arg1, arg2);
|
|
1967
3312
|
}
|
|
1968
3313
|
|
|
1969
|
-
function
|
|
1970
|
-
|
|
3314
|
+
function wasm_bindgen__convert__closures_____invoke__h1155117ea4dcfb6a(arg0, arg1, arg2) {
|
|
3315
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h1155117ea4dcfb6a(arg0, arg1, arg2);
|
|
3316
|
+
}
|
|
3317
|
+
|
|
3318
|
+
function wasm_bindgen__convert__closures_____invoke__h1155117ea4dcfb6a_3(arg0, arg1, arg2) {
|
|
3319
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h1155117ea4dcfb6a_3(arg0, arg1, arg2);
|
|
3320
|
+
}
|
|
3321
|
+
|
|
3322
|
+
function wasm_bindgen__convert__closures_____invoke__h20ce9aa610e9cd25(arg0, arg1, arg2) {
|
|
3323
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h20ce9aa610e9cd25(arg0, arg1, arg2);
|
|
3324
|
+
}
|
|
3325
|
+
|
|
3326
|
+
function wasm_bindgen__convert__closures_____invoke__he47406ccb328564e(arg0, arg1, arg2) {
|
|
3327
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__he47406ccb328564e(arg0, arg1, arg2);
|
|
1971
3328
|
if (ret[1]) {
|
|
1972
3329
|
throw takeFromExternrefTable0(ret[0]);
|
|
1973
3330
|
}
|
|
1974
3331
|
}
|
|
1975
3332
|
|
|
1976
|
-
function
|
|
1977
|
-
wasm.
|
|
3333
|
+
function wasm_bindgen__convert__closures_____invoke__h0f058dd9c7531832(arg0, arg1, arg2, arg3) {
|
|
3334
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h0f058dd9c7531832(arg0, arg1, arg2, arg3);
|
|
1978
3335
|
}
|
|
1979
3336
|
|
|
1980
3337
|
|
|
3338
|
+
const __wbindgen_enum_AudioContextState = ["suspended", "running", "closed"];
|
|
3339
|
+
|
|
3340
|
+
|
|
3341
|
+
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
3342
|
+
|
|
3343
|
+
|
|
1981
3344
|
const __wbindgen_enum_GpuAddressMode = ["clamp-to-edge", "repeat", "mirror-repeat"];
|
|
1982
3345
|
|
|
1983
3346
|
|
|
@@ -2057,6 +3420,18 @@ const WasmContactFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
2057
3420
|
const WasmGameFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2058
3421
|
? { register: () => {}, unregister: () => {} }
|
|
2059
3422
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmgame_free(ptr >>> 0, 1));
|
|
3423
|
+
const WasmNetworkCapabilitiesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3424
|
+
? { register: () => {}, unregister: () => {} }
|
|
3425
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmnetworkcapabilities_free(ptr >>> 0, 1));
|
|
3426
|
+
const WasmNetworkConnectResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3427
|
+
? { register: () => {}, unregister: () => {} }
|
|
3428
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmnetworkconnectresult_free(ptr >>> 0, 1));
|
|
3429
|
+
const WasmNetworkPacketFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3430
|
+
? { register: () => {}, unregister: () => {} }
|
|
3431
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmnetworkpacket_free(ptr >>> 0, 1));
|
|
3432
|
+
const WasmNetworkStatsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3433
|
+
? { register: () => {}, unregister: () => {} }
|
|
3434
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmnetworkstats_free(ptr >>> 0, 1));
|
|
2060
3435
|
const WasmRenderStatsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2061
3436
|
? { register: () => {}, unregister: () => {} }
|
|
2062
3437
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmrenderstats_free(ptr >>> 0, 1));
|
|
@@ -2066,6 +3441,12 @@ const WasmSpriteFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
2066
3441
|
const WasmTransform2DFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2067
3442
|
? { register: () => {}, unregister: () => {} }
|
|
2068
3443
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmtransform2d_free(ptr >>> 0, 1));
|
|
3444
|
+
const WasmUiEventFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3445
|
+
? { register: () => {}, unregister: () => {} }
|
|
3446
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmuievent_free(ptr >>> 0, 1));
|
|
3447
|
+
const WasmUiManagerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3448
|
+
? { register: () => {}, unregister: () => {} }
|
|
3449
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmuimanager_free(ptr >>> 0, 1));
|
|
2069
3450
|
|
|
2070
3451
|
function addToExternrefTable0(obj) {
|
|
2071
3452
|
const idx = wasm.__externref_table_alloc();
|