@defold-typescript/types 0.40.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 +3963 -772
- package/api-migrations.json +27 -0
- package/api-signatures.json +18069 -10240
- package/api-targets.json +448 -11
- package/examples/translations.json +560 -89
- 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 +183 -20
- package/generated/b2d_world.d.ts +57 -63
- package/generated/buffer.d.ts +16 -15
- 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 +29 -32
- package/generated/collectionfactory.d.ts +15 -18
- 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 +235 -182
- package/generated/graphics.d.ts +335 -97
- package/generated/gui.d.ts +240 -471
- package/generated/html5.d.ts +2 -2
- package/generated/http.d.ts +28 -35
- package/generated/image.d.ts +105 -72
- package/generated/json.d.ts +34 -16
- package/generated/kinds/gui-script.d.ts +7 -0
- package/generated/kinds/render-script.d.ts +7 -0
- package/generated/kinds/script.d.ts +7 -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 +40 -39
- package/generated/particlefx.d.ts +19 -28
- package/generated/physics.d.ts +365 -133
- package/generated/profiler.d.ts +13 -23
- package/generated/render.d.ts +237 -297
- package/generated/resource.d.ts +664 -583
- package/generated/socket.d.ts +120 -133
- package/generated/sound.d.ts +62 -31
- package/generated/sprite.d.ts +31 -17
- package/generated/sys.d.ts +234 -190
- 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 +1 -3
- package/generated/versions/defold-1.12.4/camera.d.ts +21 -21
- package/generated/versions/defold-1.12.4/collectionfactory.d.ts +9 -9
- 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 +6 -12
- package/generated/versions/defold-1.12.4/gui.d.ts +77 -175
- package/generated/versions/defold-1.12.4/html5.d.ts +1 -1
- package/generated/versions/defold-1.12.4/http.d.ts +0 -13
- package/generated/versions/defold-1.12.4/image.d.ts +16 -33
- package/generated/versions/defold-1.12.4/index.d.ts +1 -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 +2 -10
- package/generated/versions/defold-1.12.4/particlefx.d.ts +2 -5
- package/generated/versions/defold-1.12.4/physics.d.ts +69 -67
- package/generated/versions/defold-1.12.4/profiler.d.ts +2 -5
- package/generated/versions/defold-1.12.4/render.d.ts +99 -128
- package/generated/versions/defold-1.12.4/resource.d.ts +120 -148
- package/generated/versions/defold-1.12.4/socket.d.ts +34 -60
- package/generated/versions/defold-1.12.4/sound.d.ts +8 -8
- package/generated/versions/defold-1.12.4/sprite.d.ts +15 -5
- package/generated/versions/defold-1.12.4/sys.d.ts +37 -71
- 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 +0 -21
- 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 +169 -8
- package/generated/versions/defold-1.13.0/b2d_world.d.ts +16 -10
- package/generated/versions/defold-1.13.0/buffer.d.ts +1 -3
- package/generated/versions/defold-1.13.0/camera.d.ts +25 -25
- package/generated/versions/defold-1.13.0/collectionfactory.d.ts +9 -9
- package/generated/versions/defold-1.13.0/collectionproxy.d.ts +2 -2
- package/generated/versions/defold-1.13.0/compute.d.ts +0 -69
- 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 +6 -12
- package/generated/versions/defold-1.13.0/graphics.d.ts +73 -37
- package/generated/versions/defold-1.13.0/gui.d.ts +77 -175
- package/generated/versions/defold-1.13.0/html5.d.ts +1 -1
- package/generated/versions/defold-1.13.0/http.d.ts +0 -13
- package/generated/versions/defold-1.13.0/image.d.ts +16 -33
- package/generated/versions/defold-1.13.0/index.d.ts +1 -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 +68 -106
- package/generated/versions/defold-1.13.0/model.d.ts +2 -10
- package/generated/versions/defold-1.13.0/particlefx.d.ts +2 -5
- package/generated/versions/defold-1.13.0/physics.d.ts +69 -67
- package/generated/versions/defold-1.13.0/profiler.d.ts +2 -5
- package/generated/versions/defold-1.13.0/render.d.ts +99 -128
- package/generated/versions/defold-1.13.0/resource.d.ts +126 -150
- package/generated/versions/defold-1.13.0/socket.d.ts +34 -60
- package/generated/versions/defold-1.13.0/sound.d.ts +8 -8
- package/generated/versions/defold-1.13.0/sprite.d.ts +15 -5
- package/generated/versions/defold-1.13.0/sys.d.ts +37 -71
- 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 +0 -21
- 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 +1 -21
- package/generated/window.d.ts +71 -71
- package/identity-vocabulary.json +561 -0
- package/index.d.ts +7 -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 +12 -2
- package/scripts/import-defold-release.ts +85 -24
- package/scripts/prose-constants.ts +77 -16
- package/scripts/regen.ts +391 -77
- 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/core-types.ts +26 -3
- package/src/correction-pins.ts +49 -0
- package/src/doc-comment.ts +104 -11
- package/src/doc-corrections.ts +108 -0
- package/src/editor-vm-globals.d.ts +5 -2
- package/src/emit-dts.ts +2064 -281
- package/src/emit-messages.ts +52 -0
- 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 +25 -6
- package/src/index-base-table.ts +145 -0
- package/src/index-slot-classifications.ts +588 -0
- package/src/index.ts +38 -5
- 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 +8 -11
- package/src/render-overloads.d.ts +0 -15
- package/src/return-correction-provenance.ts +58 -16
- 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
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import type { Hash, Matrix4, Vector3, Vector4 } from "../../../src/core-types";
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
/**
|
|
6
|
+
* Functions for interacting with compute programs.
|
|
7
|
+
*/
|
|
8
|
+
namespace compute {
|
|
9
|
+
/**
|
|
10
|
+
* Returns a table of all the shader constants in the compute program.
|
|
11
|
+
*
|
|
12
|
+
* @param path - The path to the resource
|
|
13
|
+
* @returns A table of tables, where each entry contains info about the shader constants:
|
|
14
|
+
*
|
|
15
|
+
* `name`
|
|
16
|
+
* hash the hashed name of the constant
|
|
17
|
+
* `type`
|
|
18
|
+
* number the type of the constant. Supported values:
|
|
19
|
+
*
|
|
20
|
+
* - `material.CONSTANT_TYPE_USER`
|
|
21
|
+
* - `material.CONSTANT_TYPE_USER_MATRIX4`
|
|
22
|
+
* - `material.CONSTANT_TYPE_VIEWPROJ`
|
|
23
|
+
* - `material.CONSTANT_TYPE_WORLD`
|
|
24
|
+
* - `material.CONSTANT_TYPE_TEXTURE`
|
|
25
|
+
* - `material.CONSTANT_TYPE_VIEW`
|
|
26
|
+
* - `material.CONSTANT_TYPE_PROJECTION`
|
|
27
|
+
* - `material.CONSTANT_TYPE_NORMAL`
|
|
28
|
+
* - `material.CONSTANT_TYPE_WORLDVIEW`
|
|
29
|
+
* - `material.CONSTANT_TYPE_WORLDVIEWPROJ`
|
|
30
|
+
* - `material.CONSTANT_TYPE_TIME`
|
|
31
|
+
* - `material.CONSTANT_TYPE_WORLD_INVERSE`
|
|
32
|
+
* - `material.CONSTANT_TYPE_VIEW_INVERSE`
|
|
33
|
+
* - `material.CONSTANT_TYPE_PROJECTION_INVERSE`
|
|
34
|
+
* - `material.CONSTANT_TYPE_VIEWPROJ_INVERSE`
|
|
35
|
+
* - `material.CONSTANT_TYPE_WORLDVIEW_INVERSE`
|
|
36
|
+
* - `material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE`
|
|
37
|
+
*
|
|
38
|
+
* `value`
|
|
39
|
+
* vmath.vector4 | vmath.matrix4 the value(s) of the constant. If the constant is an array, the value will be a table of vmath.vector4 or vmath.matrix4 if the type is `material.CONSTANT_TYPE_USER_MATRIX4`.
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const constants = compute.get_constants("/my_compute.computec");
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
function get_constants(path: Hash | string): { name: Hash; type: number; value: Vector4 | Matrix4 }[];
|
|
46
|
+
/**
|
|
47
|
+
* Returns a table of all the texture samplers in the compute program. This function will return all the texture samplers
|
|
48
|
+
* that are available, even the ones that have not been specified in the compute resource.
|
|
49
|
+
*
|
|
50
|
+
* @param path - The path to the resource
|
|
51
|
+
* @returns A table of tables, where each entry contains info about the texture samplers:
|
|
52
|
+
*
|
|
53
|
+
* `name`
|
|
54
|
+
* hash the hashed name of the texture sampler
|
|
55
|
+
* `u_wrap`
|
|
56
|
+
* number the u wrap mode of the texture sampler. Supported values:
|
|
57
|
+
*
|
|
58
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
59
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
60
|
+
* - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
61
|
+
* - `graphics.TEXTURE_WRAP_REPEAT`
|
|
62
|
+
*
|
|
63
|
+
* `v_wrap`
|
|
64
|
+
* number the v wrap mode of the texture sampler. Supported values:
|
|
65
|
+
*
|
|
66
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
67
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
68
|
+
* - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
69
|
+
* - `graphics.TEXTURE_WRAP_REPEAT`
|
|
70
|
+
*
|
|
71
|
+
* `min_filter`
|
|
72
|
+
* number the min filter mode of the texture sampler. Supported values:
|
|
73
|
+
*
|
|
74
|
+
* - `graphics.TEXTURE_FILTER_DEFAULT`
|
|
75
|
+
* - `graphics.TEXTURE_FILTER_NEAREST`
|
|
76
|
+
* - `graphics.TEXTURE_FILTER_LINEAR`
|
|
77
|
+
* - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST`
|
|
78
|
+
* - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR`
|
|
79
|
+
* - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST`
|
|
80
|
+
* - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR`
|
|
81
|
+
*
|
|
82
|
+
* `mag_filter`
|
|
83
|
+
* number the mag filter mode of the texture sampler
|
|
84
|
+
*
|
|
85
|
+
* - `graphics.TEXTURE_FILTER_DEFAULT`
|
|
86
|
+
* - `graphics.TEXTURE_FILTER_NEAREST`
|
|
87
|
+
* - `graphics.TEXTURE_FILTER_LINEAR`
|
|
88
|
+
*
|
|
89
|
+
* `max_anisotropy`
|
|
90
|
+
* number the max anisotropy of the texture sampler
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const samplers = compute.get_samplers("/my_compute.computec");
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
function get_samplers(path: Hash | string): { name: Hash; u_wrap: number; v_wrap: number; min_filter: number; mag_filter: number; max_anisotropy: number }[];
|
|
97
|
+
/**
|
|
98
|
+
* Returns a table of all the textures from the compute program.
|
|
99
|
+
*
|
|
100
|
+
* @param path - The path to the resource
|
|
101
|
+
* @returns A table of tables, where each entry contains info about the compute textures:
|
|
102
|
+
*
|
|
103
|
+
* `path`
|
|
104
|
+
* hash the resource path of the texture. Only available if the texture is a resource.
|
|
105
|
+
* `handle`
|
|
106
|
+
* hash the runtime handle of the texture.
|
|
107
|
+
* `width`
|
|
108
|
+
* number the width of the texture
|
|
109
|
+
* `height`
|
|
110
|
+
* number the height of the texture
|
|
111
|
+
* `depth`
|
|
112
|
+
* number the depth of the texture. Corresponds to the number of layers in an array texture.
|
|
113
|
+
* `mipmaps`
|
|
114
|
+
* number the number of mipmaps in the texture
|
|
115
|
+
* `type`
|
|
116
|
+
* number the type of the texture. Supported values:
|
|
117
|
+
*
|
|
118
|
+
* - `graphics.TEXTURE_TYPE_2D`
|
|
119
|
+
* - `graphics.TEXTURE_TYPE_2D_ARRAY`
|
|
120
|
+
* - `graphics.TEXTURE_TYPE_CUBE_MAP`
|
|
121
|
+
* - `graphics.TEXTURE_TYPE_IMAGE_2D`
|
|
122
|
+
* - `graphics.TEXTURE_TYPE_3D`
|
|
123
|
+
* - `graphics.TEXTURE_TYPE_IMAGE_3D`
|
|
124
|
+
*
|
|
125
|
+
* `flags`
|
|
126
|
+
* number the flags of the texture. This field is a bit mask of these supported flags:
|
|
127
|
+
*
|
|
128
|
+
* - `graphics.TEXTURE_USAGE_FLAG_SAMPLE`
|
|
129
|
+
* - `graphics.TEXTURE_USAGE_FLAG_MEMORYLESS`
|
|
130
|
+
* - `graphics.TEXTURE_USAGE_FLAG_STORAGE`
|
|
131
|
+
* - `graphics.TEXTURE_USAGE_FLAG_INPUT`
|
|
132
|
+
* - `graphics.TEXTURE_USAGE_FLAG_COLOR`
|
|
133
|
+
* @example
|
|
134
|
+
* ```ts
|
|
135
|
+
* const textures = compute.get_textures("/my_compute.computec");
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
function get_textures(path: Hash | string): { path: Hash; handle: Hash; width: number; height: number; depth: number; mipmaps: number; type: number; flags: number }[];
|
|
139
|
+
/**
|
|
140
|
+
* Sets shader constants in a compute program, if the constants exist.
|
|
141
|
+
*
|
|
142
|
+
* @param path - The path to the resource
|
|
143
|
+
* @param constants - A table keyed by constant name with args tables as values. Constants can be partially updated. Supported entries:
|
|
144
|
+
*
|
|
145
|
+
* `type`
|
|
146
|
+
* number the type of the constant. Supported values:
|
|
147
|
+
*
|
|
148
|
+
* - `material.CONSTANT_TYPE_USER`
|
|
149
|
+
* - `material.CONSTANT_TYPE_USER_MATRIX4`
|
|
150
|
+
* - `material.CONSTANT_TYPE_VIEWPROJ`
|
|
151
|
+
* - `material.CONSTANT_TYPE_WORLD`
|
|
152
|
+
* - `material.CONSTANT_TYPE_TEXTURE`
|
|
153
|
+
* - `material.CONSTANT_TYPE_VIEW`
|
|
154
|
+
* - `material.CONSTANT_TYPE_PROJECTION`
|
|
155
|
+
* - `material.CONSTANT_TYPE_NORMAL`
|
|
156
|
+
* - `material.CONSTANT_TYPE_WORLDVIEW`
|
|
157
|
+
* - `material.CONSTANT_TYPE_WORLDVIEWPROJ`
|
|
158
|
+
* - `material.CONSTANT_TYPE_TIME`
|
|
159
|
+
* - `material.CONSTANT_TYPE_WORLD_INVERSE`
|
|
160
|
+
* - `material.CONSTANT_TYPE_VIEW_INVERSE`
|
|
161
|
+
* - `material.CONSTANT_TYPE_PROJECTION_INVERSE`
|
|
162
|
+
* - `material.CONSTANT_TYPE_VIEWPROJ_INVERSE`
|
|
163
|
+
* - `material.CONSTANT_TYPE_WORLDVIEW_INVERSE`
|
|
164
|
+
* - `material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE`
|
|
165
|
+
*
|
|
166
|
+
* `value`
|
|
167
|
+
* vmath.vector4 | vmath.vector3 | vmath.matrix4 | number | table the value(s) of the constant. If the shader constant is an array, the amount of values to update depends on how many values that are passed in the 'value' field.
|
|
168
|
+
* @example
|
|
169
|
+
* ```ts
|
|
170
|
+
* compute.set_constants("/my_compute.computec", { tint: { value: vmath.vector4(1, 0, 0, 1) } });
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
function set_constants(path: Hash | string, constants: Record<string, { type?: number; value?: Vector4 | Vector3 | Matrix4 | number | (Vector4 | Matrix4)[] }>): void;
|
|
174
|
+
/**
|
|
175
|
+
* Sets texture samplers in a compute program, if the samplers exist. Use this function to change the settings of texture samplers.
|
|
176
|
+
* To set actual textures that should be bound to the samplers, use the `compute.set_textures` function instead.
|
|
177
|
+
*
|
|
178
|
+
* @param path - The path to the resource
|
|
179
|
+
* @param samplers - A table keyed by sampler name with args tables as values. Partial updates are supported. Supported entries:
|
|
180
|
+
*
|
|
181
|
+
* `u_wrap`
|
|
182
|
+
* number the u wrap mode of the texture sampler. Supported values:
|
|
183
|
+
*
|
|
184
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
185
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
186
|
+
* - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
187
|
+
* - `graphics.TEXTURE_WRAP_REPEAT`
|
|
188
|
+
*
|
|
189
|
+
* `v_wrap`
|
|
190
|
+
* number the v wrap mode of the texture sampler. Supported values:
|
|
191
|
+
*
|
|
192
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
193
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
194
|
+
* - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
195
|
+
* - `graphics.TEXTURE_WRAP_REPEAT`
|
|
196
|
+
*
|
|
197
|
+
* `min_filter`
|
|
198
|
+
* number the min filter mode of the texture sampler. Supported values:
|
|
199
|
+
*
|
|
200
|
+
* - `graphics.TEXTURE_FILTER_DEFAULT`
|
|
201
|
+
* - `graphics.TEXTURE_FILTER_NEAREST`
|
|
202
|
+
* - `graphics.TEXTURE_FILTER_LINEAR`
|
|
203
|
+
* - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST`
|
|
204
|
+
* - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR`
|
|
205
|
+
* - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST`
|
|
206
|
+
* - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR`
|
|
207
|
+
*
|
|
208
|
+
* `mag_filter`
|
|
209
|
+
* number the mag filter mode of the texture sampler
|
|
210
|
+
*
|
|
211
|
+
* - `graphics.TEXTURE_FILTER_DEFAULT`
|
|
212
|
+
* - `graphics.TEXTURE_FILTER_NEAREST`
|
|
213
|
+
* - `graphics.TEXTURE_FILTER_LINEAR`
|
|
214
|
+
*
|
|
215
|
+
* `max_anisotropy`
|
|
216
|
+
* number the max anisotropy of the texture sampler
|
|
217
|
+
* @example
|
|
218
|
+
* ```ts
|
|
219
|
+
* compute.set_samplers("/my_compute.computec", { texture_sampler: { u_wrap: graphics.TEXTURE_WRAP_REPEAT, v_wrap: graphics.TEXTURE_WRAP_MIRRORED_REPEAT } });
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
function set_samplers(path: Hash | string, samplers: Record<string, { u_wrap?: number; v_wrap?: number; min_filter?: number; mag_filter?: number; max_anisotropy?: number }>): void;
|
|
223
|
+
/**
|
|
224
|
+
* Sets textures in a compute program, if the samplers exist.
|
|
225
|
+
*
|
|
226
|
+
* @param path - The path to the resource
|
|
227
|
+
* @param textures - A table keyed by sampler name with texture resources as values.
|
|
228
|
+
* @example
|
|
229
|
+
* ```ts
|
|
230
|
+
* compute.set_textures("/my_compute.computec", { my_texture: resource.texture() });
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
function set_textures(path: Hash | string, textures: LuaMap<string, Hash> | Record<string, Hash>): void;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export {};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
declare global {
|
|
3
|
+
/**
|
|
4
|
+
* Native crash logging functions and constants.
|
|
5
|
+
*/
|
|
6
|
+
namespace crash {
|
|
7
|
+
/**
|
|
8
|
+
* android build fingerprint
|
|
9
|
+
*/
|
|
10
|
+
const SYSFIELD_ANDROID_BUILD_FINGERPRINT: number & { readonly __brand: "crash.SYSFIELD_ANDROID_BUILD_FINGERPRINT" };
|
|
11
|
+
/**
|
|
12
|
+
* system device language as reported by sys.get_sys_info
|
|
13
|
+
*/
|
|
14
|
+
const SYSFIELD_DEVICE_LANGUAGE: number & { readonly __brand: "crash.SYSFIELD_DEVICE_LANGUAGE" };
|
|
15
|
+
/**
|
|
16
|
+
* device model as reported by sys.get_sys_info
|
|
17
|
+
*/
|
|
18
|
+
const SYSFIELD_DEVICE_MODEL: number & { readonly __brand: "crash.SYSFIELD_DEVICE_MODEL" };
|
|
19
|
+
/**
|
|
20
|
+
* engine version as hash
|
|
21
|
+
*/
|
|
22
|
+
const SYSFIELD_ENGINE_HASH: number & { readonly __brand: "crash.SYSFIELD_ENGINE_HASH" };
|
|
23
|
+
/**
|
|
24
|
+
* engine version as release number
|
|
25
|
+
*/
|
|
26
|
+
const SYSFIELD_ENGINE_VERSION: number & { readonly __brand: "crash.SYSFIELD_ENGINE_VERSION" };
|
|
27
|
+
/**
|
|
28
|
+
* system language as reported by sys.get_sys_info
|
|
29
|
+
*/
|
|
30
|
+
const SYSFIELD_LANGUAGE: number & { readonly __brand: "crash.SYSFIELD_LANGUAGE" };
|
|
31
|
+
/**
|
|
32
|
+
* device manufacturer as reported by sys.get_sys_info
|
|
33
|
+
*/
|
|
34
|
+
const SYSFIELD_MANUFACTURER: number & { readonly __brand: "crash.SYSFIELD_MANUFACTURER" };
|
|
35
|
+
/**
|
|
36
|
+
* The max number of sysfields.
|
|
37
|
+
*/
|
|
38
|
+
const SYSFIELD_MAX: number & { readonly __brand: "crash.SYSFIELD_MAX" };
|
|
39
|
+
/**
|
|
40
|
+
* system name as reported by sys.get_sys_info
|
|
41
|
+
*/
|
|
42
|
+
const SYSFIELD_SYSTEM_NAME: number & { readonly __brand: "crash.SYSFIELD_SYSTEM_NAME" };
|
|
43
|
+
/**
|
|
44
|
+
* system version as reported by sys.get_sys_info
|
|
45
|
+
*/
|
|
46
|
+
const SYSFIELD_SYSTEM_VERSION: number & { readonly __brand: "crash.SYSFIELD_SYSTEM_VERSION" };
|
|
47
|
+
/**
|
|
48
|
+
* system territory as reported by sys.get_sys_info
|
|
49
|
+
*/
|
|
50
|
+
const SYSFIELD_TERRITORY: number & { readonly __brand: "crash.SYSFIELD_TERRITORY" };
|
|
51
|
+
/**
|
|
52
|
+
* The max number of user fields.
|
|
53
|
+
*/
|
|
54
|
+
const USERFIELD_MAX: number & { readonly __brand: "crash.USERFIELD_MAX" };
|
|
55
|
+
/**
|
|
56
|
+
* The max size of a single user field.
|
|
57
|
+
*/
|
|
58
|
+
const USERFIELD_SIZE: number & { readonly __brand: "crash.USERFIELD_SIZE" };
|
|
59
|
+
/**
|
|
60
|
+
* A table is returned containing the addresses of the call stack.
|
|
61
|
+
*
|
|
62
|
+
* @param handle - crash dump handle
|
|
63
|
+
* @returns table containing the backtrace
|
|
64
|
+
*/
|
|
65
|
+
function get_backtrace(handle: number): Record<string | number, unknown>;
|
|
66
|
+
/**
|
|
67
|
+
* The format of read text blob is platform specific
|
|
68
|
+
* and not guaranteed
|
|
69
|
+
* but can be useful for manual inspection.
|
|
70
|
+
*
|
|
71
|
+
* @param handle - crash dump handle
|
|
72
|
+
* @returns string with the platform specific data
|
|
73
|
+
*/
|
|
74
|
+
function get_extra_data(handle: number): string;
|
|
75
|
+
/**
|
|
76
|
+
* The function returns a table containing entries with sub-tables that
|
|
77
|
+
* have fields 'name' and 'address' set for all loaded modules.
|
|
78
|
+
*
|
|
79
|
+
* @param handle - crash dump handle
|
|
80
|
+
* @returns module table
|
|
81
|
+
*/
|
|
82
|
+
function get_modules(handle: number): Record<string | number, unknown>;
|
|
83
|
+
/**
|
|
84
|
+
* read signal number from a crash report
|
|
85
|
+
*
|
|
86
|
+
* @param handle - crash dump handle
|
|
87
|
+
* @returns signal number
|
|
88
|
+
*/
|
|
89
|
+
function get_signum(handle: number): number;
|
|
90
|
+
/**
|
|
91
|
+
* reads a system field from a loaded crash dump
|
|
92
|
+
*
|
|
93
|
+
* @param handle - crash dump handle
|
|
94
|
+
* @param index - system field enum. Must be less than crash.SYSFIELD_MAX
|
|
95
|
+
* @returns value recorded in the crash dump, or `nil` if it didn't exist
|
|
96
|
+
*/
|
|
97
|
+
function get_sys_field(handle: number, index: number): string | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* reads user field from a loaded crash dump
|
|
100
|
+
*
|
|
101
|
+
* @param handle - crash dump handle
|
|
102
|
+
* @param index - user data slot index. **0️⃣ 0-based; passed to Defold unchanged.**
|
|
103
|
+
* @returns user data value recorded in the crash dump
|
|
104
|
+
*/
|
|
105
|
+
function get_user_field(handle: number, index: number): string;
|
|
106
|
+
/**
|
|
107
|
+
* The crash dump will be removed from disk upon a successful
|
|
108
|
+
* load, so loading is one-shot.
|
|
109
|
+
*
|
|
110
|
+
* @returns handle to the loaded dump, or `nil` if no dump was found
|
|
111
|
+
*/
|
|
112
|
+
function load_previous(): number | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* releases a previously loaded crash dump
|
|
115
|
+
*
|
|
116
|
+
* @param handle - handle to loaded crash dump
|
|
117
|
+
*/
|
|
118
|
+
function release(handle: number): void;
|
|
119
|
+
/**
|
|
120
|
+
* Crashes occuring before the path is set will be stored to a default engine location.
|
|
121
|
+
*
|
|
122
|
+
* @param path - file path to use
|
|
123
|
+
*/
|
|
124
|
+
function set_file_path(path: string): void;
|
|
125
|
+
/**
|
|
126
|
+
* Store a user value that will get written to a crash dump when
|
|
127
|
+
* a crash occurs. This can be user id:s, breadcrumb data etc.
|
|
128
|
+
* There are 32 slots indexed from 0. Each slot stores at most 255 characters.
|
|
129
|
+
*
|
|
130
|
+
* @param index - slot index. 0-indexed. **0️⃣ 0-based; passed to Defold unchanged.**
|
|
131
|
+
* @param value - string value to store
|
|
132
|
+
*/
|
|
133
|
+
function set_user_field(index: number, value: string): void;
|
|
134
|
+
/**
|
|
135
|
+
* Performs the same steps as if a crash had just occured but
|
|
136
|
+
* allows the program to continue.
|
|
137
|
+
* The generated dump can be read by crash.load_previous
|
|
138
|
+
*/
|
|
139
|
+
function write_dump(): void;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
declare global {
|
|
3
|
+
/**
|
|
4
|
+
* Editor scripting documentation
|
|
5
|
+
*/
|
|
6
|
+
namespace http {
|
|
7
|
+
/**
|
|
8
|
+
* Perform an HTTP request
|
|
9
|
+
*
|
|
10
|
+
* @param url - request URL
|
|
11
|
+
* @param opts - Additional request options, a table with the following keys:`method string`request method, defaults to `"GET"``headers table`request headers, a table with string keys and values`body string`request body`as string`response body converter, either `"string"` or `"json"`; mutually exclusive with `path``path string`destination file path, resolved against project root if relative; mutually exclusive with `as`
|
|
12
|
+
* @returns HTTP response, a table with the following keys:`status integer`response code`headers table`response headers, a table where each key is a lower-cased string, and each value is either a string or an array of strings if the header was repeated`body string, any, nil`response body, present only when `as` option was provided, either a string or a parsed json value`path string, nil`resolved absolute destination path, present only after a successful response was written when the `path` option was provided
|
|
13
|
+
*/
|
|
14
|
+
function request(url: string, opts?: Record<string | number, unknown>): Record<string | number, unknown>;
|
|
15
|
+
namespace server {
|
|
16
|
+
/**
|
|
17
|
+
* Create HTTP response that will stream the content of a file defined by the path
|
|
18
|
+
*
|
|
19
|
+
* @param path - External file path, resolved against project root if relative
|
|
20
|
+
* @param status - HTTP status code, an integer, default 200
|
|
21
|
+
* @param headers - HTTP response headers, a table from lower-case header names to header values
|
|
22
|
+
* @returns HTTP response value, userdata
|
|
23
|
+
*/
|
|
24
|
+
function external_file_response(path: string, status?: number, headers?: unknown): unknown;
|
|
25
|
+
/**
|
|
26
|
+
* Create HTTP response with a JSON value
|
|
27
|
+
*
|
|
28
|
+
* @param value - Any Lua value that may be represented as JSON
|
|
29
|
+
* @param status - HTTP status code, an integer, default 200
|
|
30
|
+
* @param headers - HTTP response headers, a table from lower-case header names to header values
|
|
31
|
+
* @returns HTTP response value, userdata
|
|
32
|
+
*/
|
|
33
|
+
function json_response(value: unknown, status?: number, headers?: unknown): unknown;
|
|
34
|
+
/**
|
|
35
|
+
* Create HTTP response that will stream the content of a resource defined by the resource path
|
|
36
|
+
*
|
|
37
|
+
* @param resource_path - Resource path (starting with `/`)
|
|
38
|
+
* @param status - HTTP status code, an integer, default 200
|
|
39
|
+
* @param headers - HTTP response headers, a table from lower-case header names to header values
|
|
40
|
+
* @returns HTTP response value, userdata
|
|
41
|
+
*/
|
|
42
|
+
function resource_response(resource_path: string, status?: number, headers?: unknown): unknown;
|
|
43
|
+
/**
|
|
44
|
+
* Create HTTP response
|
|
45
|
+
*
|
|
46
|
+
* @param status - HTTP status code, an integer, default 200
|
|
47
|
+
* @param headers - HTTP response headers, a table from lower-case header names to header values
|
|
48
|
+
* @param body - HTTP response body
|
|
49
|
+
* @returns HTTP response value, userdata
|
|
50
|
+
*/
|
|
51
|
+
function response(status?: number, headers?: unknown, body?: string): unknown;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
declare global {
|
|
3
|
+
/**
|
|
4
|
+
* Editor scripting documentation
|
|
5
|
+
*/
|
|
6
|
+
namespace image {
|
|
7
|
+
/**
|
|
8
|
+
* Load an image file for reading
|
|
9
|
+
*
|
|
10
|
+
* @param path - External file path, resolved against project root if relative
|
|
11
|
+
* @returns image userdata
|
|
12
|
+
*/
|
|
13
|
+
function load_file(path: string): unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Return the color of a pixel from a loaded image.
|
|
16
|
+
* Coordinates are 1-based, with `1, 1` at the top-left corner.
|
|
17
|
+
*
|
|
18
|
+
* @param image - image userdata returned by `image.load_file()`
|
|
19
|
+
* @param x - 1-based horizontal pixel coordinate. **⚠️ 1-based; passed to Defold unchanged.**
|
|
20
|
+
* @param y - 1-based vertical pixel coordinate. **⚠️ 1-based; passed to Defold unchanged.**
|
|
21
|
+
*/
|
|
22
|
+
function pixel(image: unknown, x: number, y: number): LuaMultiReturn<[number, number, number, number]>;
|
|
23
|
+
/**
|
|
24
|
+
* Iterate over pixels in a loaded image.
|
|
25
|
+
* The iterator returns pixels row by row from top-left to bottom-right. Coordinates are 1-based.
|
|
26
|
+
*
|
|
27
|
+
* @param image - image userdata returned by `image.load_file()`
|
|
28
|
+
* @returns iterator function returning `x, y, r, g, b, a` for each pixel. **⚠️ 1-based; passed to Defold unchanged.**
|
|
29
|
+
* @example
|
|
30
|
+
* ```lua
|
|
31
|
+
* local img = image.load_file("assets/source.png")
|
|
32
|
+
* local width, height = image.size(img)
|
|
33
|
+
* for x, y, r, g, b, a in image.pixels(img) do
|
|
34
|
+
* print(x, y, r, g, b, a)
|
|
35
|
+
* end
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
function pixels(image: unknown): (...args: unknown[]) => unknown;
|
|
39
|
+
/**
|
|
40
|
+
* Return the width and height of a loaded image.
|
|
41
|
+
*
|
|
42
|
+
* @param image - image userdata returned by `image.load_file()`
|
|
43
|
+
*/
|
|
44
|
+
function size(image: unknown): LuaMultiReturn<[number, number]>;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import type { Opaque } from "../../../../src/core-types";
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
/**
|
|
6
|
+
* Editor scripting documentation
|
|
7
|
+
*/
|
|
8
|
+
namespace localization {
|
|
9
|
+
/**
|
|
10
|
+
* Create a message pattern that renders a list with the "and" conjunction (for example: a, b, and c) once it is stringified
|
|
11
|
+
*
|
|
12
|
+
* @param items - ] array of values; each value may be `nil`, `boolean`, `number`, `string`, or another `message` instance
|
|
13
|
+
* @returns a userdata value that, when stringified with `tostring()`, will produce a localized text according to the currently selected language in the editor
|
|
14
|
+
*/
|
|
15
|
+
function and_list(items: unknown[]): Opaque<"message">;
|
|
16
|
+
/**
|
|
17
|
+
* Create a message pattern that concatenates values (similar to `table.concat`) and performs the actual concatenation when stringified
|
|
18
|
+
*
|
|
19
|
+
* @param items - ] array of values; each value may be `nil`, `boolean`, `number`, `string`, or another `message` instance
|
|
20
|
+
* @param separator - optional separator inserted between values; defaults to an empty string
|
|
21
|
+
* @returns a userdata value that, when stringified with `tostring()`, will produce a localized text according to the currently selected language in the editor
|
|
22
|
+
*/
|
|
23
|
+
function concat(items: unknown[], separator?: boolean | number | string | Opaque<"message">): Opaque<"message">;
|
|
24
|
+
/**
|
|
25
|
+
* Create a message pattern for a localization key defined in an `.editor_localization` file; the actual localization happens when the returned value is stringified
|
|
26
|
+
*
|
|
27
|
+
* @param key - localization key defined in an `.editor_localization` file
|
|
28
|
+
* @param vars - optional table with variables to be substituted in the localized string that uses ICU Message Format syntax; keys must be strings; values must be either `nil`, `boolean`, `number`, `string`, or another `message` instance
|
|
29
|
+
* @returns a userdata value that, when stringified with `tostring()`, will produce a localized text according to the currently selected language in the editor
|
|
30
|
+
*/
|
|
31
|
+
function message(key: string, vars?: Record<string | number, unknown>): Opaque<"message">;
|
|
32
|
+
/**
|
|
33
|
+
* Create a message pattern that renders a list with the "or" conjunction (for example: a, b, or c) once it is stringified
|
|
34
|
+
*
|
|
35
|
+
* @param items - ] array of values; each value may be `nil`, `boolean`, `number`, `string`, or another `message` instance
|
|
36
|
+
* @returns a userdata value that, when stringified with `tostring()`, will produce a localized text according to the currently selected language in the editor
|
|
37
|
+
*/
|
|
38
|
+
function or_list(items: unknown[]): Opaque<"message">;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
declare global {
|
|
3
|
+
/**
|
|
4
|
+
* Editor scripting documentation
|
|
5
|
+
*/
|
|
6
|
+
namespace tilemap.tiles {
|
|
7
|
+
/**
|
|
8
|
+
* Remove all tiles
|
|
9
|
+
*
|
|
10
|
+
* @param tiles - unbounded 2d grid of tiles
|
|
11
|
+
* @returns unbounded 2d grid of tiles
|
|
12
|
+
*/
|
|
13
|
+
export function clear(tiles: unknown): unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Get full information from a tile at a particular coordinate
|
|
16
|
+
*
|
|
17
|
+
* @param tiles - unbounded 2d grid of tiles
|
|
18
|
+
* @param x - x coordinate of a tile
|
|
19
|
+
* @param y - y coordinate of a tile
|
|
20
|
+
* @returns full tile information table with the following keys:`index integer`1-indexed tile index of a tilemap's tilesource`h_flip boolean`horizontal flip`v_flip boolean`vertical flip`rotate_90 boolean`whether the tile is rotated 90 degrees clockwise. **⚠️ `index` is 1-based; passed to Defold unchanged.**
|
|
21
|
+
*/
|
|
22
|
+
export function get_info(tiles: unknown, x: number, y: number): Record<string | number, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Get a tile index at a particular coordinate
|
|
25
|
+
*
|
|
26
|
+
* @param tiles - unbounded 2d grid of tiles
|
|
27
|
+
* @param x - x coordinate of a tile
|
|
28
|
+
* @param y - y coordinate of a tile
|
|
29
|
+
* @returns 1-indexed tile index of a tilemap's tilesource. **⚠️ 1-based; passed to Defold unchanged.**
|
|
30
|
+
*/
|
|
31
|
+
export function get_tile(tiles: unknown, x: number, y: number): number;
|
|
32
|
+
/**
|
|
33
|
+
* Create an iterator over all tiles in a tiles data structure
|
|
34
|
+
* When iterating using for loop, each iteration returns x, y and tile index of a tile in a tile map
|
|
35
|
+
*
|
|
36
|
+
* @param tiles - unbounded 2d grid of tiles
|
|
37
|
+
* @returns iterator
|
|
38
|
+
* @example
|
|
39
|
+
* ```lua
|
|
40
|
+
* Iterate over all tiles in a tile map:
|
|
41
|
+
* local layers = editor.get("/level.tilemap", "layers")
|
|
42
|
+
* for i = 1, #layers do
|
|
43
|
+
* local tiles = editor.get(layers[i], "tiles")
|
|
44
|
+
* for x, y, i in tilemap.tiles.iterator(tiles) do
|
|
45
|
+
* print(x, y, i)
|
|
46
|
+
* end
|
|
47
|
+
* end
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export function iterator(tiles: unknown): (...args: unknown[]) => unknown;
|
|
51
|
+
/**
|
|
52
|
+
* Create a new unbounded 2d grid data structure for storing tilemap layer tiles
|
|
53
|
+
*
|
|
54
|
+
* @returns unbounded 2d grid of tiles
|
|
55
|
+
*/
|
|
56
|
+
function _new(): unknown;
|
|
57
|
+
/**
|
|
58
|
+
* Remove a tile at a particular coordinate
|
|
59
|
+
*
|
|
60
|
+
* @param tiles - unbounded 2d grid of tiles
|
|
61
|
+
* @param x - x coordinate of a tile
|
|
62
|
+
* @param y - y coordinate of a tile
|
|
63
|
+
* @returns unbounded 2d grid of tiles
|
|
64
|
+
*/
|
|
65
|
+
export function remove(tiles: unknown, x: number, y: number): unknown;
|
|
66
|
+
/**
|
|
67
|
+
* Set a tile at a particular coordinate
|
|
68
|
+
*
|
|
69
|
+
* @param tiles - unbounded 2d grid of tiles
|
|
70
|
+
* @param x - x coordinate of a tile
|
|
71
|
+
* @param y - y coordinate of a tile
|
|
72
|
+
* @param tile_or_info - Either 1-indexed tile index of a tilemap's tilesource or full tile information table with the following keys:`index integer`1-indexed tile index of a tilemap's tilesource`h_flip boolean`horizontal flip`v_flip boolean`vertical flip`rotate_90 boolean`whether the tile is rotated 90 degrees clockwise. **⚠️ 1-based; passed to Defold unchanged.** **⚠️ `index` is 1-based; passed to Defold unchanged.**
|
|
73
|
+
* @returns unbounded 2d grid of tiles
|
|
74
|
+
*/
|
|
75
|
+
export function set(tiles: unknown, x: number, y: number, tile_or_info: number | Record<string | number, unknown>): unknown;
|
|
76
|
+
export { _new as new };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
declare global {
|
|
3
|
+
/**
|
|
4
|
+
* Editor scripting documentation
|
|
5
|
+
*/
|
|
6
|
+
namespace zlib {
|
|
7
|
+
/**
|
|
8
|
+
* Deflate (compress) a buffer
|
|
9
|
+
*
|
|
10
|
+
* @param buf - buffer to deflate
|
|
11
|
+
* @returns deflated buffer
|
|
12
|
+
*/
|
|
13
|
+
function deflate(buf: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Inflate (decompress) a buffer
|
|
16
|
+
*
|
|
17
|
+
* @param buf - buffer to inflate
|
|
18
|
+
* @returns inflated buffer
|
|
19
|
+
*/
|
|
20
|
+
function inflate(buf: string): string;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {};
|