@defold-typescript/types 0.8.4 → 0.9.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.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/api-targets.json +18 -0
  3. package/generated/b2d_body.d.ts +348 -0
  4. package/generated/buffer.d.ts +3 -0
  5. package/generated/camera.d.ts +236 -1
  6. package/generated/collectionfactory.d.ts +4 -0
  7. package/generated/factory.d.ts +4 -0
  8. package/generated/font.d.ts +81 -0
  9. package/generated/go.d.ts +53 -0
  10. package/generated/gui.d.ts +264 -49
  11. package/generated/html5.d.ts +17 -13
  12. package/generated/http.d.ts +16 -0
  13. package/generated/image.d.ts +24 -0
  14. package/generated/json.d.ts +2 -0
  15. package/generated/kinds/gui-script.d.ts +2 -0
  16. package/generated/kinds/render-script.d.ts +2 -0
  17. package/generated/kinds/script.d.ts +2 -0
  18. package/generated/model.d.ts +14 -0
  19. package/generated/msg.d.ts +17 -11
  20. package/generated/particlefx.d.ts +6 -0
  21. package/generated/physics.d.ts +32 -0
  22. package/generated/profiler.d.ts +14 -0
  23. package/generated/render.d.ts +109 -0
  24. package/generated/resource.d.ts +223 -0
  25. package/generated/socket.d.ts +4 -0
  26. package/generated/sound.d.ts +6 -0
  27. package/generated/sprite.d.ts +5 -0
  28. package/generated/sys.d.ts +136 -0
  29. package/generated/tilemap.d.ts +2 -0
  30. package/generated/timer.d.ts +3 -0
  31. package/generated/vmath.d.ts +109 -93
  32. package/generated/window.d.ts +23 -0
  33. package/index.d.ts +7 -0
  34. package/package.json +1 -1
  35. package/scripts/fidelity-baseline.json +18 -2
  36. package/scripts/regen.ts +4 -0
  37. package/scripts/signature-store-io.ts +18 -0
  38. package/scripts/sync-api-docs.ts +208 -12
  39. package/src/core-types.ts +4 -2
  40. package/src/doc-comment.ts +42 -5
  41. package/src/engine-globals.d.ts +2 -0
  42. package/src/example-store.ts +11 -7
  43. package/src/index.ts +18 -1
  44. package/src/msg-overloads.d.ts +3 -0
  45. package/src/signature-store.ts +20 -0
