@defold-typescript/types 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-availability.json +4024 -716
- package/api-migrations.json +27 -0
- package/api-signatures.json +18118 -10264
- package/api-targets.json +448 -11
- package/examples/translations.json +619 -148
- package/fixtures/messages_doc.json +96 -0
- package/generated/b2d.d.ts +680 -4
- package/generated/b2d_body.d.ts +29 -103
- package/generated/b2d_chain.d.ts +5 -6
- package/generated/b2d_fixture.d.ts +34 -38
- package/generated/b2d_joint.d.ts +503 -25
- package/generated/b2d_shape.d.ts +199 -14
- package/generated/b2d_world.d.ts +57 -63
- package/generated/buffer.d.ts +33 -29
- package/generated/builtin-messages.d.ts +7 -1
- package/generated/bullet3d.d.ts +91 -0
- package/generated/bullet3d_collision_object.d.ts +433 -0
- package/generated/bullet3d_constraint.d.ts +818 -0
- package/generated/bullet3d_rigid_body.d.ts +429 -0
- package/generated/bullet3d_shape.d.ts +123 -0
- package/generated/bullet3d_world.d.ts +492 -0
- package/generated/camera.d.ts +31 -34
- package/generated/collectionfactory.d.ts +26 -27
- package/generated/collectionproxy.d.ts +22 -6
- package/generated/compute.d.ts +12 -238
- package/generated/crash.d.ts +24 -10
- package/generated/editor-vm/http.d.ts +90 -7
- package/generated/editor-vm/image.d.ts +7 -7
- package/generated/editor-vm/json.d.ts +11 -0
- package/generated/editor-vm/localization.d.ts +7 -7
- package/generated/editor-vm/tilemap_tiles.d.ts +56 -10
- package/generated/editor-vm/zip.d.ts +28 -0
- package/generated/editor.d.ts +1496 -430
- package/generated/factory.d.ts +21 -25
- package/generated/font.d.ts +64 -22
- package/generated/go.d.ts +243 -186
- package/generated/graphics.d.ts +374 -84
- package/generated/gui.d.ts +282 -492
- package/generated/html5.d.ts +5 -3
- package/generated/http.d.ts +31 -36
- package/generated/image.d.ts +127 -85
- package/generated/json.d.ts +34 -16
- package/generated/kinds/gui-script.d.ts +8 -0
- package/generated/kinds/render-script.d.ts +8 -0
- package/generated/kinds/script.d.ts +8 -0
- package/generated/label.d.ts +77 -7
- package/generated/liveupdate.d.ts +13 -10
- package/generated/material.d.ts +312 -360
- package/generated/model.d.ts +72 -42
- package/generated/particlefx.d.ts +19 -28
- package/generated/physics.d.ts +378 -144
- package/generated/profiler.d.ts +14 -24
- package/generated/render.d.ts +294 -297
- package/generated/resource.d.ts +753 -641
- package/generated/socket.d.ts +131 -134
- package/generated/sound.d.ts +65 -34
- package/generated/sprite.d.ts +39 -17
- package/generated/sys.d.ts +237 -182
- package/generated/tilemap.d.ts +21 -16
- package/generated/timer.d.ts +34 -21
- package/generated/versions/defold-1.12.4/b2d_body.d.ts +0 -7
- package/generated/versions/defold-1.12.4/buffer.d.ts +18 -17
- package/generated/versions/defold-1.12.4/camera.d.ts +23 -23
- package/generated/versions/defold-1.12.4/collectionfactory.d.ts +21 -19
- package/generated/versions/defold-1.12.4/collectionproxy.d.ts +2 -2
- package/generated/versions/defold-1.12.4/crash.d.ts +2 -2
- package/generated/versions/defold-1.12.4/factory.d.ts +15 -16
- package/generated/versions/defold-1.12.4/go.d.ts +15 -17
- package/generated/versions/defold-1.12.4/gui.d.ts +111 -193
- package/generated/versions/defold-1.12.4/html5.d.ts +4 -2
- package/generated/versions/defold-1.12.4/http.d.ts +4 -15
- package/generated/versions/defold-1.12.4/image.d.ts +38 -46
- package/generated/versions/defold-1.12.4/index.d.ts +2 -0
- package/generated/versions/defold-1.12.4/json.d.ts +10 -6
- package/generated/versions/defold-1.12.4/label.d.ts +2 -3
- package/generated/versions/defold-1.12.4/liveupdate.d.ts +5 -3
- package/generated/versions/defold-1.12.4/model.d.ts +34 -13
- package/generated/versions/defold-1.12.4/particlefx.d.ts +2 -5
- package/generated/versions/defold-1.12.4/physics.d.ts +82 -78
- package/generated/versions/defold-1.12.4/profiler.d.ts +3 -6
- package/generated/versions/defold-1.12.4/render.d.ts +160 -132
- package/generated/versions/defold-1.12.4/resource.d.ts +212 -209
- package/generated/versions/defold-1.12.4/socket.d.ts +45 -61
- package/generated/versions/defold-1.12.4/sound.d.ts +11 -11
- package/generated/versions/defold-1.12.4/sprite.d.ts +24 -6
- package/generated/versions/defold-1.12.4/sys.d.ts +45 -68
- package/generated/versions/defold-1.12.4/tilemap.d.ts +18 -11
- package/generated/versions/defold-1.12.4/timer.d.ts +5 -3
- package/generated/versions/defold-1.12.4/vmath.d.ts +5 -26
- package/generated/versions/defold-1.12.4/window.d.ts +1 -16
- package/generated/versions/defold-1.13.0/b2d_body.d.ts +10 -55
- package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +25 -25
- package/generated/versions/defold-1.13.0/b2d_shape.d.ts +188 -5
- package/generated/versions/defold-1.13.0/b2d_world.d.ts +16 -10
- package/generated/versions/defold-1.13.0/buffer.d.ts +18 -17
- package/generated/versions/defold-1.13.0/camera.d.ts +27 -27
- package/generated/versions/defold-1.13.0/collectionfactory.d.ts +21 -19
- package/generated/versions/defold-1.13.0/collectionproxy.d.ts +2 -2
- package/generated/versions/defold-1.13.0/compute.d.ts +1 -70
- package/generated/versions/defold-1.13.0/crash.d.ts +2 -2
- package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +3 -3
- package/generated/versions/defold-1.13.0/editor.d.ts +34 -24
- package/generated/versions/defold-1.13.0/factory.d.ts +15 -16
- package/generated/versions/defold-1.13.0/go.d.ts +15 -17
- package/generated/versions/defold-1.13.0/graphics.d.ts +121 -37
- package/generated/versions/defold-1.13.0/gui.d.ts +111 -193
- package/generated/versions/defold-1.13.0/html5.d.ts +4 -2
- package/generated/versions/defold-1.13.0/http.d.ts +4 -15
- package/generated/versions/defold-1.13.0/image.d.ts +38 -46
- package/generated/versions/defold-1.13.0/index.d.ts +2 -0
- package/generated/versions/defold-1.13.0/json.d.ts +10 -6
- package/generated/versions/defold-1.13.0/label.d.ts +2 -3
- package/generated/versions/defold-1.13.0/liveupdate.d.ts +7 -5
- package/generated/versions/defold-1.13.0/material.d.ts +69 -107
- package/generated/versions/defold-1.13.0/model.d.ts +34 -13
- package/generated/versions/defold-1.13.0/particlefx.d.ts +2 -5
- package/generated/versions/defold-1.13.0/physics.d.ts +82 -78
- package/generated/versions/defold-1.13.0/profiler.d.ts +3 -6
- package/generated/versions/defold-1.13.0/render.d.ts +160 -132
- package/generated/versions/defold-1.13.0/resource.d.ts +217 -210
- package/generated/versions/defold-1.13.0/socket.d.ts +45 -61
- package/generated/versions/defold-1.13.0/sound.d.ts +11 -11
- package/generated/versions/defold-1.13.0/sprite.d.ts +24 -6
- package/generated/versions/defold-1.13.0/sys.d.ts +45 -68
- package/generated/versions/defold-1.13.0/tilemap.d.ts +18 -11
- package/generated/versions/defold-1.13.0/timer.d.ts +5 -3
- package/generated/versions/defold-1.13.0/vmath.d.ts +5 -26
- package/generated/versions/defold-1.13.0/window.d.ts +1 -16
- package/generated/versions/defold-1.13.1/b2d.d.ts +33 -0
- package/generated/versions/defold-1.13.1/b2d_body.d.ts +636 -0
- package/generated/versions/defold-1.13.1/b2d_chain.d.ts +106 -0
- package/generated/versions/defold-1.13.1/b2d_fixture.d.ts +157 -0
- package/generated/versions/defold-1.13.1/b2d_joint.d.ts +823 -0
- package/generated/versions/defold-1.13.1/b2d_shape.d.ts +400 -0
- package/generated/versions/defold-1.13.1/b2d_world.d.ts +320 -0
- package/generated/versions/defold-1.13.1/buffer.d.ts +189 -0
- package/generated/versions/defold-1.13.1/camera.d.ts +303 -0
- package/generated/versions/defold-1.13.1/collectionfactory.d.ts +151 -0
- package/generated/versions/defold-1.13.1/collectionproxy.d.ts +93 -0
- package/generated/versions/defold-1.13.1/compute.d.ts +237 -0
- package/generated/versions/defold-1.13.1/crash.d.ts +143 -0
- package/generated/versions/defold-1.13.1/editor-vm/http.d.ts +56 -0
- package/generated/versions/defold-1.13.1/editor-vm/image.d.ts +48 -0
- package/generated/versions/defold-1.13.1/editor-vm/json.d.ts +10 -0
- package/generated/versions/defold-1.13.1/editor-vm/localization.d.ts +42 -0
- package/generated/versions/defold-1.13.1/editor-vm/tilemap_tiles.d.ts +80 -0
- package/generated/versions/defold-1.13.1/editor-vm/zip.d.ts +10 -0
- package/generated/versions/defold-1.13.1/editor-vm/zlib.d.ts +24 -0
- package/generated/versions/defold-1.13.1/editor.d.ts +1121 -0
- package/generated/versions/defold-1.13.1/factory.d.ts +124 -0
- package/generated/versions/defold-1.13.1/font.d.ts +81 -0
- package/generated/versions/defold-1.13.1/go.d.ts +1107 -0
- package/generated/versions/defold-1.13.1/graphics.d.ts +411 -0
- package/generated/versions/defold-1.13.1/gui.d.ts +2353 -0
- package/generated/versions/defold-1.13.1/html5.d.ts +55 -0
- package/generated/versions/defold-1.13.1/http.d.ts +77 -0
- package/generated/versions/defold-1.13.1/image.d.ts +131 -0
- package/generated/versions/defold-1.13.1/index.d.ts +57 -0
- package/generated/versions/defold-1.13.1/json.d.ts +80 -0
- package/generated/versions/defold-1.13.1/kinds/editor-script.d.ts +14 -0
- package/generated/versions/defold-1.13.1/label.d.ts +93 -0
- package/generated/versions/defold-1.13.1/liveupdate.d.ts +142 -0
- package/generated/versions/defold-1.13.1/material.d.ts +408 -0
- package/generated/versions/defold-1.13.1/model.d.ts +272 -0
- package/generated/versions/defold-1.13.1/msg.d.ts +10 -0
- package/generated/versions/defold-1.13.1/particlefx.d.ts +163 -0
- package/generated/versions/defold-1.13.1/physics.d.ts +559 -0
- package/generated/versions/defold-1.13.1/profiler.d.ts +235 -0
- package/generated/versions/defold-1.13.1/render.d.ts +1190 -0
- package/generated/versions/defold-1.13.1/resource.d.ts +1523 -0
- package/generated/versions/defold-1.13.1/socket.d.ts +784 -0
- package/generated/versions/defold-1.13.1/sound.d.ts +292 -0
- package/generated/versions/defold-1.13.1/sprite.d.ts +175 -0
- package/generated/versions/defold-1.13.1/sys.d.ts +678 -0
- package/generated/versions/defold-1.13.1/tilemap.d.ts +208 -0
- package/generated/versions/defold-1.13.1/timer.d.ts +125 -0
- package/generated/versions/defold-1.13.1/types.d.ts +61 -0
- package/generated/versions/defold-1.13.1/vmath.d.ts +774 -0
- package/generated/versions/defold-1.13.1/window.d.ts +183 -0
- package/generated/versions/defold-1.13.1/zlib.d.ts +41 -0
- package/generated/vmath.d.ts +6 -26
- package/generated/window.d.ts +71 -71
- package/identity-vocabulary.json +561 -0
- package/index.d.ts +8 -0
- package/package.json +13 -2
- package/scripts/example-store-io.ts +12 -1
- package/scripts/extension-goldens.ts +1 -0
- package/scripts/fidelity-baseline.json +146 -46
- package/scripts/generate-api-availability.ts +90 -12
- package/scripts/generate-api-signatures.ts +14 -3
- package/scripts/import-defold-release.ts +85 -24
- package/scripts/prose-constants.ts +157 -0
- package/scripts/regen.ts +396 -78
- package/scripts/shared-handle-methods.ts +53 -0
- package/scripts/signature-store-fs.ts +1 -0
- package/scripts/sync-api-docs.ts +16 -5
- package/src/api-availability.ts +0 -0
- package/src/api-doc.ts +201 -3
- package/src/api-identity.ts +252 -0
- package/src/component-properties.d.ts +33 -0
- package/src/core-types.ts +28 -3
- package/src/correction-pins.ts +49 -0
- package/src/custom-messages.d.ts +4 -3
- package/src/doc-comment.ts +139 -23
- package/src/doc-corrections.ts +108 -0
- package/src/editor-vm-globals.d.ts +5 -2
- package/src/emit-dts.ts +2474 -281
- package/src/emit-messages.ts +52 -0
- package/src/engine-globals.d.ts +2 -2
- package/src/example-store.ts +125 -14
- package/src/field-correction-coverage.ts +204 -0
- package/src/fnv1a.ts +16 -0
- package/src/go-overloads.d.ts +33 -13
- package/src/index-base-table.ts +145 -0
- package/src/index-slot-classifications.ts +588 -0
- package/src/index.ts +39 -2
- package/src/library-index-slot-classifications.ts +332 -0
- package/src/lifecycle.ts +61 -199
- package/src/luals-type-expr.ts +354 -0
- package/src/msg-overloads.d.ts +0 -1
- package/src/param-correction-provenance.ts +64 -0
- package/src/return-correction-provenance.ts +58 -16
- package/src/script-api.ts +3 -1
- package/src/sys-overloads.d.ts +48 -0
- package/src/vmath-overloads.d.ts +27 -1
- package/src/window-event-guard.d.ts +6 -9
- package/url-parameters.json +1 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
|
-
import type { Hash, Opaque, Quaternion, Url, Vector, Vector3, Vector4 } from "../../../src/core-types";
|
|
2
|
+
import type { Hash, Matrix4, Opaque, Quaternion, Url, Vector, Vector3, Vector4 } from "../../../src/core-types";
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
5
5
|
/**
|
|
@@ -336,55 +336,55 @@ declare global {
|
|
|
336
336
|
/**
|
|
337
337
|
* color property
|
|
338
338
|
*/
|
|
339
|
-
const PROP_COLOR:
|
|
339
|
+
const PROP_COLOR: string & { readonly __brand: "gui.PROP_COLOR" };
|
|
340
340
|
/**
|
|
341
341
|
* euler property
|
|
342
342
|
*/
|
|
343
|
-
const PROP_EULER:
|
|
343
|
+
const PROP_EULER: string & { readonly __brand: "gui.PROP_EULER" };
|
|
344
344
|
/**
|
|
345
345
|
* fill_angle property
|
|
346
346
|
*/
|
|
347
|
-
const PROP_FILL_ANGLE:
|
|
347
|
+
const PROP_FILL_ANGLE: string & { readonly __brand: "gui.PROP_FILL_ANGLE" };
|
|
348
348
|
/**
|
|
349
349
|
* inner_radius property
|
|
350
350
|
*/
|
|
351
|
-
const PROP_INNER_RADIUS:
|
|
351
|
+
const PROP_INNER_RADIUS: string & { readonly __brand: "gui.PROP_INNER_RADIUS" };
|
|
352
352
|
/**
|
|
353
353
|
* leading property
|
|
354
354
|
*/
|
|
355
|
-
const PROP_LEADING:
|
|
355
|
+
const PROP_LEADING: string & { readonly __brand: "gui.PROP_LEADING" };
|
|
356
356
|
/**
|
|
357
357
|
* outline color property
|
|
358
358
|
*/
|
|
359
|
-
const PROP_OUTLINE:
|
|
359
|
+
const PROP_OUTLINE: string & { readonly __brand: "gui.PROP_OUTLINE" };
|
|
360
360
|
/**
|
|
361
361
|
* position property
|
|
362
362
|
*/
|
|
363
|
-
const PROP_POSITION:
|
|
363
|
+
const PROP_POSITION: string & { readonly __brand: "gui.PROP_POSITION" };
|
|
364
364
|
/**
|
|
365
365
|
* rotation property
|
|
366
366
|
*/
|
|
367
|
-
const PROP_ROTATION:
|
|
367
|
+
const PROP_ROTATION: string & { readonly __brand: "gui.PROP_ROTATION" };
|
|
368
368
|
/**
|
|
369
369
|
* scale property
|
|
370
370
|
*/
|
|
371
|
-
const PROP_SCALE:
|
|
371
|
+
const PROP_SCALE: string & { readonly __brand: "gui.PROP_SCALE" };
|
|
372
372
|
/**
|
|
373
373
|
* shadow color property
|
|
374
374
|
*/
|
|
375
|
-
const PROP_SHADOW:
|
|
375
|
+
const PROP_SHADOW: string & { readonly __brand: "gui.PROP_SHADOW" };
|
|
376
376
|
/**
|
|
377
377
|
* size property
|
|
378
378
|
*/
|
|
379
|
-
const PROP_SIZE:
|
|
379
|
+
const PROP_SIZE: string & { readonly __brand: "gui.PROP_SIZE" };
|
|
380
380
|
/**
|
|
381
381
|
* slice9 property
|
|
382
382
|
*/
|
|
383
|
-
const PROP_SLICE9:
|
|
383
|
+
const PROP_SLICE9: string & { readonly __brand: "gui.PROP_SLICE9" };
|
|
384
384
|
/**
|
|
385
385
|
* tracking property
|
|
386
386
|
*/
|
|
387
|
-
const PROP_TRACKING:
|
|
387
|
+
const PROP_TRACKING: string & { readonly __brand: "gui.PROP_TRACKING" };
|
|
388
388
|
/**
|
|
389
389
|
* The provided data is not in the expected format or is in some other way
|
|
390
390
|
* incorrect, for instance the image data provided to gui.new_texture().
|
|
@@ -464,57 +464,33 @@ declare global {
|
|
|
464
464
|
* @param property - property to animate
|
|
465
465
|
*
|
|
466
466
|
* - `"position"`
|
|
467
|
-
*
|
|
468
467
|
* - `"rotation"`
|
|
469
|
-
*
|
|
470
468
|
* - `"euler"`
|
|
471
|
-
*
|
|
472
469
|
* - `"scale"`
|
|
473
|
-
*
|
|
474
470
|
* - `"color"`
|
|
475
|
-
*
|
|
476
471
|
* - `"outline"`
|
|
477
|
-
*
|
|
478
472
|
* - `"shadow"`
|
|
479
|
-
*
|
|
480
473
|
* - `"size"`
|
|
481
|
-
*
|
|
482
474
|
* - `"fill_angle"` (pie)
|
|
483
|
-
*
|
|
484
475
|
* - `"inner_radius"` (pie)
|
|
485
|
-
*
|
|
486
476
|
* - `"leading"` (text)
|
|
487
|
-
*
|
|
488
477
|
* - `"tracking"` (text)
|
|
489
|
-
*
|
|
490
478
|
* - `"slice9"` (slice9)
|
|
491
479
|
*
|
|
492
480
|
* The following property constants are defined equaling the corresponding property string names.
|
|
493
481
|
*
|
|
494
482
|
* - `gui.PROP_POSITION`
|
|
495
|
-
*
|
|
496
483
|
* - `gui.PROP_ROTATION`
|
|
497
|
-
*
|
|
498
484
|
* - `gui.PROP_EULER`
|
|
499
|
-
*
|
|
500
485
|
* - `gui.PROP_SCALE`
|
|
501
|
-
*
|
|
502
486
|
* - `gui.PROP_COLOR`
|
|
503
|
-
*
|
|
504
487
|
* - `gui.PROP_OUTLINE`
|
|
505
|
-
*
|
|
506
488
|
* - `gui.PROP_SHADOW`
|
|
507
|
-
*
|
|
508
489
|
* - `gui.PROP_SIZE`
|
|
509
|
-
*
|
|
510
490
|
* - `gui.PROP_FILL_ANGLE`
|
|
511
|
-
*
|
|
512
491
|
* - `gui.PROP_INNER_RADIUS`
|
|
513
|
-
*
|
|
514
492
|
* - `gui.PROP_LEADING`
|
|
515
|
-
*
|
|
516
493
|
* - `gui.PROP_TRACKING`
|
|
517
|
-
*
|
|
518
494
|
* - `gui.PROP_SLICE9`
|
|
519
495
|
* @param to - target property value
|
|
520
496
|
* @param easing - easing to use during animation.
|
|
@@ -527,15 +503,10 @@ declare global {
|
|
|
527
503
|
* @param playback - playback mode
|
|
528
504
|
*
|
|
529
505
|
* - `gui.PLAYBACK_ONCE_FORWARD`
|
|
530
|
-
*
|
|
531
506
|
* - `gui.PLAYBACK_ONCE_BACKWARD`
|
|
532
|
-
*
|
|
533
507
|
* - `gui.PLAYBACK_ONCE_PINGPONG`
|
|
534
|
-
*
|
|
535
508
|
* - `gui.PLAYBACK_LOOP_FORWARD`
|
|
536
|
-
*
|
|
537
509
|
* - `gui.PLAYBACK_LOOP_BACKWARD`
|
|
538
|
-
*
|
|
539
510
|
* - `gui.PLAYBACK_LOOP_PINGPONG`
|
|
540
511
|
* @example
|
|
541
512
|
* How to start a simple color animation, where the node fades in to white during 0.5 seconds:
|
|
@@ -585,7 +556,7 @@ declare global {
|
|
|
585
556
|
* });
|
|
586
557
|
* ```
|
|
587
558
|
*/
|
|
588
|
-
function animate(node: Opaque<"node">, property: string | gui.Property, to: number | Vector3 | Vector4 | Quaternion, easing: gui.Easing | Vector, duration: number, delay?: number, complete_function?: (self: unknown, node: unknown) => void, playback?: gui.Playback): void;
|
|
559
|
+
function animate(node: Opaque<"node">, property: string | gui.Property | Hash, to: number | Vector3 | Vector4 | Quaternion, easing: gui.Easing | Vector, duration: number, delay?: number, complete_function?: (self: unknown, node: unknown) => void, playback?: gui.Playback): void;
|
|
589
560
|
/**
|
|
590
561
|
* If one or more animations of the specified node is currently running (started by `gui.animate`), they will immediately be canceled.
|
|
591
562
|
*
|
|
@@ -593,52 +564,43 @@ declare global {
|
|
|
593
564
|
* @param property - optional property for which the animation should be canceled
|
|
594
565
|
*
|
|
595
566
|
* - `"position"`
|
|
596
|
-
*
|
|
597
567
|
* - `"rotation"`
|
|
598
|
-
*
|
|
599
568
|
* - `"euler"`
|
|
600
|
-
*
|
|
601
569
|
* - `"scale"`
|
|
602
|
-
*
|
|
603
570
|
* - `"color"`
|
|
604
|
-
*
|
|
605
571
|
* - `"outline"`
|
|
606
|
-
*
|
|
607
572
|
* - `"shadow"`
|
|
608
|
-
*
|
|
609
573
|
* - `"size"`
|
|
610
|
-
*
|
|
611
574
|
* - `"fill_angle"` (pie)
|
|
612
|
-
*
|
|
613
575
|
* - `"inner_radius"` (pie)
|
|
614
|
-
*
|
|
615
576
|
* - `"leading"` (text)
|
|
616
|
-
*
|
|
617
577
|
* - `"tracking"` (text)
|
|
618
|
-
*
|
|
619
578
|
* - `"slice9"` (slice9)
|
|
620
579
|
* @example
|
|
580
|
+
* Start an animation of the position property of a node, then cancel parts of
|
|
581
|
+
* the animation:
|
|
621
582
|
* ```ts
|
|
622
|
-
* // Start an animation of the position property of a node, then cancel parts of
|
|
623
|
-
* // the animation:
|
|
624
583
|
* const node = gui.get_node("my_node");
|
|
625
584
|
* // animate to new position
|
|
626
585
|
* const pos = vmath.vector3(100, 100, 0);
|
|
627
|
-
* gui.animate(node, "position", pos,
|
|
586
|
+
* gui.animate(node, "position", pos, gui.EASING_LINEAR, 2);
|
|
628
587
|
* // ...
|
|
629
588
|
* // cancel animation of the x component.
|
|
630
589
|
* gui.cancel_animations(node, "position.x");
|
|
631
|
-
*
|
|
632
|
-
*
|
|
590
|
+
* ```
|
|
591
|
+
* @example
|
|
592
|
+
* Cancels all property animations on a node in a single call:
|
|
593
|
+
* ```ts
|
|
594
|
+
* const node = gui.get_node("my_node");
|
|
633
595
|
* // animate to new position and scale
|
|
634
|
-
* gui.animate(node, "position", vmath.vector3(100, 100, 0),
|
|
635
|
-
* gui.animate(node, "scale", vmath.vector3(0.5),
|
|
596
|
+
* gui.animate(node, "position", vmath.vector3(100, 100, 0), gui.EASING_LINEAR, 5);
|
|
597
|
+
* gui.animate(node, "scale", vmath.vector3(0.5), gui.EASING_LINEAR, 5);
|
|
636
598
|
* // ...
|
|
637
599
|
* // cancel positioning and scaling at once
|
|
638
600
|
* gui.cancel_animations(node);
|
|
639
601
|
* ```
|
|
640
602
|
*/
|
|
641
|
-
function cancel_animations(node: Opaque<"node">, property?: string | gui.Property): void;
|
|
603
|
+
function cancel_animations(node: Opaque<"node">, property?: string | gui.Property | Hash): void;
|
|
642
604
|
/**
|
|
643
605
|
* Cancels any running flipbook animation on the specified node.
|
|
644
606
|
*
|
|
@@ -713,6 +675,10 @@ declare global {
|
|
|
713
675
|
* @example
|
|
714
676
|
* ```ts
|
|
715
677
|
* export default defineScript({
|
|
678
|
+
* init() {
|
|
679
|
+
* return { some_value: 0 };
|
|
680
|
+
* },
|
|
681
|
+
*
|
|
716
682
|
* final(self) {
|
|
717
683
|
* // report finalization
|
|
718
684
|
* msg.post("my_friend_instance", "im_dead", { my_stats: self.some_value });
|
|
@@ -728,29 +694,17 @@ declare global {
|
|
|
728
694
|
* when operating in the gui namespace. Most notably, only these explicitly named properties are supported:
|
|
729
695
|
*
|
|
730
696
|
* - `"position"`
|
|
731
|
-
*
|
|
732
697
|
* - `"rotation"`
|
|
733
|
-
*
|
|
734
698
|
* - `"euler"`
|
|
735
|
-
*
|
|
736
699
|
* - `"scale"`
|
|
737
|
-
*
|
|
738
700
|
* - `"color"`
|
|
739
|
-
*
|
|
740
701
|
* - `"outline"`
|
|
741
|
-
*
|
|
742
702
|
* - `"shadow"`
|
|
743
|
-
*
|
|
744
703
|
* - `"size"`
|
|
745
|
-
*
|
|
746
704
|
* - `"fill_angle"` (pie)
|
|
747
|
-
*
|
|
748
705
|
* - `"inner_radius"` (pie)
|
|
749
|
-
*
|
|
750
706
|
* - `"leading"` (text)
|
|
751
|
-
*
|
|
752
707
|
* - `"tracking"` (text)
|
|
753
|
-
*
|
|
754
708
|
* - `"slice9"` (slice9)
|
|
755
709
|
*
|
|
756
710
|
* The value returned will either be a vmath.vector4 or a single number, i.e getting the "position"
|
|
@@ -761,6 +715,8 @@ declare global {
|
|
|
761
715
|
* @param property - the property to retrieve
|
|
762
716
|
* @param options - optional options table (only applicable for material constants)
|
|
763
717
|
* - `index` number index into array property (1 based)
|
|
718
|
+
*
|
|
719
|
+
* **⚠️ `index` is 1-based; passed to Defold unchanged.**
|
|
764
720
|
* @example
|
|
765
721
|
* ```ts
|
|
766
722
|
* // Get properties on existing nodes:
|
|
@@ -768,7 +724,7 @@ declare global {
|
|
|
768
724
|
* const node_position = gui.get(node, "position");
|
|
769
725
|
* ```
|
|
770
726
|
*/
|
|
771
|
-
function get(node: Opaque<"node">, property: string | Hash | gui.Property, options?: { index?: number }): unknown;
|
|
727
|
+
function get(node: Opaque<"node">, property: string | Hash | gui.Property, options?: { index?: number; key?: string | Hash; keys?: (Hash | string)[] }): unknown;
|
|
772
728
|
/**
|
|
773
729
|
* Returns the adjust mode of a node.
|
|
774
730
|
* The adjust mode defines how the node will adjust itself to screen
|
|
@@ -778,9 +734,7 @@ declare global {
|
|
|
778
734
|
* @returns the current adjust mode
|
|
779
735
|
*
|
|
780
736
|
* - `gui.ADJUST_FIT`
|
|
781
|
-
*
|
|
782
737
|
* - `gui.ADJUST_ZOOM`
|
|
783
|
-
*
|
|
784
738
|
* - `gui.ADJUST_STRETCH`
|
|
785
739
|
*/
|
|
786
740
|
function get_adjust_mode(node: Opaque<"node">): gui.AdjustMode;
|
|
@@ -799,13 +753,9 @@ declare global {
|
|
|
799
753
|
* @returns blend mode
|
|
800
754
|
*
|
|
801
755
|
* - `gui.BLEND_ALPHA`
|
|
802
|
-
*
|
|
803
756
|
* - `gui.BLEND_ADD`
|
|
804
|
-
*
|
|
805
757
|
* - `gui.BLEND_ADD_ALPHA`
|
|
806
|
-
*
|
|
807
758
|
* - `gui.BLEND_MULT`
|
|
808
|
-
*
|
|
809
759
|
* - `gui.BLEND_SCREEN`
|
|
810
760
|
*/
|
|
811
761
|
function get_blend_mode(node: Opaque<"node">): gui.BlendMode;
|
|
@@ -823,7 +773,6 @@ declare global {
|
|
|
823
773
|
* @returns clipping mode
|
|
824
774
|
*
|
|
825
775
|
* - `gui.CLIPPING_MODE_NONE`
|
|
826
|
-
*
|
|
827
776
|
* - `gui.CLIPPING_MODE_STENCIL`
|
|
828
777
|
*/
|
|
829
778
|
function get_clipping_mode(node: Opaque<"node">): gui.ClippingMode;
|
|
@@ -946,7 +895,7 @@ declare global {
|
|
|
946
895
|
* Higher index means the node is drawn on top of lower indexed nodes.
|
|
947
896
|
*
|
|
948
897
|
* @param node - the node to retrieve the id from
|
|
949
|
-
* @returns the index of the node
|
|
898
|
+
* @returns the index of the node. **0️⃣ 0-based; passed to Defold unchanged.**
|
|
950
899
|
* @example
|
|
951
900
|
* ```ts
|
|
952
901
|
* // Compare the index order of two sibling nodes:
|
|
@@ -1049,7 +998,6 @@ declare global {
|
|
|
1049
998
|
* @returns the outer bounds mode of the pie node:
|
|
1050
999
|
*
|
|
1051
1000
|
* - `gui.PIEBOUNDS_RECTANGLE`
|
|
1052
|
-
*
|
|
1053
1001
|
* - `gui.PIEBOUNDS_ELLIPSE`
|
|
1054
1002
|
*/
|
|
1055
1003
|
function get_outer_bounds(node: Opaque<"node">): gui.PieBounds;
|
|
@@ -1091,21 +1039,13 @@ declare global {
|
|
|
1091
1039
|
* @returns pivot constant
|
|
1092
1040
|
*
|
|
1093
1041
|
* - `gui.PIVOT_CENTER`
|
|
1094
|
-
*
|
|
1095
1042
|
* - `gui.PIVOT_N`
|
|
1096
|
-
*
|
|
1097
1043
|
* - `gui.PIVOT_NE`
|
|
1098
|
-
*
|
|
1099
1044
|
* - `gui.PIVOT_E`
|
|
1100
|
-
*
|
|
1101
1045
|
* - `gui.PIVOT_SE`
|
|
1102
|
-
*
|
|
1103
1046
|
* - `gui.PIVOT_S`
|
|
1104
|
-
*
|
|
1105
1047
|
* - `gui.PIVOT_SW`
|
|
1106
|
-
*
|
|
1107
1048
|
* - `gui.PIVOT_W`
|
|
1108
|
-
*
|
|
1109
1049
|
* - `gui.PIVOT_NW`
|
|
1110
1050
|
*/
|
|
1111
1051
|
function get_pivot(node: Opaque<"node">): gui.Pivot;
|
|
@@ -1167,7 +1107,6 @@ declare global {
|
|
|
1167
1107
|
* @returns the current size mode
|
|
1168
1108
|
*
|
|
1169
1109
|
* - `gui.SIZE_MODE_MANUAL`
|
|
1170
|
-
*
|
|
1171
1110
|
* - `gui.SIZE_MODE_AUTO`
|
|
1172
1111
|
*/
|
|
1173
1112
|
function get_size_mode(node: Opaque<"node">): gui.SizeMode;
|
|
@@ -1235,9 +1174,7 @@ declare global {
|
|
|
1235
1174
|
* @returns anchor constant
|
|
1236
1175
|
*
|
|
1237
1176
|
* - `gui.ANCHOR_NONE`
|
|
1238
|
-
*
|
|
1239
1177
|
* - `gui.ANCHOR_LEFT`
|
|
1240
|
-
*
|
|
1241
1178
|
* - `gui.ANCHOR_RIGHT`
|
|
1242
1179
|
*/
|
|
1243
1180
|
function get_xanchor(node: Opaque<"node">): gui.XAnchor;
|
|
@@ -1248,9 +1185,7 @@ declare global {
|
|
|
1248
1185
|
* @returns anchor constant
|
|
1249
1186
|
*
|
|
1250
1187
|
* - `gui.ANCHOR_NONE`
|
|
1251
|
-
*
|
|
1252
1188
|
* - `gui.ANCHOR_TOP`
|
|
1253
|
-
*
|
|
1254
1189
|
* - `gui.ANCHOR_BOTTOM`
|
|
1255
1190
|
*/
|
|
1256
1191
|
function get_yanchor(node: Opaque<"node">): gui.YAnchor;
|
|
@@ -1291,7 +1226,7 @@ declare global {
|
|
|
1291
1226
|
* @param node - to move
|
|
1292
1227
|
* @param reference - reference node above which the first node should be moved
|
|
1293
1228
|
*/
|
|
1294
|
-
function move_above(node: Opaque<"node">, reference
|
|
1229
|
+
function move_above(node: Opaque<"node">, reference: Opaque<"node"> | undefined): void;
|
|
1295
1230
|
/**
|
|
1296
1231
|
* Alters the ordering of the two supplied nodes by moving the first node
|
|
1297
1232
|
* below the second.
|
|
@@ -1300,7 +1235,7 @@ declare global {
|
|
|
1300
1235
|
* @param node - to move
|
|
1301
1236
|
* @param reference - reference node below which the first node should be moved
|
|
1302
1237
|
*/
|
|
1303
|
-
function move_below(node: Opaque<"node">, reference
|
|
1238
|
+
function move_below(node: Opaque<"node">, reference: Opaque<"node"> | undefined): void;
|
|
1304
1239
|
/**
|
|
1305
1240
|
* Dynamically create a new box node.
|
|
1306
1241
|
*
|
|
@@ -1342,17 +1277,14 @@ declare global {
|
|
|
1342
1277
|
* @param type - texture type
|
|
1343
1278
|
*
|
|
1344
1279
|
* - `"rgb"` - RGB
|
|
1345
|
-
*
|
|
1346
1280
|
* - `"rgba"` - RGBA
|
|
1347
|
-
*
|
|
1348
1281
|
* - `"l"` - LUMINANCE
|
|
1349
|
-
*
|
|
1350
1282
|
* - `"astc"` - ASTC compressed format
|
|
1351
1283
|
* @param buffer - texture data
|
|
1352
1284
|
* @param flip - flip texture vertically
|
|
1353
1285
|
* @example
|
|
1286
|
+
* How to create a texture and apply it to a new box node:
|
|
1354
1287
|
* ```ts
|
|
1355
|
-
* // How to create a texture and apply it to a new box node:
|
|
1356
1288
|
* export default defineGuiScript({
|
|
1357
1289
|
* init(self) {
|
|
1358
1290
|
* const w = 200;
|
|
@@ -1377,20 +1309,24 @@ declare global {
|
|
|
1377
1309
|
* }
|
|
1378
1310
|
* },
|
|
1379
1311
|
* });
|
|
1380
|
-
*
|
|
1381
|
-
*
|
|
1312
|
+
* ```
|
|
1313
|
+
* @example
|
|
1314
|
+
* How to create a texture using .astc format
|
|
1315
|
+
* ```ts
|
|
1382
1316
|
* const size = 4;
|
|
1383
1317
|
* const pos = vmath.vector3(200, 200, 0);
|
|
1384
1318
|
* const path = "/assets/images/logo_4x4.astc";
|
|
1385
|
-
* const
|
|
1386
|
-
*
|
|
1387
|
-
*
|
|
1388
|
-
*
|
|
1389
|
-
*
|
|
1390
|
-
*
|
|
1319
|
+
* const [data] = sys.load_resource(path);
|
|
1320
|
+
* if (data !== undefined) {
|
|
1321
|
+
* const n = gui.new_box_node(pos, vmath.vector3(size, size, 0));
|
|
1322
|
+
* // size is read from the .astc buffer
|
|
1323
|
+
* // flip is not supported
|
|
1324
|
+
* gui.new_texture(path, 0, 0, "astc", data, false);
|
|
1325
|
+
* gui.set_texture(n, path);
|
|
1326
|
+
* }
|
|
1391
1327
|
* ```
|
|
1392
1328
|
*/
|
|
1393
|
-
function new_texture(texture_id: string | Hash, width: number, height: number, type: string | Opaque<"constant">, buffer: string, flip?: boolean): LuaMultiReturn<[boolean, number]>;
|
|
1329
|
+
function new_texture(texture_id: string | Hash, width: number, height: number, type: string | Opaque<"constant">, buffer: string, flip?: boolean): LuaMultiReturn<[boolean, number | undefined]>;
|
|
1394
1330
|
/**
|
|
1395
1331
|
* This is a callback-function, which is called by the engine when user input is sent to the instance of the gui component.
|
|
1396
1332
|
* It can be used to take action on the input, e.g. modify the gui according to the input.
|
|
@@ -1527,11 +1463,15 @@ declare global {
|
|
|
1527
1463
|
*
|
|
1528
1464
|
* @param self - reference to the script state to be used for storing data
|
|
1529
1465
|
* @param action_id - id of the received input action, as mapped in the input_binding-file
|
|
1530
|
-
* @param action - a table containing the input data, see above for a description
|
|
1466
|
+
* @param action - a table containing the input data, see above for a description. **0️⃣ `gamepad` is 0-based; passed to Defold unchanged.**
|
|
1531
1467
|
* @returns optional boolean to signal if the input should be consumed (not passed on to others) or not, default is false
|
|
1532
1468
|
* @example
|
|
1533
1469
|
* ```ts
|
|
1534
1470
|
* export default defineGuiScript({
|
|
1471
|
+
* init(): { my_value: number | undefined } {
|
|
1472
|
+
* return { my_value: undefined };
|
|
1473
|
+
* },
|
|
1474
|
+
*
|
|
1535
1475
|
* on_input(self, action_id, action) {
|
|
1536
1476
|
* // check for input
|
|
1537
1477
|
* if (action_id === hash("my_action")) {
|
|
@@ -1565,6 +1505,10 @@ declare global {
|
|
|
1565
1505
|
* @example
|
|
1566
1506
|
* ```ts
|
|
1567
1507
|
* export default defineGuiScript({
|
|
1508
|
+
* init() {
|
|
1509
|
+
* return { my_original_color: gui.get_color(gui.get_node("my_node")) };
|
|
1510
|
+
* },
|
|
1511
|
+
*
|
|
1568
1512
|
* on_reload(self) {
|
|
1569
1513
|
* // restore some color (or similar)
|
|
1570
1514
|
* gui.set_color(gui.get_node("my_node"), self.my_original_color);
|
|
@@ -1606,8 +1550,8 @@ declare global {
|
|
|
1606
1550
|
* `playback_rate`
|
|
1607
1551
|
* number The rate with which the animation will be played. Must be positive
|
|
1608
1552
|
* @example
|
|
1553
|
+
* Set the texture of a node to a flipbook animation from an atlas:
|
|
1609
1554
|
* ```ts
|
|
1610
|
-
* // Set the texture of a node to a flipbook animation from an atlas:
|
|
1611
1555
|
* function anim_callback(self: unknown, node: unknown) {
|
|
1612
1556
|
* // Take action after animation has played.
|
|
1613
1557
|
* }
|
|
@@ -1620,8 +1564,10 @@ declare global {
|
|
|
1620
1564
|
* gui.play_flipbook(node, "animated_button");
|
|
1621
1565
|
* },
|
|
1622
1566
|
* });
|
|
1623
|
-
*
|
|
1624
|
-
*
|
|
1567
|
+
* ```
|
|
1568
|
+
* @example
|
|
1569
|
+
* Set the texture of a node to an image from an atlas:
|
|
1570
|
+
* ```ts
|
|
1625
1571
|
* // Create a new node and set the texture to a "button.png" from atlas
|
|
1626
1572
|
* const node = gui.get_node("button_node");
|
|
1627
1573
|
* gui.set_texture(node, "gui_sprites");
|
|
@@ -1645,11 +1591,8 @@ declare global {
|
|
|
1645
1591
|
* constant the new state of the emitter:
|
|
1646
1592
|
*
|
|
1647
1593
|
* - `particlefx.EMITTER_STATE_SLEEPING`
|
|
1648
|
-
*
|
|
1649
1594
|
* - `particlefx.EMITTER_STATE_PRESPAWN`
|
|
1650
|
-
*
|
|
1651
1595
|
* - `particlefx.EMITTER_STATE_SPAWNING`
|
|
1652
|
-
*
|
|
1653
1596
|
* - `particlefx.EMITTER_STATE_POSTSPAWN`
|
|
1654
1597
|
* @example
|
|
1655
1598
|
* ```ts
|
|
@@ -1699,7 +1642,7 @@ declare global {
|
|
|
1699
1642
|
* @param screen_position - screen position
|
|
1700
1643
|
* @returns local position
|
|
1701
1644
|
*/
|
|
1702
|
-
function screen_to_local(node: Opaque<"node">, screen_position: Vector3): Vector3;
|
|
1645
|
+
function screen_to_local(node: Opaque<"node">, screen_position: Vector3 | Vector4): Vector3;
|
|
1703
1646
|
/**
|
|
1704
1647
|
* Instead of using specific setteres such as gui.set_position or gui.set_scale,
|
|
1705
1648
|
* you can use gui.set instead and supply the property as a string or a hash.
|
|
@@ -1707,29 +1650,17 @@ declare global {
|
|
|
1707
1650
|
* when operating in the gui namespace. Most notably, only these named properties identifiers are supported:
|
|
1708
1651
|
*
|
|
1709
1652
|
* - `"position"`
|
|
1710
|
-
*
|
|
1711
1653
|
* - `"rotation"`
|
|
1712
|
-
*
|
|
1713
1654
|
* - `"euler"`
|
|
1714
|
-
*
|
|
1715
1655
|
* - `"scale"`
|
|
1716
|
-
*
|
|
1717
1656
|
* - `"color"`
|
|
1718
|
-
*
|
|
1719
1657
|
* - `"outline"`
|
|
1720
|
-
*
|
|
1721
1658
|
* - `"shadow"`
|
|
1722
|
-
*
|
|
1723
1659
|
* - `"size"`
|
|
1724
|
-
*
|
|
1725
1660
|
* - `"fill_angle"` (pie)
|
|
1726
|
-
*
|
|
1727
1661
|
* - `"inner_radius"` (pie)
|
|
1728
|
-
*
|
|
1729
1662
|
* - `"leading"` (text)
|
|
1730
|
-
*
|
|
1731
1663
|
* - `"tracking"` (text)
|
|
1732
|
-
*
|
|
1733
1664
|
* - `"slice9"` (slice9)
|
|
1734
1665
|
*
|
|
1735
1666
|
* The value to set must either be a vmath.vector4, vmath.vector3, vmath.quat or a single number and depends on the property name you want to set.
|
|
@@ -1749,14 +1680,19 @@ declare global {
|
|
|
1749
1680
|
* @param options - optional options table (only applicable for material constants)
|
|
1750
1681
|
* - `index` number index into array property (1 based)
|
|
1751
1682
|
* - `key` hash name of internal property
|
|
1683
|
+
*
|
|
1684
|
+
* **⚠️ `index` is 1-based; passed to Defold unchanged.**
|
|
1752
1685
|
* @example
|
|
1686
|
+
* Updates the position property on an existing node:
|
|
1753
1687
|
* ```ts
|
|
1754
|
-
* // Updates the position property on an existing node:
|
|
1755
1688
|
* const node = gui.get_node("my_box_node");
|
|
1756
|
-
* const node_position = gui.get(node, "position");
|
|
1689
|
+
* const node_position = gui.get(node, "position") as Vector3;
|
|
1757
1690
|
* gui.set(node, "position.x", node_position.x + 128);
|
|
1758
|
-
*
|
|
1759
|
-
*
|
|
1691
|
+
* ```
|
|
1692
|
+
* @example
|
|
1693
|
+
* Updates the rotation property on an existing node:
|
|
1694
|
+
* ```ts
|
|
1695
|
+
* const node = gui.get_node("my_box_node");
|
|
1760
1696
|
* gui.set(node, "rotation", vmath.quat_rotation_z(math.rad(45)));
|
|
1761
1697
|
* // this is equivalent to:
|
|
1762
1698
|
* gui.set(node, "euler.z", 45);
|
|
@@ -1764,8 +1700,11 @@ declare global {
|
|
|
1764
1700
|
* gui.set(node, "euler", vmath.vector3(0, 0, 45));
|
|
1765
1701
|
* // or using the set_rotation
|
|
1766
1702
|
* gui.set_rotation(node, vmath.vector3(0, 0, 45));
|
|
1767
|
-
*
|
|
1768
|
-
*
|
|
1703
|
+
* ```
|
|
1704
|
+
* @example
|
|
1705
|
+
* Sets various material constants for a node:
|
|
1706
|
+
* ```ts
|
|
1707
|
+
* const node = gui.get_node("my_box_node");
|
|
1769
1708
|
* gui.set(node, "tint", vmath.vector4(1, 0, 0, 1));
|
|
1770
1709
|
* // matrix4 is also supported
|
|
1771
1710
|
* gui.set(node, "light_matrix", vmath.matrix4());
|
|
@@ -1779,14 +1718,16 @@ declare global {
|
|
|
1779
1718
|
* gui.set(node, "tint.x", 1);
|
|
1780
1719
|
* // update a sub-element in an array constant at position 4
|
|
1781
1720
|
* gui.set(node, "tint_array.x", 1, { index: 4 });
|
|
1782
|
-
*
|
|
1783
|
-
*
|
|
1721
|
+
* ```
|
|
1722
|
+
* @example
|
|
1723
|
+
* Set a named property
|
|
1724
|
+
* ```ts
|
|
1784
1725
|
* export default defineGuiScript({
|
|
1785
1726
|
* on_message(self, message_id, message) {
|
|
1786
|
-
* if (message_id === hash("set_font")) {
|
|
1727
|
+
* if (message_id === hash("set_font") && types.is_hash(message.font)) {
|
|
1787
1728
|
* gui.set(msg.url(), "fonts", message.font, { key: "my_font_name" });
|
|
1788
1729
|
* gui.set_font(gui.get_node("text"), "my_font_name");
|
|
1789
|
-
* } else if (message_id === hash("set_texture")) {
|
|
1730
|
+
* } else if (message_id === hash("set_texture") && types.is_hash(message.texture)) {
|
|
1790
1731
|
* gui.set(msg.url(), "textures", message.texture, { key: "my_texture" });
|
|
1791
1732
|
* gui.set_texture(gui.get_node("box"), "my_texture");
|
|
1792
1733
|
* gui.play_flipbook(gui.get_node("box"), "logo_256");
|
|
@@ -1795,7 +1736,7 @@ declare global {
|
|
|
1795
1736
|
* });
|
|
1796
1737
|
* ```
|
|
1797
1738
|
*/
|
|
1798
|
-
function set(node: Opaque<"node"> | Url, property: string | Hash | gui.Property, value: number | Vector4 | Vector3 | Quaternion, options?: { index?: number; key?: Hash }): void;
|
|
1739
|
+
function set(node: Opaque<"node"> | Url, property: string | Hash | gui.Property, value: number | Vector4 | Vector3 | Quaternion | Matrix4 | Hash, options?: { index?: number; key?: string | Hash; keys?: (Hash | string)[] }): void;
|
|
1799
1740
|
/**
|
|
1800
1741
|
* Sets the adjust mode on a node.
|
|
1801
1742
|
* The adjust mode defines how the node will adjust itself to screen
|
|
@@ -1805,9 +1746,7 @@ declare global {
|
|
|
1805
1746
|
* @param adjust_mode - adjust mode to set
|
|
1806
1747
|
*
|
|
1807
1748
|
* - `gui.ADJUST_FIT`
|
|
1808
|
-
*
|
|
1809
1749
|
* - `gui.ADJUST_ZOOM`
|
|
1810
|
-
*
|
|
1811
1750
|
* - `gui.ADJUST_STRETCH`
|
|
1812
1751
|
*/
|
|
1813
1752
|
function set_adjust_mode(node: Opaque<"node">, adjust_mode: gui.AdjustMode): void;
|
|
@@ -1826,13 +1765,9 @@ declare global {
|
|
|
1826
1765
|
* @param blend_mode - blend mode to set
|
|
1827
1766
|
*
|
|
1828
1767
|
* - `gui.BLEND_ALPHA`
|
|
1829
|
-
*
|
|
1830
1768
|
* - `gui.BLEND_ADD`
|
|
1831
|
-
*
|
|
1832
1769
|
* - `gui.BLEND_ADD_ALPHA`
|
|
1833
|
-
*
|
|
1834
1770
|
* - `gui.BLEND_MULT`
|
|
1835
|
-
*
|
|
1836
1771
|
* - `gui.BLEND_SCREEN`
|
|
1837
1772
|
*/
|
|
1838
1773
|
function set_blend_mode(node: Opaque<"node">, blend_mode: gui.BlendMode): void;
|
|
@@ -1850,7 +1785,6 @@ declare global {
|
|
|
1850
1785
|
* @param clipping_mode - clipping mode to set
|
|
1851
1786
|
*
|
|
1852
1787
|
* - `gui.CLIPPING_MODE_NONE`
|
|
1853
|
-
*
|
|
1854
1788
|
* - `gui.CLIPPING_MODE_STENCIL`
|
|
1855
1789
|
*/
|
|
1856
1790
|
function set_clipping_mode(node: Opaque<"node">, clipping_mode: gui.ClippingMode): void;
|
|
@@ -2018,7 +1952,6 @@ declare global {
|
|
|
2018
1952
|
* @param bounds_mode - the outer bounds mode of the pie node:
|
|
2019
1953
|
*
|
|
2020
1954
|
* - `gui.PIEBOUNDS_RECTANGLE`
|
|
2021
|
-
*
|
|
2022
1955
|
* - `gui.PIEBOUNDS_ELLIPSE`
|
|
2023
1956
|
*/
|
|
2024
1957
|
function set_outer_bounds(node: Opaque<"node">, bounds_mode: gui.PieBounds): void;
|
|
@@ -2037,7 +1970,7 @@ declare global {
|
|
|
2037
1970
|
* @param parent - parent node to set, pass `nil` to remove parent
|
|
2038
1971
|
* @param keep_scene_transform - optional flag to make the scene position being perserved
|
|
2039
1972
|
*/
|
|
2040
|
-
function set_parent(node: Opaque<"node">, parent
|
|
1973
|
+
function set_parent(node: Opaque<"node">, parent: Opaque<"node"> | undefined, keep_scene_transform?: boolean): void;
|
|
2041
1974
|
/**
|
|
2042
1975
|
* Set the paricle fx for a gui node
|
|
2043
1976
|
*
|
|
@@ -2059,21 +1992,13 @@ declare global {
|
|
|
2059
1992
|
* @param pivot - pivot constant
|
|
2060
1993
|
*
|
|
2061
1994
|
* - `gui.PIVOT_CENTER`
|
|
2062
|
-
*
|
|
2063
1995
|
* - `gui.PIVOT_N`
|
|
2064
|
-
*
|
|
2065
1996
|
* - `gui.PIVOT_NE`
|
|
2066
|
-
*
|
|
2067
1997
|
* - `gui.PIVOT_E`
|
|
2068
|
-
*
|
|
2069
1998
|
* - `gui.PIVOT_SE`
|
|
2070
|
-
*
|
|
2071
1999
|
* - `gui.PIVOT_S`
|
|
2072
|
-
*
|
|
2073
2000
|
* - `gui.PIVOT_SW`
|
|
2074
|
-
*
|
|
2075
2001
|
* - `gui.PIVOT_W`
|
|
2076
|
-
*
|
|
2077
2002
|
* - `gui.PIVOT_NW`
|
|
2078
2003
|
*/
|
|
2079
2004
|
function set_pivot(node: Opaque<"node">, pivot: gui.Pivot): void;
|
|
@@ -2101,18 +2026,15 @@ declare global {
|
|
|
2101
2026
|
* @param node - node to set the rotation for
|
|
2102
2027
|
* @param rotation - new rotation
|
|
2103
2028
|
*/
|
|
2104
|
-
function set_rotation(node: Opaque<"node">, rotation: Quaternion | Vector4): void;
|
|
2029
|
+
function set_rotation(node: Opaque<"node">, rotation: Quaternion | Vector4 | Vector3): void;
|
|
2105
2030
|
/**
|
|
2106
2031
|
* Sets how the safe area is applied to this gui scene.
|
|
2107
2032
|
*
|
|
2108
2033
|
* @param mode - safe area mode
|
|
2109
2034
|
*
|
|
2110
2035
|
* - `gui.SAFE_AREA_NONE`
|
|
2111
|
-
*
|
|
2112
2036
|
* - `gui.SAFE_AREA_LONG`
|
|
2113
|
-
*
|
|
2114
2037
|
* - `gui.SAFE_AREA_SHORT`
|
|
2115
|
-
*
|
|
2116
2038
|
* - `gui.SAFE_AREA_BOTH`
|
|
2117
2039
|
*/
|
|
2118
2040
|
function set_safe_area_mode(mode: gui.SafeAreaMode): void;
|
|
@@ -2129,7 +2051,7 @@ declare global {
|
|
|
2129
2051
|
* @param node - node to set the screen position to
|
|
2130
2052
|
* @param screen_position - screen position
|
|
2131
2053
|
*/
|
|
2132
|
-
function set_screen_position(node: Opaque<"node">, screen_position: Vector3): void;
|
|
2054
|
+
function set_screen_position(node: Opaque<"node">, screen_position: Vector3 | Vector4): void;
|
|
2133
2055
|
/**
|
|
2134
2056
|
* Sets the shadow color of the supplied node.
|
|
2135
2057
|
* See gui.set_color for info how vectors encode color values.
|
|
@@ -2158,7 +2080,6 @@ declare global {
|
|
|
2158
2080
|
* @param size_mode - size mode to set
|
|
2159
2081
|
*
|
|
2160
2082
|
* - `gui.SIZE_MODE_MANUAL`
|
|
2161
|
-
*
|
|
2162
2083
|
* - `gui.SIZE_MODE_AUTO`
|
|
2163
2084
|
*/
|
|
2164
2085
|
function set_size_mode(node: Opaque<"node">, size_mode: gui.SizeMode): void;
|
|
@@ -2187,20 +2108,25 @@ declare global {
|
|
|
2187
2108
|
* @param node - node to set texture for
|
|
2188
2109
|
* @param texture - texture id
|
|
2189
2110
|
* @example
|
|
2111
|
+
* To set a texture (or animation) from an atlas:
|
|
2190
2112
|
* ```ts
|
|
2191
|
-
* // To set a texture (or animation) from an atlas:
|
|
2192
2113
|
* const node = gui.get_node("box_node");
|
|
2193
2114
|
* gui.set_texture(node, "my_atlas");
|
|
2194
2115
|
* gui.play_flipbook(node, "image");
|
|
2195
|
-
*
|
|
2196
|
-
*
|
|
2197
|
-
*
|
|
2116
|
+
* ```
|
|
2117
|
+
* @example
|
|
2118
|
+
* Set a dynamically created texture to a node. Note that there is only
|
|
2119
|
+
* one texture image in this case so `gui.set_texture()` is
|
|
2120
|
+
* sufficient.
|
|
2121
|
+
* ```ts
|
|
2198
2122
|
* const w = 200;
|
|
2199
2123
|
* const h = 300;
|
|
2200
2124
|
* // A nice orange. String with the RGB values.
|
|
2201
2125
|
* const orange = String.fromCharCode(0xff, 0x80, 0x10);
|
|
2202
2126
|
* // Create the texture. Repeat the color string for each pixel.
|
|
2203
|
-
*
|
|
2127
|
+
* const [ok] = gui.new_texture("orange_tx", w, h, "rgb", orange.repeat(w * h));
|
|
2128
|
+
* if (ok) {
|
|
2129
|
+
* const node = gui.get_node("box_node");
|
|
2204
2130
|
* gui.set_texture(node, "orange_tx");
|
|
2205
2131
|
* }
|
|
2206
2132
|
* ```
|
|
@@ -2215,11 +2141,8 @@ declare global {
|
|
|
2215
2141
|
* @param type - texture type
|
|
2216
2142
|
*
|
|
2217
2143
|
* - `"rgb"` - RGB
|
|
2218
|
-
*
|
|
2219
2144
|
* - `"rgba"` - RGBA
|
|
2220
|
-
*
|
|
2221
2145
|
* - `"l"` - LUMINANCE
|
|
2222
|
-
*
|
|
2223
2146
|
* - `"astc"` - ASTC compressed format
|
|
2224
2147
|
* @param buffer - texture data
|
|
2225
2148
|
* @param flip - flip texture vertically
|
|
@@ -2276,9 +2199,7 @@ declare global {
|
|
|
2276
2199
|
* @param anchor - anchor constant
|
|
2277
2200
|
*
|
|
2278
2201
|
* - `gui.ANCHOR_NONE`
|
|
2279
|
-
*
|
|
2280
2202
|
* - `gui.ANCHOR_LEFT`
|
|
2281
|
-
*
|
|
2282
2203
|
* - `gui.ANCHOR_RIGHT`
|
|
2283
2204
|
*/
|
|
2284
2205
|
function set_xanchor(node: Opaque<"node">, anchor: gui.XAnchor): void;
|
|
@@ -2289,9 +2210,7 @@ declare global {
|
|
|
2289
2210
|
* @param anchor - anchor constant
|
|
2290
2211
|
*
|
|
2291
2212
|
* - `gui.ANCHOR_NONE`
|
|
2292
|
-
*
|
|
2293
2213
|
* - `gui.ANCHOR_TOP`
|
|
2294
|
-
*
|
|
2295
2214
|
* - `gui.ANCHOR_BOTTOM`
|
|
2296
2215
|
*/
|
|
2297
2216
|
function set_yanchor(node: Opaque<"node">, anchor: gui.YAnchor): void;
|
|
@@ -2304,11 +2223,8 @@ declare global {
|
|
|
2304
2223
|
* @param type - keyboard type
|
|
2305
2224
|
*
|
|
2306
2225
|
* - `gui.KEYBOARD_TYPE_DEFAULT`
|
|
2307
|
-
*
|
|
2308
2226
|
* - `gui.KEYBOARD_TYPE_EMAIL`
|
|
2309
|
-
*
|
|
2310
2227
|
* - `gui.KEYBOARD_TYPE_NUMBER_PAD`
|
|
2311
|
-
*
|
|
2312
2228
|
* - `gui.KEYBOARD_TYPE_PASSWORD`
|
|
2313
2229
|
* @param autoclose - if the keyboard should automatically close when clicking outside
|
|
2314
2230
|
*/
|
|
@@ -2334,15 +2250,17 @@ declare global {
|
|
|
2334
2250
|
* // in a counting fashion. It is assumed that the gui component receives messages
|
|
2335
2251
|
* // from the game when a new score is to be shown.
|
|
2336
2252
|
* export default defineGuiScript({
|
|
2337
|
-
* init(
|
|
2338
|
-
*
|
|
2339
|
-
*
|
|
2340
|
-
*
|
|
2341
|
-
*
|
|
2342
|
-
*
|
|
2343
|
-
*
|
|
2344
|
-
*
|
|
2345
|
-
*
|
|
2253
|
+
* init() {
|
|
2254
|
+
* return {
|
|
2255
|
+
* // fetch the score text node for later use (assumes it is called "score")
|
|
2256
|
+
* score_node: gui.get_node("score"),
|
|
2257
|
+
* // keep track of the current score counted up so far
|
|
2258
|
+
* current_score: 0,
|
|
2259
|
+
* // keep track of the target score we should count up to
|
|
2260
|
+
* target_score: 0,
|
|
2261
|
+
* // how fast we will update the score, in score/second
|
|
2262
|
+
* score_update_speed: 1,
|
|
2263
|
+
* };
|
|
2346
2264
|
* },
|
|
2347
2265
|
*
|
|
2348
2266
|
* update(self, dt) {
|
|
@@ -2361,7 +2279,7 @@ declare global {
|
|
|
2361
2279
|
*
|
|
2362
2280
|
* on_message(self, message_id, message) {
|
|
2363
2281
|
* // check the message
|
|
2364
|
-
* if (message_id === hash("set_score")) {
|
|
2282
|
+
* if (message_id === hash("set_score") && typeof message.score === "number") {
|
|
2365
2283
|
* self.target_score = message.score;
|
|
2366
2284
|
* }
|
|
2367
2285
|
* },
|