@defold-typescript/types 0.26.0 → 0.27.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 +307 -307
- package/api-signatures.json +1311 -0
- package/api-targets.json +342 -0
- package/examples/translations.json +1984 -0
- package/fixtures/messages_doc.json +880 -0
- package/generated/versions/defold-1.12.4/gui.d.ts +43 -43
- package/generated/versions/defold-1.12.4/liveupdate.d.ts +22 -22
- package/generated/versions/defold-1.12.4/physics.d.ts +78 -75
- package/generated/versions/defold-1.12.4/render.d.ts +75 -55
- package/generated/versions/defold-1.12.4/resource.d.ts +187 -175
- package/generated/versions/defold-1.13.0/b2d.d.ts +33 -0
- package/generated/versions/defold-1.13.0/b2d_body.d.ts +676 -0
- package/generated/versions/defold-1.13.0/b2d_chain.d.ts +106 -0
- package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +155 -0
- package/generated/versions/defold-1.13.0/b2d_joint.d.ts +823 -0
- package/generated/versions/defold-1.13.0/b2d_shape.d.ts +215 -0
- package/generated/versions/defold-1.13.0/b2d_world.d.ts +314 -0
- package/generated/versions/defold-1.13.0/buffer.d.ts +176 -0
- package/generated/versions/defold-1.13.0/camera.d.ts +302 -0
- package/generated/versions/defold-1.13.0/collectionfactory.d.ts +146 -0
- package/generated/versions/defold-1.13.0/collectionproxy.d.ts +71 -0
- package/generated/versions/defold-1.13.0/compute.d.ts +306 -0
- package/generated/versions/defold-1.13.0/crash.d.ts +143 -0
- package/generated/versions/defold-1.13.0/editor-vm/http.d.ts +56 -0
- package/generated/versions/defold-1.13.0/editor-vm/json.d.ts +10 -0
- package/generated/versions/defold-1.13.0/editor-vm/localization.d.ts +42 -0
- package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +80 -0
- package/generated/versions/defold-1.13.0/editor-vm/zip.d.ts +10 -0
- package/generated/versions/defold-1.13.0/editor-vm/zlib.d.ts +24 -0
- package/generated/versions/defold-1.13.0/editor.d.ts +1092 -0
- package/generated/versions/defold-1.13.0/factory.d.ts +123 -0
- package/generated/versions/defold-1.13.0/font.d.ts +81 -0
- package/generated/versions/defold-1.13.0/go.d.ts +1054 -0
- package/generated/versions/defold-1.13.0/graphics.d.ts +321 -0
- package/generated/versions/defold-1.13.0/gui.d.ts +2370 -0
- package/generated/versions/defold-1.13.0/html5.d.ts +53 -0
- package/generated/versions/defold-1.13.0/http.d.ts +84 -0
- package/generated/versions/defold-1.13.0/iac.d.ts +18 -0
- package/generated/versions/defold-1.13.0/iap.d.ts +60 -0
- package/generated/versions/defold-1.13.0/image.d.ts +139 -0
- package/generated/versions/defold-1.13.0/index.d.ts +48 -0
- package/generated/versions/defold-1.13.0/json.d.ts +76 -0
- package/generated/versions/defold-1.13.0/kinds/editor-script.d.ts +13 -0
- package/generated/versions/defold-1.13.0/label.d.ts +94 -0
- package/generated/versions/defold-1.13.0/liveupdate.d.ts +140 -0
- package/generated/versions/defold-1.13.0/material.d.ts +444 -0
- package/generated/versions/defold-1.13.0/model.d.ts +246 -0
- package/generated/versions/defold-1.13.0/msg.d.ts +10 -0
- package/generated/versions/defold-1.13.0/particlefx.d.ts +166 -0
- package/generated/versions/defold-1.13.0/physics.d.ts +548 -0
- package/generated/versions/defold-1.13.0/profiler.d.ts +233 -0
- package/generated/versions/defold-1.13.0/push.d.ts +66 -0
- package/generated/versions/defold-1.13.0/render.d.ts +1185 -0
- package/generated/versions/defold-1.13.0/resource.d.ts +1530 -0
- package/generated/versions/defold-1.13.0/socket.d.ts +795 -0
- package/generated/versions/defold-1.13.0/sound.d.ts +291 -0
- package/generated/versions/defold-1.13.0/sprite.d.ts +157 -0
- package/generated/versions/defold-1.13.0/sys.d.ts +695 -0
- package/generated/versions/defold-1.13.0/tilemap.d.ts +195 -0
- package/generated/versions/defold-1.13.0/timer.d.ts +114 -0
- package/generated/versions/defold-1.13.0/types.d.ts +61 -0
- package/generated/versions/defold-1.13.0/vmath.d.ts +806 -0
- package/generated/versions/defold-1.13.0/webview.d.ts +68 -0
- package/generated/versions/defold-1.13.0/window.d.ts +198 -0
- package/generated/versions/defold-1.13.0/zlib.d.ts +40 -0
- package/index.d.ts +4 -84
- package/package.json +11 -3
- package/scripts/import-defold-release.ts +18 -1
- package/src/example-store.ts +5 -0
- package/scripts/lua-types-signature-index.ts +0 -151
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import type { Hash } from "../../../src/core-types";
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
/**
|
|
6
|
+
* Functions and constants to access resources.
|
|
7
|
+
*/
|
|
8
|
+
namespace liveupdate {
|
|
9
|
+
/**
|
|
10
|
+
* Mismatch between between expected bundled resources and actual bundled resources. The manifest expects a resource to be in the bundle, but it was not found in the bundle. This is typically the case when a non-excluded resource was modified between publishing the bundle and publishing the manifest.
|
|
11
|
+
*/
|
|
12
|
+
const LIVEUPDATE_BUNDLED_RESOURCE_MISMATCH: number & { readonly __brand: "liveupdate.LIVEUPDATE_BUNDLED_RESOURCE_MISMATCH" };
|
|
13
|
+
/**
|
|
14
|
+
* Mismatch between running engine version and engine versions supported by manifest.
|
|
15
|
+
*/
|
|
16
|
+
const LIVEUPDATE_ENGINE_VERSION_MISMATCH: number & { readonly __brand: "liveupdate.LIVEUPDATE_ENGINE_VERSION_MISMATCH" };
|
|
17
|
+
/**
|
|
18
|
+
* Failed to parse manifest data buffer. The manifest was probably produced by a different engine version.
|
|
19
|
+
*/
|
|
20
|
+
const LIVEUPDATE_FORMAT_ERROR: number & { readonly __brand: "liveupdate.LIVEUPDATE_FORMAT_ERROR" };
|
|
21
|
+
/**
|
|
22
|
+
* Argument was invalid
|
|
23
|
+
*/
|
|
24
|
+
const LIVEUPDATE_INVAL: number & { readonly __brand: "liveupdate.LIVEUPDATE_INVAL" };
|
|
25
|
+
/**
|
|
26
|
+
* The handled resource is invalid.
|
|
27
|
+
*/
|
|
28
|
+
const LIVEUPDATE_INVALID_HEADER: number & { readonly __brand: "liveupdate.LIVEUPDATE_INVALID_HEADER" };
|
|
29
|
+
/**
|
|
30
|
+
* The header of the resource is invalid.
|
|
31
|
+
*/
|
|
32
|
+
const LIVEUPDATE_INVALID_RESOURCE: number & { readonly __brand: "liveupdate.LIVEUPDATE_INVALID_RESOURCE" };
|
|
33
|
+
/**
|
|
34
|
+
* I/O operation failed
|
|
35
|
+
*/
|
|
36
|
+
const LIVEUPDATE_IO_ERROR: number & { readonly __brand: "liveupdate.LIVEUPDATE_IO_ERROR" };
|
|
37
|
+
/**
|
|
38
|
+
* Memory wasn't allocated
|
|
39
|
+
*/
|
|
40
|
+
const LIVEUPDATE_MEM_ERROR: number & { readonly __brand: "liveupdate.LIVEUPDATE_MEM_ERROR" };
|
|
41
|
+
/**
|
|
42
|
+
* LIVEUPDATE_OK
|
|
43
|
+
*/
|
|
44
|
+
const LIVEUPDATE_OK: number & { readonly __brand: "liveupdate.LIVEUPDATE_OK" };
|
|
45
|
+
/**
|
|
46
|
+
* Mismatch between scheme used to load resources. Resources are loaded with a different scheme than from manifest, for example over HTTP or directly from file. This is typically the case when running the game directly from the editor instead of from a bundle.
|
|
47
|
+
*/
|
|
48
|
+
const LIVEUPDATE_SCHEME_MISMATCH: number & { readonly __brand: "liveupdate.LIVEUPDATE_SCHEME_MISMATCH" };
|
|
49
|
+
/**
|
|
50
|
+
* Mismatch between expected and actual integrity data for legacy liveupdate verification.
|
|
51
|
+
*/
|
|
52
|
+
const LIVEUPDATE_SIGNATURE_MISMATCH: number & { readonly __brand: "liveupdate.LIVEUPDATE_SIGNATURE_MISMATCH" };
|
|
53
|
+
/**
|
|
54
|
+
* Unspecified error
|
|
55
|
+
*/
|
|
56
|
+
const LIVEUPDATE_UNKNOWN: number & { readonly __brand: "liveupdate.LIVEUPDATE_UNKNOWN" };
|
|
57
|
+
/**
|
|
58
|
+
* Mismatch between manifest expected version and actual version.
|
|
59
|
+
*/
|
|
60
|
+
const LIVEUPDATE_VERSION_MISMATCH: number & { readonly __brand: "liveupdate.LIVEUPDATE_VERSION_MISMATCH" };
|
|
61
|
+
/**
|
|
62
|
+
* Adds a resource mount to the resource system.
|
|
63
|
+
* After the mount succeeded, the resources are available to load. (i.e. no reboot required)
|
|
64
|
+
*
|
|
65
|
+
* @param name - Unique name of the mount
|
|
66
|
+
* @param uri - The uri of the mount, including the scheme. Currently supported schemes are 'zip' and 'archive'.
|
|
67
|
+
* @param priority - Priority of mount. Larger priority takes prescedence
|
|
68
|
+
* @param callback - Callback after the asynchronous request completed
|
|
69
|
+
* - `name` hash Unique name of the mount
|
|
70
|
+
* - `uri` string The uri of the mount
|
|
71
|
+
* - `result` number The result of the request
|
|
72
|
+
* @returns The result of the request
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* // Add multiple mounts. Higher priority takes precedence.
|
|
76
|
+
* liveupdate.add_mount("common", "zip:/path/to/common_stuff.zip", 10, (result) => {}); // base pack
|
|
77
|
+
* liveupdate.add_mount("levelpack_1", "zip:/path/to/levels_1_to_20.zip", 20, (result) => {}); // level pack
|
|
78
|
+
* liveupdate.add_mount("season_pack_1", "zip:/path/to/easter_pack_1.zip", 30, (result) => {}); // season pack, overriding content in the other packs
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
function add_mount(name: string | Hash, uri: string, priority: number, callback: (self: unknown, name: unknown, uri: unknown, result: unknown) => void): number;
|
|
82
|
+
/**
|
|
83
|
+
* Get an array of the current mounts
|
|
84
|
+
* This can be used to determine if a new mount is needed or not
|
|
85
|
+
*
|
|
86
|
+
* @returns Array of mounts
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* // Output the current resource mounts
|
|
90
|
+
* pprint("MOUNTS", liveupdate.get_mounts());
|
|
91
|
+
*
|
|
92
|
+
* // Give an output like:
|
|
93
|
+
* // DEBUG:SCRIPT: MOUNTS,
|
|
94
|
+
* // {
|
|
95
|
+
* // 1 = {
|
|
96
|
+
* // name = "liveupdate",
|
|
97
|
+
* // uri = "zip:/device/path/to/acchives/liveupdate.zip",
|
|
98
|
+
* // priority = 5
|
|
99
|
+
* // },
|
|
100
|
+
* // 2 = {
|
|
101
|
+
* // name = "_base",
|
|
102
|
+
* // uri = "archive:build/default/game.dmanifest",
|
|
103
|
+
* // priority = -10
|
|
104
|
+
* // }
|
|
105
|
+
* // }
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
function get_mounts(): { name: string; uri: string; priority: number }[];
|
|
109
|
+
/**
|
|
110
|
+
* Checks if the bundled application was built with one or more resources
|
|
111
|
+
* excluded from the main bundle, through a collection proxy with
|
|
112
|
+
* `Exclude` enabled.
|
|
113
|
+
* This value is based on metadata in the bundled manifest. It does not check
|
|
114
|
+
* whether any live update archive has been mounted or whether the excluded
|
|
115
|
+
* resources are currently available on device.
|
|
116
|
+
*
|
|
117
|
+
* @returns true if the bundled application was built with excluded files
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* if (liveupdate.is_built_with_excluded_files()) print("The bundle expects live update content.");
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
function is_built_with_excluded_files(): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Remove a mount the resource system.
|
|
126
|
+
* Removing a mount does not affect any loaded resources.
|
|
127
|
+
*
|
|
128
|
+
* @param name - Unique name of the mount
|
|
129
|
+
* @returns The result of the call
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* // Add multiple mounts. Higher priority takes precedence.
|
|
133
|
+
* liveupdate.remove_mount("season_pack_1");
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
function remove_mount(name: string | Hash): number;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export {};
|
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import type { Hash, Matrix4, Vector3, Vector4 } from "../../../src/core-types";
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
/**
|
|
6
|
+
* Functions for interacting with materials.
|
|
7
|
+
*/
|
|
8
|
+
namespace material {
|
|
9
|
+
/**
|
|
10
|
+
* Returns a table of all the shader constants in the material. This function will return all the shader constants
|
|
11
|
+
* that are used in both the vertex and the fragment shaders.
|
|
12
|
+
*
|
|
13
|
+
* @param path - The path to the resource
|
|
14
|
+
* @returns A table of tables, where each entry contains info about the shader constants:
|
|
15
|
+
*
|
|
16
|
+
* `name`
|
|
17
|
+
* hash the hashed name of the constant
|
|
18
|
+
* `type`
|
|
19
|
+
* number the type of the constant. Supported values:
|
|
20
|
+
*
|
|
21
|
+
* - `material.CONSTANT_TYPE_USER`
|
|
22
|
+
*
|
|
23
|
+
* - `material.CONSTANT_TYPE_USER_MATRIX4`
|
|
24
|
+
*
|
|
25
|
+
* - `material.CONSTANT_TYPE_VIEWPROJ`
|
|
26
|
+
*
|
|
27
|
+
* - `material.CONSTANT_TYPE_WORLD`
|
|
28
|
+
*
|
|
29
|
+
* - `material.CONSTANT_TYPE_TEXTURE`
|
|
30
|
+
*
|
|
31
|
+
* - `material.CONSTANT_TYPE_VIEW`
|
|
32
|
+
*
|
|
33
|
+
* - `material.CONSTANT_TYPE_PROJECTION`
|
|
34
|
+
*
|
|
35
|
+
* - `material.CONSTANT_TYPE_NORMAL`
|
|
36
|
+
*
|
|
37
|
+
* - `material.CONSTANT_TYPE_WORLDVIEW`
|
|
38
|
+
*
|
|
39
|
+
* - `material.CONSTANT_TYPE_WORLDVIEWPROJ`
|
|
40
|
+
*
|
|
41
|
+
* - `material.CONSTANT_TYPE_TIME`
|
|
42
|
+
*
|
|
43
|
+
* - `material.CONSTANT_TYPE_WORLD_INVERSE`
|
|
44
|
+
*
|
|
45
|
+
* - `material.CONSTANT_TYPE_VIEW_INVERSE`
|
|
46
|
+
*
|
|
47
|
+
* - `material.CONSTANT_TYPE_PROJECTION_INVERSE`
|
|
48
|
+
*
|
|
49
|
+
* - `material.CONSTANT_TYPE_VIEWPROJ_INVERSE`
|
|
50
|
+
*
|
|
51
|
+
* - `material.CONSTANT_TYPE_WORLDVIEW_INVERSE`
|
|
52
|
+
*
|
|
53
|
+
* - `material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE`
|
|
54
|
+
*
|
|
55
|
+
* `value`
|
|
56
|
+
* 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`.
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const constants = material.get_constants(resource.material("/my_material.materialc"));
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
function get_constants(path: Hash | string): { name: Hash; type: number; value: Vector4 | Matrix4 }[];
|
|
63
|
+
/**
|
|
64
|
+
* Returns a table of all the texture samplers in the material. This function will return all the texture samplers
|
|
65
|
+
* that are used in both the vertex and the fragment shaders.
|
|
66
|
+
*
|
|
67
|
+
* @param path - The path to the resource
|
|
68
|
+
* @returns A table of tables, where each entry contains info about the texture samplers:
|
|
69
|
+
*
|
|
70
|
+
* `name`
|
|
71
|
+
* hash the hashed name of the texture sampler
|
|
72
|
+
* `u_wrap`
|
|
73
|
+
* number the u wrap mode of the texture sampler. Supported values:
|
|
74
|
+
*
|
|
75
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
76
|
+
*
|
|
77
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
78
|
+
*
|
|
79
|
+
* - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
80
|
+
*
|
|
81
|
+
* - `graphics.TEXTURE_WRAP_REPEAT`
|
|
82
|
+
*
|
|
83
|
+
* `v_wrap`
|
|
84
|
+
* number the v wrap mode of the texture sampler. Supported values:
|
|
85
|
+
*
|
|
86
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
87
|
+
*
|
|
88
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
89
|
+
*
|
|
90
|
+
* - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
91
|
+
*
|
|
92
|
+
* - `graphics.TEXTURE_WRAP_REPEAT`
|
|
93
|
+
*
|
|
94
|
+
* `min_filter`
|
|
95
|
+
* number the min filter mode of the texture sampler. Supported values:
|
|
96
|
+
*
|
|
97
|
+
* - `graphics.TEXTURE_FILTER_DEFAULT`
|
|
98
|
+
*
|
|
99
|
+
* - `graphics.TEXTURE_FILTER_NEAREST`
|
|
100
|
+
*
|
|
101
|
+
* - `graphics.TEXTURE_FILTER_LINEAR`
|
|
102
|
+
*
|
|
103
|
+
* - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST`
|
|
104
|
+
*
|
|
105
|
+
* - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR`
|
|
106
|
+
*
|
|
107
|
+
* - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST`
|
|
108
|
+
*
|
|
109
|
+
* - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR`
|
|
110
|
+
*
|
|
111
|
+
* `mag_filter`
|
|
112
|
+
* number the mag filter mode of the texture sampler
|
|
113
|
+
*
|
|
114
|
+
* - `graphics.TEXTURE_FILTER_DEFAULT`
|
|
115
|
+
*
|
|
116
|
+
* - `graphics.TEXTURE_FILTER_NEAREST`
|
|
117
|
+
*
|
|
118
|
+
* - `graphics.TEXTURE_FILTER_LINEAR`
|
|
119
|
+
*
|
|
120
|
+
* `max_anisotropy`
|
|
121
|
+
* number the max anisotropy of the texture sampler
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* const samplers = material.get_samplers(resource.material("/my_material.materialc"));
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
function get_samplers(path: Hash | string): { name: Hash; u_wrap: number; v_wrap: number; min_filter: number; mag_filter: number; max_anisotropy: number }[];
|
|
128
|
+
/**
|
|
129
|
+
* Returns a table of all the textures from the material.
|
|
130
|
+
*
|
|
131
|
+
* @param path - The path to the resource
|
|
132
|
+
* @returns A table of tables, where each entry contains info about the material textures:
|
|
133
|
+
*
|
|
134
|
+
* `path`
|
|
135
|
+
* hash the resource path of the texture. Only available if the texture is a resource.
|
|
136
|
+
* `handle`
|
|
137
|
+
* hash the runtime handle of the texture.
|
|
138
|
+
* `width`
|
|
139
|
+
* number the width of the texture
|
|
140
|
+
* `height`
|
|
141
|
+
* number the height of the texture
|
|
142
|
+
* `depth`
|
|
143
|
+
* number the depth of the texture. Corresponds to the number of layers in an array texture.
|
|
144
|
+
* `mipmaps`
|
|
145
|
+
* number the number of mipmaps in the texture
|
|
146
|
+
* `type`
|
|
147
|
+
* number the type of the texture. Supported values:
|
|
148
|
+
*
|
|
149
|
+
* - `graphics.TEXTURE_TYPE_2D`
|
|
150
|
+
*
|
|
151
|
+
* - `graphics.TEXTURE_TYPE_2D_ARRAY`
|
|
152
|
+
*
|
|
153
|
+
* - `graphics.TEXTURE_TYPE_CUBE_MAP`
|
|
154
|
+
*
|
|
155
|
+
* - `graphics.TEXTURE_TYPE_IMAGE_2D`
|
|
156
|
+
*
|
|
157
|
+
* - `graphics.TEXTURE_TYPE_3D`
|
|
158
|
+
*
|
|
159
|
+
* - `graphics.TEXTURE_TYPE_IMAGE_3D`
|
|
160
|
+
*
|
|
161
|
+
* `flags`
|
|
162
|
+
* number the flags of the texture. This field is a bit mask of these supported flags:
|
|
163
|
+
*
|
|
164
|
+
* - `graphics.TEXTURE_USAGE_FLAG_SAMPLE`
|
|
165
|
+
*
|
|
166
|
+
* - `graphics.TEXTURE_USAGE_FLAG_MEMORYLESS`
|
|
167
|
+
*
|
|
168
|
+
* - `graphics.TEXTURE_USAGE_FLAG_STORAGE`
|
|
169
|
+
*
|
|
170
|
+
* - `graphics.TEXTURE_USAGE_FLAG_INPUT`
|
|
171
|
+
*
|
|
172
|
+
* - `graphics.TEXTURE_USAGE_FLAG_COLOR`
|
|
173
|
+
* @example
|
|
174
|
+
* ```ts
|
|
175
|
+
* const textures = material.get_textures(resource.material("/my_material.materialc"));
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
function get_textures(path: Hash | string): { path: Hash; handle: Hash; width: number; height: number; depth: number; mipmaps: number; type: number; flags: number }[];
|
|
179
|
+
/**
|
|
180
|
+
* Returns a table of all the vertex attributes in the material. This function will return all the vertex attributes
|
|
181
|
+
* that are used in the vertex shader of the material.
|
|
182
|
+
*
|
|
183
|
+
* @param path - The path to the resource
|
|
184
|
+
* @returns A table of tables, where each entry contains info about the vertex attributes:
|
|
185
|
+
*
|
|
186
|
+
* `name`
|
|
187
|
+
* hash the hashed name of the vertex attribute
|
|
188
|
+
* `value`
|
|
189
|
+
* vmath.vector4 | vmath.vector3 | vmath.matrix4 | number | table the value of the vertex attribute. Matrix attributes that do not map to `vmath.matrix4` are returned as a table of numbers.
|
|
190
|
+
* `normalize`
|
|
191
|
+
* boolean whether the value is normalized when passed into the shader
|
|
192
|
+
* `data_type`
|
|
193
|
+
* number the data type of the vertex attribute. Supported values:
|
|
194
|
+
*
|
|
195
|
+
* - `graphics.DATA_TYPE_BYTE`
|
|
196
|
+
*
|
|
197
|
+
* - `graphics.DATA_TYPE_UNSIGNED_BYTE`
|
|
198
|
+
*
|
|
199
|
+
* - `graphics.DATA_TYPE_SHORT`
|
|
200
|
+
*
|
|
201
|
+
* - `graphics.DATA_TYPE_UNSIGNED_SHORT`
|
|
202
|
+
*
|
|
203
|
+
* - `graphics.DATA_TYPE_INT`
|
|
204
|
+
*
|
|
205
|
+
* - `graphics.DATA_TYPE_UNSIGNED_INT`
|
|
206
|
+
*
|
|
207
|
+
* - `graphics.DATA_TYPE_FLOAT`
|
|
208
|
+
*
|
|
209
|
+
* `coordinate_space`
|
|
210
|
+
* number the coordinate space of the vertex attribute. Supported values:
|
|
211
|
+
*
|
|
212
|
+
* - `graphics.COORDINATE_SPACE_WORLD`
|
|
213
|
+
*
|
|
214
|
+
* - `graphics.COORDINATE_SPACE_LOCAL`
|
|
215
|
+
*
|
|
216
|
+
* `semantic_type`
|
|
217
|
+
* number the semantic type of the vertex attribute. Supported values:
|
|
218
|
+
*
|
|
219
|
+
* - `graphics.SEMANTIC_TYPE_NONE`
|
|
220
|
+
*
|
|
221
|
+
* - `graphics.SEMANTIC_TYPE_POSITION`
|
|
222
|
+
*
|
|
223
|
+
* - `graphics.SEMANTIC_TYPE_TEXCOORD`
|
|
224
|
+
*
|
|
225
|
+
* - `graphics.SEMANTIC_TYPE_PAGE_INDEX`
|
|
226
|
+
*
|
|
227
|
+
* - `graphics.SEMANTIC_TYPE_COLOR`
|
|
228
|
+
*
|
|
229
|
+
* - `graphics.SEMANTIC_TYPE_NORMAL`
|
|
230
|
+
*
|
|
231
|
+
* - `graphics.SEMANTIC_TYPE_TANGENT`
|
|
232
|
+
*
|
|
233
|
+
* - `graphics.SEMANTIC_TYPE_WORLD_MATRIX`
|
|
234
|
+
*
|
|
235
|
+
* - `graphics.SEMANTIC_TYPE_NORMAL_MATRIX`
|
|
236
|
+
*
|
|
237
|
+
* - `graphics.SEMANTIC_TYPE_BONE_WEIGHTS`
|
|
238
|
+
*
|
|
239
|
+
* - `graphics.SEMANTIC_TYPE_BONE_INDICES`
|
|
240
|
+
*
|
|
241
|
+
* - `graphics.SEMANTIC_TYPE_TEXTURE_TRANSFORM_2D`
|
|
242
|
+
* @example
|
|
243
|
+
* ```ts
|
|
244
|
+
* const vertex_attributes = material.get_vertex_attributes(resource.material("/my_material.materialc"));
|
|
245
|
+
* ```
|
|
246
|
+
*/
|
|
247
|
+
function get_vertex_attributes(path: Hash | string): { name: Hash; value: Vector4 | Vector3 | Matrix4 | number | number[]; normalize: boolean; data_type: number; coordinate_space: number; semantic_type: number }[];
|
|
248
|
+
/**
|
|
249
|
+
* Sets shader constants in a material, if the constants exist.
|
|
250
|
+
*
|
|
251
|
+
* @param path - The path to the resource
|
|
252
|
+
* @param constants - A table keyed by constant name with args tables as values. Constants can be partially updated. Supported entries:
|
|
253
|
+
*
|
|
254
|
+
* `type`
|
|
255
|
+
* number the type of the constant. Supported values:
|
|
256
|
+
*
|
|
257
|
+
* - `material.CONSTANT_TYPE_USER`
|
|
258
|
+
*
|
|
259
|
+
* - `material.CONSTANT_TYPE_USER_MATRIX4`
|
|
260
|
+
*
|
|
261
|
+
* - `material.CONSTANT_TYPE_VIEWPROJ`
|
|
262
|
+
*
|
|
263
|
+
* - `material.CONSTANT_TYPE_WORLD`
|
|
264
|
+
*
|
|
265
|
+
* - `material.CONSTANT_TYPE_TEXTURE`
|
|
266
|
+
*
|
|
267
|
+
* - `material.CONSTANT_TYPE_VIEW`
|
|
268
|
+
*
|
|
269
|
+
* - `material.CONSTANT_TYPE_PROJECTION`
|
|
270
|
+
*
|
|
271
|
+
* - `material.CONSTANT_TYPE_NORMAL`
|
|
272
|
+
*
|
|
273
|
+
* - `material.CONSTANT_TYPE_WORLDVIEW`
|
|
274
|
+
*
|
|
275
|
+
* - `material.CONSTANT_TYPE_WORLDVIEWPROJ`
|
|
276
|
+
*
|
|
277
|
+
* - `material.CONSTANT_TYPE_TIME`
|
|
278
|
+
*
|
|
279
|
+
* - `material.CONSTANT_TYPE_WORLD_INVERSE`
|
|
280
|
+
*
|
|
281
|
+
* - `material.CONSTANT_TYPE_VIEW_INVERSE`
|
|
282
|
+
*
|
|
283
|
+
* - `material.CONSTANT_TYPE_PROJECTION_INVERSE`
|
|
284
|
+
*
|
|
285
|
+
* - `material.CONSTANT_TYPE_VIEWPROJ_INVERSE`
|
|
286
|
+
*
|
|
287
|
+
* - `material.CONSTANT_TYPE_WORLDVIEW_INVERSE`
|
|
288
|
+
*
|
|
289
|
+
* - `material.CONSTANT_TYPE_WORLDVIEWPROJ_INVERSE`
|
|
290
|
+
*
|
|
291
|
+
* `value`
|
|
292
|
+
* 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.
|
|
293
|
+
* @example
|
|
294
|
+
* ```ts
|
|
295
|
+
* material.set_constants(resource.material("/my_material.materialc"), { tint: { value: vmath.vector4(1, 0, 0, 1) } });
|
|
296
|
+
* ```
|
|
297
|
+
*/
|
|
298
|
+
function set_constants(path: Hash | string, constants: Record<string, { type?: number; value?: Vector4 | Vector3 | Matrix4 | number | (Vector4 | Matrix4)[] }>): void;
|
|
299
|
+
/**
|
|
300
|
+
* Sets texture samplers in a material, if the samplers exist. Use this function to change the settings of texture samplers.
|
|
301
|
+
* To set actual textures that should be bound to the samplers, use the `material.set_textures` function instead.
|
|
302
|
+
*
|
|
303
|
+
* @param path - The path to the resource
|
|
304
|
+
* @param samplers - A table keyed by sampler name with args tables as values. Partial updates are supported. Supported entries:
|
|
305
|
+
*
|
|
306
|
+
* `u_wrap`
|
|
307
|
+
* number the u wrap mode of the texture sampler. Supported values:
|
|
308
|
+
*
|
|
309
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
310
|
+
*
|
|
311
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
312
|
+
*
|
|
313
|
+
* - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
314
|
+
*
|
|
315
|
+
* - `graphics.TEXTURE_WRAP_REPEAT`
|
|
316
|
+
*
|
|
317
|
+
* `v_wrap`
|
|
318
|
+
* number the v wrap mode of the texture sampler. Supported values:
|
|
319
|
+
*
|
|
320
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_BORDER`
|
|
321
|
+
*
|
|
322
|
+
* - `graphics.TEXTURE_WRAP_CLAMP_TO_EDGE`
|
|
323
|
+
*
|
|
324
|
+
* - `graphics.TEXTURE_WRAP_MIRRORED_REPEAT`
|
|
325
|
+
*
|
|
326
|
+
* - `graphics.TEXTURE_WRAP_REPEAT`
|
|
327
|
+
*
|
|
328
|
+
* `min_filter`
|
|
329
|
+
* number the min filter mode of the texture sampler. Supported values:
|
|
330
|
+
*
|
|
331
|
+
* - `graphics.TEXTURE_FILTER_DEFAULT`
|
|
332
|
+
*
|
|
333
|
+
* - `graphics.TEXTURE_FILTER_NEAREST`
|
|
334
|
+
*
|
|
335
|
+
* - `graphics.TEXTURE_FILTER_LINEAR`
|
|
336
|
+
*
|
|
337
|
+
* - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST`
|
|
338
|
+
*
|
|
339
|
+
* - `graphics.TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR`
|
|
340
|
+
*
|
|
341
|
+
* - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST`
|
|
342
|
+
*
|
|
343
|
+
* - `graphics.TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR`
|
|
344
|
+
*
|
|
345
|
+
* `mag_filter`
|
|
346
|
+
* number the mag filter mode of the texture sampler
|
|
347
|
+
*
|
|
348
|
+
* - `graphics.TEXTURE_FILTER_DEFAULT`
|
|
349
|
+
*
|
|
350
|
+
* - `graphics.TEXTURE_FILTER_NEAREST`
|
|
351
|
+
*
|
|
352
|
+
* - `graphics.TEXTURE_FILTER_LINEAR`
|
|
353
|
+
*
|
|
354
|
+
* `max_anisotropy`
|
|
355
|
+
* number the max anisotropy of the texture sampler
|
|
356
|
+
* @example
|
|
357
|
+
* ```ts
|
|
358
|
+
* material.set_samplers(resource.material("/my_material.materialc"), { texture_sampler: { u_wrap: graphics.TEXTURE_WRAP_REPEAT, v_wrap: graphics.TEXTURE_WRAP_MIRRORED_REPEAT } });
|
|
359
|
+
* ```
|
|
360
|
+
*/
|
|
361
|
+
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;
|
|
362
|
+
/**
|
|
363
|
+
* Sets textures in a material, if the samplers exist.
|
|
364
|
+
*
|
|
365
|
+
* @param path - The path to the resource
|
|
366
|
+
* @param textures - A table keyed by sampler name with texture resources as values.
|
|
367
|
+
* @example
|
|
368
|
+
* ```ts
|
|
369
|
+
* material.set_textures(resource.material("/my_material.materialc"), { my_texture: resource.texture() });
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
function set_textures(path: Hash | string, textures: LuaMap<string, Hash>): void;
|
|
373
|
+
/**
|
|
374
|
+
* Sets vertex attributes in a material, if the vertex attributes exist.
|
|
375
|
+
*
|
|
376
|
+
* @param path - The path to the resource
|
|
377
|
+
* @param attributes - A table keyed by vertex attribute name with args tables as values. Partial updates are supported. Supported entries:
|
|
378
|
+
*
|
|
379
|
+
* `value`
|
|
380
|
+
* vmath.vector4 | vmath.vector3 | vmath.matrix4 | number | table the value of the vertex attribute. Use a table of numbers for matrix attributes that do not map to `vmath.matrix4`.
|
|
381
|
+
* `normalize`
|
|
382
|
+
* boolean whether the value is normalized when passed into the shader
|
|
383
|
+
* `data_type`
|
|
384
|
+
* number the data type of the vertex attribute. Supported values:
|
|
385
|
+
*
|
|
386
|
+
* - `graphics.DATA_TYPE_BYTE`
|
|
387
|
+
*
|
|
388
|
+
* - `graphics.DATA_TYPE_UNSIGNED_BYTE`
|
|
389
|
+
*
|
|
390
|
+
* - `graphics.DATA_TYPE_SHORT`
|
|
391
|
+
*
|
|
392
|
+
* - `graphics.DATA_TYPE_UNSIGNED_SHORT`
|
|
393
|
+
*
|
|
394
|
+
* - `graphics.DATA_TYPE_INT`
|
|
395
|
+
*
|
|
396
|
+
* - `graphics.DATA_TYPE_UNSIGNED_INT`
|
|
397
|
+
*
|
|
398
|
+
* - `graphics.DATA_TYPE_FLOAT`
|
|
399
|
+
*
|
|
400
|
+
* `coordinate_space`
|
|
401
|
+
* number the coordinate space of the vertex attribute. Supported values:
|
|
402
|
+
*
|
|
403
|
+
* - `graphics.COORDINATE_SPACE_DEFAULT`
|
|
404
|
+
*
|
|
405
|
+
* - `graphics.COORDINATE_SPACE_WORLD`
|
|
406
|
+
*
|
|
407
|
+
* - `graphics.COORDINATE_SPACE_LOCAL`
|
|
408
|
+
*
|
|
409
|
+
* `semantic_type`
|
|
410
|
+
* number the semantic type of the vertex attribute. Supported values:
|
|
411
|
+
*
|
|
412
|
+
* - `graphics.SEMANTIC_TYPE_NONE`
|
|
413
|
+
*
|
|
414
|
+
* - `graphics.SEMANTIC_TYPE_POSITION`
|
|
415
|
+
*
|
|
416
|
+
* - `graphics.SEMANTIC_TYPE_TEXCOORD`
|
|
417
|
+
*
|
|
418
|
+
* - `graphics.SEMANTIC_TYPE_PAGE_INDEX`
|
|
419
|
+
*
|
|
420
|
+
* - `graphics.SEMANTIC_TYPE_COLOR`
|
|
421
|
+
*
|
|
422
|
+
* - `graphics.SEMANTIC_TYPE_NORMAL`
|
|
423
|
+
*
|
|
424
|
+
* - `graphics.SEMANTIC_TYPE_TANGENT`
|
|
425
|
+
*
|
|
426
|
+
* - `graphics.SEMANTIC_TYPE_WORLD_MATRIX`
|
|
427
|
+
*
|
|
428
|
+
* - `graphics.SEMANTIC_TYPE_NORMAL_MATRIX`
|
|
429
|
+
*
|
|
430
|
+
* - `graphics.SEMANTIC_TYPE_BONE_WEIGHTS`
|
|
431
|
+
*
|
|
432
|
+
* - `graphics.SEMANTIC_TYPE_BONE_INDICES`
|
|
433
|
+
*
|
|
434
|
+
* - `graphics.SEMANTIC_TYPE_TEXTURE_TRANSFORM_2D`
|
|
435
|
+
* @example
|
|
436
|
+
* ```ts
|
|
437
|
+
* material.set_vertex_attributes(resource.material("/my_material.materialc"), { tint_attribute: { value: vmath.vector4(1, 0, 0, 1), semantic_type: graphics.SEMANTIC_TYPE_COLOR } });
|
|
438
|
+
* ```
|
|
439
|
+
*/
|
|
440
|
+
function set_vertex_attributes(path: Hash | string, attributes: Record<string, { value?: Vector4 | Vector3 | Matrix4 | number | number[]; normalize?: boolean; data_type?: number; coordinate_space?: number; semantic_type?: number }>): void;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export {};
|