@@ -8,8 +8,11 @@ declare global {
8
8
  namespace resource {
9
9
  /**
10
10
  * Constructor-like function with two purposes:
11
+ *
11
12
  * - Load the specified resource as part of loading the script
13
+ *
12
14
  * - Return a hash to the run-time version of the resource
15
+ *
13
16
  * This function can only be called within go.property function calls.
14
17
  *
15
18
  * @param path - optional resource path string to the resource
@@ -38,8 +41,11 @@ declare global {
38
41
  function atlas(path?: string): Hash;
39
42
  /**
40
43
  * Constructor-like function with two purposes:
44
+ *
41
45
  * - Load the specified resource as part of loading the script
46
+ *
42
47
  * - Return a hash to the run-time version of the resource
48
+ *
43
49
  * This function can only be called within go.property function calls.
44
50
  *
45
51
  * @param path - optional resource path string to the resource
@@ -71,67 +77,109 @@ declare global {
71
77
  *
72
78
  * @param path - The path to the resource.
73
79
  * @param table - A table containing info about how to create the atlas. Supported entries:
80
+ *
74
81
  * -
82
+ *
75
83
  * `texture`
76
84
  * string | hash the path to the texture resource, e.g "/main/my_texture.texturec"
85
+ *
77
86
  * -
87
+ *
78
88
  * `animations`
79
89
  * table a list of the animations in the atlas. Supports the following fields:
90
+ *
80
91
  * -
92
+ *
81
93
  * `id`
82
94
  * string the id of the animation, used in e.g sprite.play_animation
95
+ *
83
96
  * -
97
+ *
84
98
  * `width`
85
99
  * number the width of the animation
100
+ *
86
101
  * -
102
+ *
87
103
  * `height`
88
104
  * number the height of the animation
105
+ *
89
106
  * -
107
+ *
90
108
  * `frame_start`
91
109
  * number index to the first geometry of the animation. Indices are lua based and must be in the range of 1 .. in atlas.
110
+ *
92
111
  * -
112
+ *
93
113
  * `frame_end`
94
114
  * number index to the last geometry of the animation (non-inclusive). Indices are lua based and must be in the range of 1 .. in atlas.
115
+ *
95
116
  * -
117
+ *
96
118
  * `playback`
97
119
  * constant optional playback mode of the animation, the default value is go.PLAYBACK_ONCE_FORWARD
120
+ *
98
121
  * -
122
+ *
99
123
  * `fps`
100
124
  * number optional fps of the animation, the default value is 30
125
+ *
101
126
  * -
127
+ *
102
128
  * `flip_vertical`
103
129
  * boolean optional flip the animation vertically, the default value is false
130
+ *
104
131
  * -
132
+ *
105
133
  * `flip_horizontal`
106
134
  * boolean optional flip the animation horizontally, the default value is false
135
+ *
107
136
  * -
137
+ *
108
138
  * `geometries`
109
139
  * table A list of the geometries that should map to the texture data. Supports the following fields:
140
+ *
110
141
  * -
142
+ *
111
143
  * `id`
112
144
  * string The name of the geometry. Used when matching animations between multiple atlases
145
+ *
113
146
  * -
147
+ *
114
148
  * `width`
115
149
  * number The width of the image the sprite geometry represents
150
+ *
116
151
  * -
152
+ *
117
153
  * `height`
118
154
  * number The height of the image the sprite geometry represents
155
+ *
119
156
  * -
157
+ *
120
158
  * `pivot_x`
121
159
  * number The pivot x value of the image in unit coords. (0,0) is upper left corner, (1,1) is bottom right. Default is 0.5.
160
+ *
122
161
  * -
162
+ *
123
163
  * `pivot_y`
124
164
  * number The pivot y value of the image in unit coords. (0,0) is upper left corner, (1,1) is bottom right. Default is 0.5.
165
+ *
125
166
  * -
167
+ *
126
168
  * `rotated`
127
169
  * boolean Whether the image is rotated 90 degrees counter-clockwise in the atlas. This affects UV coordinate generation for proper rendering. Default is false.
170
+ *
128
171
  * -
172
+ *
129
173
  * `vertices`
130
174
  * table a list of the vertices in image space of the geometry in the form {px0, py0, px1, py1, ..., pxn, pyn}
175
+ *
131
176
  * -
177
+ *
132
178
  * `uvs`
133
179
  * table a list of the uv coordinates in image space of the geometry in the form of {u0, v0, u1, v1, ..., un, vn}.
180
+ *
134
181
  * -
182
+ *
135
183
  * `indices`
136
184
  * table a list of the indices of the geometry in the form {i0, i1, i2, ..., in}. Each tripe in the list represents a triangle.
137
185
  * @returns Returns the atlas resource path
@@ -198,10 +246,14 @@ declare global {
198
246
  *
199
247
  * @param path - The path to the resource.
200
248
  * @param table - A table containing info about how to create the buffer. Supported entries:
249
+ *
201
250
  * -
251
+ *
202
252
  * `buffer`
203
253
  * buffer the buffer to bind to this resource
254
+ *
204
255
  * -
256
+ *
205
257
  * `transfer_ownership`
206
258
  * boolean optional flag to determine wether or not the resource should take over ownership of the buffer object (default true)
207
259
  * @returns Returns the buffer resource path
@@ -261,6 +313,7 @@ declare global {
261
313
  *
262
314
  * @param path - the path to the resource. Must not already exist.
263
315
  * @param options - A table containing parameters for the text. Supported entries:
316
+ *
264
317
  * `data`
265
318
  * string The raw data of the file. May be partial, but must include the header of the file
266
319
  * `filesize`
@@ -292,13 +345,20 @@ declare global {
292
345
  *
293
346
  * @param path - The path to the resource.
294
347
  * @param table - A table containing info about how to create the texture. Supported entries:
348
+ *
295
349
  * `type`
296
350
  * number The texture type. Supported values:
351
+ *
297
352
  * - `graphics.TEXTURE_TYPE_2D`
353
+ *
298
354
  * - `graphics.TEXTURE_TYPE_IMAGE_2D`
355
+ *
299
356
  * - `graphics.TEXTURE_TYPE_3D`
357
+ *
300
358
  * - `graphics.TEXTURE_TYPE_IMAGE_3D`
359
+ *
301
360
  * - `graphics.TEXTURE_TYPE_CUBE_MAP`
361
+ *
302
362
  * `width`
303
363
  * number The width of the texture (in pixels). Must be larger than 0.
304
364
  * `height`
@@ -307,47 +367,80 @@ declare global {
307
367
  * number The depth of the texture (in pixels). Must be larger than 0. Only used when `type` is `graphics.TEXTURE_TYPE_3D` or `graphics.TEXTURE_TYPE_IMAGE_3D`.
308
368
  * `format`
309
369
  * number The texture format, note that some of these formats might not be supported by the running device. Supported values:
370
+ *
310
371
  * - `graphics.TEXTURE_FORMAT_LUMINANCE`
372
+ *
311
373
  * - `graphics.TEXTURE_FORMAT_RGB`
374
+ *
312
375
  * - `graphics.TEXTURE_FORMAT_RGBA`
376
+ *
313
377
  * These constants might not be available on the device:
378
+ *
314
379
  * - `graphics.TEXTURE_FORMAT_RGB_PVRTC_2BPPV1`
380
+ *
315
381
  * - `graphics.TEXTURE_FORMAT_RGB_PVRTC_4BPPV1`
382
+ *
316
383
  * - `graphics.TEXTURE_FORMAT_RGBA_PVRTC_2BPPV1`
384
+ *
317
385
  * - `graphics.TEXTURE_FORMAT_RGBA_PVRTC_4BPPV1`
386
+ *
318
387
  * - `graphics.TEXTURE_FORMAT_RGB_ETC1`
388
+ *
319
389
  * - `graphics.TEXTURE_FORMAT_RGBA_ETC2`
390
+ *
320
391
  * - `graphics.TEXTURE_FORMAT_RGBA_ASTC_4X4`
392
+ *
321
393
  * - `graphics.TEXTURE_FORMAT_RGB_BC1`
394
+ *
322
395
  * - `graphics.TEXTURE_FORMAT_RGBA_BC3`
396
+ *
323
397
  * - `graphics.TEXTURE_FORMAT_R_BC4`
398
+ *
324
399
  * - `graphics.TEXTURE_FORMAT_RG_BC5`
400
+ *
325
401
  * - `graphics.TEXTURE_FORMAT_RGBA_BC7`
402
+ *
326
403
  * - `graphics.TEXTURE_FORMAT_RGB16F`
404
+ *
327
405
  * - `graphics.TEXTURE_FORMAT_RGB32F`
406
+ *
328
407
  * - `graphics.TEXTURE_FORMAT_RGBA16F`
408
+ *
329
409
  * - `graphics.TEXTURE_FORMAT_RGBA32F`
410
+ *
330
411
  * - `graphics.TEXTURE_FORMAT_R16F`
412
+ *
331
413
  * - `graphics.TEXTURE_FORMAT_RG16F`
414
+ *
332
415
  * - `graphics.TEXTURE_FORMAT_R32F`
416
+ *
333
417
  * - `graphics.TEXTURE_FORMAT_RG32F`
418
+ *
334
419
  * You can test if the device supports these values by checking if a specific enum is nil or not:
420
+ *
335
421
  * `if graphics.TEXTURE_FORMAT_RGBA16F ~= nil then
336
422
  * -- it is safe to use this format
337
423
  * end
338
424
  * `
425
+ *
339
426
  * `flags`
340
427
  * number Texture creation flags that can be used to dictate how the texture is created. The default value is graphics.TEXTURE_USAGE_FLAG_SAMPLE, which means that the texture can be sampled from a shader.
341
428
  * These flags may or may not be supported on the running device and/or the underlying graphics API and is simply used internally as a 'hint' when creating the texture. There is no guarantee that any of these will have any effect. Supported values:
429
+ *
342
430
  * - `graphics.TEXTURE_USAGE_FLAG_SAMPLE` - The texture can be sampled from a shader (default)
431
+ *
343
432
  * - `graphics.TEXTURE_USAGE_FLAG_MEMORYLESS` - The texture can be used as a memoryless texture, i.e only transient memory for the texture is used during rendering
433
+ *
344
434
  * - `graphics.TEXTURE_USAGE_FLAG_STORAGE` - The texture can be used as a storage texture, which is required for a shader to write to the texture
435
+ *
345
436
  * `max_mipmaps`
346
437
  * number optional max number of mipmaps. Defaults to zero, i.e no mipmap support
347
438
  * `compression_type`
348
439
  * number optional specify the compression type for the data in the buffer object that holds the texture data. Will only be used when a compressed buffer has been passed into the function.
349
440
  * Creating an empty texture with no buffer data is not supported as a core feature. Defaults to graphics.COMPRESSION_TYPE_DEFAULT, i.e no compression. Supported values:
441
+ *
350
442
  * - `COMPRESSION_TYPE_DEFAULT`
443
+ *
351
444
  * - `COMPRESSION_TYPE_BASIS_UASTC`
352
445
  * @param buffer - optional buffer of precreated pixel data
353
446
  * @returns The path to the resource.
@@ -450,11 +543,17 @@ declare global {
450
543
  * @param table - A table containing info about how to create the texture. Supported entries:
451
544
  * `type`
452
545
  * number The texture type. Supported values:
546
+ *
453
547
  * - `graphics.TEXTURE_TYPE_2D`
548
+ *
454
549
  * - `graphics.TEXTURE_TYPE_IMAGE_2D`
550
+ *
455
551
  * - `graphics.TEXTURE_TYPE_3D`
552
+ *
456
553
  * - `graphics.TEXTURE_TYPE_IMAGE_3D`
554
+ *
457
555
  * - `graphics.TEXTURE_TYPE_CUBE_MAP`
556
+ *
458
557
  * `width`
459
558
  * number The width of the texture (in pixels). Must be larger than 0.
460
559
  * `height`
@@ -463,46 +562,79 @@ declare global {
463
562
  * number The depth of the texture (in pixels). Must be larger than 0. Only used when `type` is `graphics.TEXTURE_TYPE_3D` or `graphics.TEXTURE_TYPE_IMAGE_3D`.
464
563
  * `format`
465
564
  * number The texture format, note that some of these formats might not be supported by the running device. Supported values:
565
+ *
466
566
  * - `graphics.TEXTURE_FORMAT_LUMINANCE`
567
+ *
467
568
  * - `graphics.TEXTURE_FORMAT_RGB`
569
+ *
468
570
  * - `graphics.TEXTURE_FORMAT_RGBA`
571
+ *
469
572
  * These constants might not be available on the device:
573
+ *
470
574
  * - `graphics.TEXTURE_FORMAT_RGB_PVRTC_2BPPV1`
575
+ *
471
576
  * - `graphics.TEXTURE_FORMAT_RGB_PVRTC_4BPPV1`
577
+ *
472
578
  * - `graphics.TEXTURE_FORMAT_RGBA_PVRTC_2BPPV1`
579
+ *
473
580
  * - `graphics.TEXTURE_FORMAT_RGBA_PVRTC_4BPPV1`
581
+ *
474
582
  * - `graphics.TEXTURE_FORMAT_RGB_ETC1`
583
+ *
475
584
  * - `graphics.TEXTURE_FORMAT_RGBA_ETC2`
585
+ *
476
586
  * - `graphics.TEXTURE_FORMAT_RGBA_ASTC_4X4`
587
+ *
477
588
  * - `graphics.TEXTURE_FORMAT_RGB_BC1`
589
+ *
478
590
  * - `graphics.TEXTURE_FORMAT_RGBA_BC3`
591
+ *
479
592
  * - `graphics.TEXTURE_FORMAT_R_BC4`
593
+ *
480
594
  * - `graphics.TEXTURE_FORMAT_RG_BC5`
595
+ *
481
596
  * - `graphics.TEXTURE_FORMAT_RGBA_BC7`
597
+ *
482
598
  * - `graphics.TEXTURE_FORMAT_RGB16F`
599
+ *
483
600
  * - `graphics.TEXTURE_FORMAT_RGB32F`
601
+ *
484
602
  * - `graphics.TEXTURE_FORMAT_RGBA16F`
603
+ *
485
604
  * - `graphics.TEXTURE_FORMAT_RGBA32F`
605
+ *
486
606
  * - `graphics.TEXTURE_FORMAT_R16F`
607
+ *
487
608
  * - `graphics.TEXTURE_FORMAT_RG16F`
609
+ *
488
610
  * - `graphics.TEXTURE_FORMAT_R32F`
611
+ *
489
612
  * - `graphics.TEXTURE_FORMAT_RG32F`
613
+ *
490
614
  * You can test if the device supports these values by checking if a specific enum is nil or not:
615
+ *
491
616
  * `if graphics.TEXTURE_FORMAT_RGBA16F ~= nil then
492
617
  * -- it is safe to use this format
493
618
  * end
494
619
  * `
620
+ *
495
621
  * `flags`
496
622
  * number Texture creation flags that can be used to dictate how the texture is created. Supported values:
623
+ *
497
624
  * - `graphics.TEXTURE_USAGE_FLAG_SAMPLE` - The texture can be sampled from a shader (default)
625
+ *
498
626
  * - `graphics.TEXTURE_USAGE_FLAG_MEMORYLESS` - The texture can be used as a memoryless texture, i.e only transient memory for the texture is used during rendering
627
+ *
499
628
  * - `graphics.TEXTURE_USAGE_FLAG_STORAGE` - The texture can be used as a storage texture, which is required for a shader to write to the texture
629
+ *
500
630
  * `max_mipmaps`
501
631
  * number optional max number of mipmaps. Defaults to zero, i.e no mipmap support
502
632
  * `compression_type`
503
633
  * number optional specify the compression type for the data in the buffer object that holds the texture data. Will only be used when a compressed buffer has been passed into the function.
504
634
  * Creating an empty texture with no buffer data is not supported as a core feature. Defaults to graphics.COMPRESSION_TYPE_DEFAULT, i.e no compression. Supported values:
635
+ *
505
636
  * - `COMPRESSION_TYPE_DEFAULT`
637
+ *
506
638
  * - `COMPRESSION_TYPE_BASIS_UASTC`
507
639
  * @param buffer - optional buffer of precreated pixel data
508
640
  * @param callback - callback function when texture is created (self, request_id, resource)
@@ -586,8 +718,11 @@ declare global {
586
718
  function create_texture_async(path: string | Hash, table: { type?: number; width?: number; height?: number; depth?: number; format?: number; flags?: number; max_mipmaps?: number; compression_type?: number }, buffer: Opaque<"buffer">, callback: (...args: unknown[]) => unknown): LuaMultiReturn<[Hash, number]>;
587
719
  /**
588
720
  * Constructor-like function with two purposes:
721
+ *
589
722
  * - Load the specified resource as part of loading the script
723
+ *
590
724
  * - Return a hash to the run-time version of the resource
725
+ *
591
726
  * This function can only be called within go.property function calls.
592
727
  *
593
728
  * @param path - optional resource path string to the resource
@@ -619,9 +754,13 @@ declare global {
619
754
  *
620
755
  * @param path - The path to the atlas resource
621
756
  * @returns A table with the following entries:
757
+ *
622
758
  * - texture
759
+ *
623
760
  * - geometries
761
+ *
624
762
  * - animations
763
+ *
625
764
  * Each animation entry also contains a `frames` table with indices into
626
765
  * `geometries`, preserving the frame-to-geometry mapping used by the atlas.
627
766
  * See resource.set_atlas for a detailed description of each field
@@ -654,6 +793,7 @@ declare global {
654
793
  *
655
794
  * @param path - The path to the resource or a render target handle
656
795
  * @returns A table containing info about the render target:
796
+ *
657
797
  * `handle`
658
798
  * number the opaque handle to the texture resource
659
799
  * 'attachments'
@@ -668,19 +808,31 @@ declare global {
668
808
  * number number of mipmaps of the texture
669
809
  * `type`
670
810
  * number The texture type. Supported values:
811
+ *
671
812
  * - `graphics.TEXTURE_TYPE_2D`
813
+ *
672
814
  * - `graphics.TEXTURE_TYPE_CUBE_MAP`
815
+ *
673
816
  * - `graphics.TEXTURE_TYPE_2D_ARRAY`
817
+ *
674
818
  * `buffer_type`
675
819
  * number The attachment buffer type. Supported values:
820
+ *
676
821
  * - `resource.BUFFER_TYPE_COLOR0`
822
+ *
677
823
  * - `resource.BUFFER_TYPE_COLOR1`
824
+ *
678
825
  * - `resource.BUFFER_TYPE_COLOR2`
826
+ *
679
827
  * - `resource.BUFFER_TYPE_COLOR3`
828
+ *
680
829
  * - `resource.BUFFER_TYPE_DEPTH`
830
+ *
681
831
  * -
682
832
  * `resource.BUFFER_TYPE_STENCIL`
833
+ *
683
834
  * -
835
+ *
684
836
  * `texture`
685
837
  * hash The hashed path to the attachment texture resource. This field is only available if the render target passed in is a resource.
686
838
  * @example
@@ -715,6 +867,7 @@ declare global {
715
867
  * @param url - the font to get the (unscaled) metrics from
716
868
  * @param text - text to measure
717
869
  * @param options - A table containing parameters for the text. Supported entries:
870
+ *
718
871
  * `width`
719
872
  * number The width of the text field. Not used if `line_break` is false.
720
873
  * `leading`
@@ -724,9 +877,13 @@ declare global {
724
877
  * `line_break`
725
878
  * boolean If the calculation should consider line breaks (default false)
726
879
  * @returns a table with the following fields:
880
+ *
727
881
  * - width
882
+ *
728
883
  * - height
884
+ *
729
885
  * - max_ascent
886
+ *
730
887
  * - max_descent
731
888
  * @example
732
889
  * ```ts
@@ -745,6 +902,7 @@ declare global {
745
902
  *
746
903
  * @param path - The path to the resource or a texture handle
747
904
  * @returns A table containing info about the texture:
905
+ *
748
906
  * `handle`
749
907
  * number the opaque handle to the texture resource
750
908
  * `width`
@@ -761,11 +919,17 @@ declare global {
761
919
  * number usage hints of the texture.
762
920
  * `type`
763
921
  * number The texture type. Supported values:
922
+ *
764
923
  * - `graphics.TEXTURE_TYPE_2D`
924
+ *
765
925
  * - `graphics.TEXTURE_TYPE_2D_ARRAY`
926
+ *
766
927
  * - `graphics.TEXTURE_TYPE_IMAGE_2D`
928
+ *
767
929
  * - `graphics.TEXTURE_TYPE_3D`
930
+ *
768
931
  * - `graphics.TEXTURE_TYPE_IMAGE_3D`
932
+ *
769
933
  * - `graphics.TEXTURE_TYPE_CUBE_MAP`
770
934
  * @example
771
935
  * ```ts
@@ -830,8 +994,11 @@ declare global {
830
994
  function load(path: string): Opaque<"buffer">;
831
995
  /**
832
996
  * Constructor-like function with two purposes:
997
+ *
833
998
  * - Load the specified resource as part of loading the script
999
+ *
834
1000
  * - Return a hash to the run-time version of the resource
1001
+ *
835
1002
  * This function can only be called within go.property function calls.
836
1003
  *
837
1004
  * @param path - optional resource path string to the resource
@@ -867,8 +1034,11 @@ declare global {
867
1034
  function release(path: Hash | string): void;
868
1035
  /**
869
1036
  * Constructor-like function with two purposes:
1037
+ *
870
1038
  * - Load the specified resource as part of loading the script
1039
+ *
871
1040
  * - Return a hash to the run-time version of the resource
1041
+ *
872
1042
  * This function can only be called within go.property function calls.
873
1043
  *
874
1044
  * @param path - optional resource path string to the resource
@@ -916,49 +1086,79 @@ declare global {
916
1086
  *
917
1087
  * @param path - The path to the atlas resource
918
1088
  * @param table - A table containing info about the atlas. Supported entries:
1089
+ *
919
1090
  * -
1091
+ *
920
1092
  * `texture`
921
1093
  * string | hash the path to the texture resource, e.g "/main/my_texture.texturec"
1094
+ *
922
1095
  * -
1096
+ *
923
1097
  * `animations`
924
1098
  * table a list of the animations in the atlas. Supports the following fields:
1099
+ *
925
1100
  * -
1101
+ *
926
1102
  * `id`
927
1103
  * string the id of the animation, used in e.g sprite.play_animation
1104
+ *
928
1105
  * -
1106
+ *
929
1107
  * `width`
930
1108
  * number the width of the animation
1109
+ *
931
1110
  * -
1111
+ *
932
1112
  * `height`
933
1113
  * number the height of the animation
1114
+ *
934
1115
  * -
1116
+ *
935
1117
  * `frame_start`
936
1118
  * number index to the first geometry of the animation. Indices are lua based and must be in the range of 1 .. in atlas.
1119
+ *
937
1120
  * -
1121
+ *
938
1122
  * `frame_end`
939
1123
  * number index to the last geometry of the animation (non-inclusive). Indices are lua based and must be in the range of 1 .. in atlas.
1124
+ *
940
1125
  * -
1126
+ *
941
1127
  * `playback`
942
1128
  * constant optional playback mode of the animation, the default value is go.PLAYBACK_ONCE_FORWARD
1129
+ *
943
1130
  * -
1131
+ *
944
1132
  * `fps`
945
1133
  * number optional fps of the animation, the default value is 30
1134
+ *
946
1135
  * -
1136
+ *
947
1137
  * `flip_vertical`
948
1138
  * boolean optional flip the animation vertically, the default value is false
1139
+ *
949
1140
  * -
1141
+ *
950
1142
  * `flip_horizontal`
951
1143
  * boolean optional flip the animation horizontally, the default value is false
1144
+ *
952
1145
  * -
1146
+ *
953
1147
  * `geometries`
954
1148
  * table A list of the geometries that should map to the texture data. Supports the following fields:
1149
+ *
955
1150
  * -
1151
+ *
956
1152
  * `vertices`
957
1153
  * table a list of the vertices in texture space of the geometry in the form {px0, py0, px1, py1, ..., pxn, pyn}
1154
+ *
958
1155
  * -
1156
+ *
959
1157
  * `uvs`
960
1158
  * table a list of the uv coordinates in texture space of the geometry in the form of {u0, v0, u1, v1, ..., un, vn}
1159
+ *
961
1160
  * -
1161
+ *
962
1162
  * `indices`
963
1163
  * table a list of the indices of the geometry in the form {i0, i1, i2, ..., in}. Each tripe in the list represents a triangle.
964
1164
  * @example
@@ -1020,7 +1220,9 @@ declare global {
1020
1220
  * @param path - The path to the resource
1021
1221
  * @param buffer - The resource buffer
1022
1222
  * @param table - A table containing info about how to set the buffer. Supported entries:
1223
+ *
1023
1224
  * -
1225
+ *
1024
1226
  * `transfer_ownership`
1025
1227
  * boolean optional flag to determine wether or not the resource should take over ownership of the buffer object (default false)
1026
1228
  * @example
@@ -1070,22 +1272,33 @@ declare global {
1070
1272
  *
1071
1273
  * @param path - The path to the resource
1072
1274
  * @param table - A table containing info about the texture. Supported entries:
1275
+ *
1073
1276
  * `type`
1074
1277
  * number The texture type. Supported values:
1278
+ *
1075
1279
  * - `graphics.TEXTURE_TYPE_2D`
1280
+ *
1076
1281
  * - `graphics.TEXTURE_TYPE_IMAGE_2D`
1282
+ *
1077
1283
  * - `graphics.TEXTURE_TYPE_3D`
1284
+ *
1078
1285
  * - `graphics.TEXTURE_TYPE_IMAGE_3D`
1286
+ *
1079
1287
  * - `graphics.TEXTURE_TYPE_CUBE_MAP`
1288
+ *
1080
1289
  * `width`
1081
1290
  * number The width of the texture (in pixels)
1082
1291
  * `height`
1083
1292
  * number The width of the texture (in pixels)
1084
1293
  * `format`
1085
1294
  * number The texture format, note that some of these formats are platform specific. Supported values:
1295
+ *
1086
1296
  * - `graphics.TEXTURE_FORMAT_LUMINANCE`
1297
+ *
1087
1298
  * - `graphics.TEXTURE_FORMAT_RGB`
1299
+ *
1088
1300
  * - `graphics.TEXTURE_FORMAT_RGBA`
1301
+ *
1089
1302
  * These constants might not be available on the device:
1090
1303
  * - `graphics.TEXTURE_FORMAT_RGB_PVRTC_2BPPV1`
1091
1304
  * - `graphics.TEXTURE_FORMAT_RGB_PVRTC_4BPPV1`
@@ -1108,10 +1321,12 @@ declare global {
1108
1321
  * - `graphics.TEXTURE_FORMAT_R32F`
1109
1322
  * - `graphics.TEXTURE_FORMAT_RG32F`
1110
1323
  * You can test if the device supports these values by checking if a specific enum is nil or not:
1324
+ *
1111
1325
  * `if graphics.TEXTURE_FORMAT_RGBA16F ~= nil then
1112
1326
  * -- it is safe to use this format
1113
1327
  * end
1114
1328
  * `
1329
+ *
1115
1330
  * `x`
1116
1331
  * number optional x offset of the texture (in pixels)
1117
1332
  * `y`
@@ -1124,7 +1339,9 @@ declare global {
1124
1339
  * number optional mipmap to upload the data to
1125
1340
  * `compression_type`
1126
1341
  * number optional specify the compression type for the data in the buffer object that holds the texture data. Defaults to graphics.COMPRESSION_TYPE_DEFAULT, i.e no compression. Supported values:
1342
+ *
1127
1343
  * - `COMPRESSION_TYPE_DEFAULT`
1344
+ *
1128
1345
  * - `COMPRESSION_TYPE_BASIS_UASTC`
1129
1346
  * @param buffer - The buffer of precreated pixel data
1130
1347
  * To update a cube map texture you need to pass in six times the amount of data via the buffer, since a cube map has six sides!
@@ -1261,8 +1478,11 @@ declare global {
1261
1478
  function set_texture(path: Hash | string, table: { type?: number; width?: number; height?: number; format?: number; x?: number; y?: number; z?: number; page?: number; mipmap?: number; compression_type?: number }, buffer: Opaque<"buffer">): void;
1262
1479
  /**
1263
1480
  * Constructor-like function with two purposes:
1481
+ *
1264
1482
  * - Load the specified resource as part of loading the script
1483
+ *
1265
1484
  * - Return a hash to the run-time version of the resource
1485
+ *
1266
1486
  * This function can only be called within go.property function calls.
1267
1487
  *
1268
1488
  * @param path - optional resource path string to the resource
@@ -1282,8 +1502,11 @@ declare global {
1282
1502
  function texture(path?: string): Hash;
1283
1503
  /**
1284
1504
  * Constructor-like function with two purposes:
1505
+ *
1285
1506
  * - Load the specified resource as part of loading the script
1507
+ *
1286
1508
  * - Return a hash to the run-time version of the resource
1509
+ *
1287
1510
  * This function can only be called within go.property function calls.
1288
1511
  *
1289
1512
  * @param path - optional resource path string to the resource
@@ -8,13 +8,17 @@ declare global {
8
8
  * runtime, which contain the core C functionality. Additional LuaSocket support modules for
9
9
  * SMTP, HTTP, FTP etc are not part of the core included, but can be easily added to a project
10
10
  * and used.
11
+ *
11
12
  * [icon:html5] On HTML5, the non-network helpers remain available, but TCP, UDP and
12
13
  * `socket.select()` are not supported.
14
+ *
13
15
  * Note the included helper module "socket.lua" in "builtins/scripts/socket.lua". Require this
14
16
  * module to add some additional functions and shortcuts to the namespace:
17
+ *
15
18
  * ```lua
16
19
  * require "builtins.scripts.socket"
17
20
  * ```
21
+ *
18
22
  * LuaSocket is Copyright &copy; 2004-2007 Diego Nehab. All rights reserved.
19
23
  * LuaSocket is free software, released under the MIT license (same license as the Lua core).
20
24
  */
@@ -106,8 +106,11 @@ declare global {
106
106
  * in the Android SDK. If your game is playing any sounds, *even with a gain of zero*, this
107
107
  * function will return `false`.
108
108
  * The best time to call this function is:
109
+ *
109
110
  * - In the `init` function of your main collection script before any sounds are triggered
111
+ *
110
112
  * - In a window listener callback when the window.WINDOW_EVENT_FOCUS_GAINED event is received
113
+ *
111
114
  * Both those times will give you a correct reading of the state even when your application is
112
115
  * swapped out and in while playing sounds and it works equally well on Android and iOS.
113
116
  *
@@ -170,13 +173,16 @@ declare global {
170
173
  * `start_frame`
171
174
  * number start playback offset (frames/samples). Optional, mutually exclusive with `start_time`. If both are provided, `start_frame` is used.
172
175
  * @param complete_function - function to call when the sound has finished playing or stopped manually via sound.stop.
176
+ *
173
177
  * `self`
174
178
  * object The current object.
175
179
  * `message_id`
176
180
  * hash The name of the completion message, which can be either `"sound_done"` if the sound has finished playing, or `"sound_stopped"` if it was stopped manually.
177
181
  * `message`
178
182
  * table Information about the completion:
183
+ *
179
184
  * - number `play_id` - the sequential play identifier that was given by the sound.play function.
185
+ *
180
186
  * `sender`
181
187
  * url The invoker of the callback: the sound component.
182
188
  * @returns The identifier for the sound voice