@ts-defold/types 1.2.44 → 1.2.46
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/index.d.ts +58 -46
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="lua-types/5.1" />
|
|
3
3
|
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
4
4
|
|
|
5
|
-
// DEFOLD. stable version 1.8.
|
|
5
|
+
// DEFOLD. stable version 1.8.1 (fd1ad4c17bfdcd890ea7176f2672c35102384419)
|
|
6
6
|
// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
|
|
7
7
|
|
|
8
8
|
|
|
@@ -358,17 +358,17 @@ declare namespace b2d.body {
|
|
|
358
358
|
export function get_linear_velocity(body: any): vmath.vector3
|
|
359
359
|
|
|
360
360
|
/**
|
|
361
|
-
* Get the world
|
|
361
|
+
* Get the world velocity of a local point.
|
|
362
362
|
* @param body body
|
|
363
|
-
* @param
|
|
363
|
+
* @param local_point a point in local coordinates.
|
|
364
364
|
* @return velocity the world velocity of a point.
|
|
365
365
|
*/
|
|
366
|
-
export function
|
|
366
|
+
export function get_linear_velocity_from_local_point(body: any, local_point: vmath.vector3): vmath.vector3
|
|
367
367
|
|
|
368
368
|
/**
|
|
369
|
-
* Get the world velocity of a
|
|
369
|
+
* Get the world linear velocity of a world point attached to this body.
|
|
370
370
|
* @param body body
|
|
371
|
-
* @param world_point a point in
|
|
371
|
+
* @param world_point a point in world coordinates.
|
|
372
372
|
* @return velocity the world velocity of a point.
|
|
373
373
|
*/
|
|
374
374
|
export function get_linear_velocity_from_world_point(body: any, world_point: vmath.vector3): vmath.vector3
|
|
@@ -2398,7 +2398,7 @@ with a custom curve. See the animation guide for more information.
|
|
|
2398
2398
|
* @param recursive check hierarchy recursively
|
|
2399
2399
|
* @return enabled whether the node is enabled or not
|
|
2400
2400
|
*/
|
|
2401
|
-
export function is_enabled(node: node, recursive
|
|
2401
|
+
export function is_enabled(node: node, recursive?: boolean): boolean
|
|
2402
2402
|
|
|
2403
2403
|
/**
|
|
2404
2404
|
* Alters the ordering of the two supplied nodes by moving the first node
|
|
@@ -2805,10 +2805,10 @@ the new state of the emitter:
|
|
|
2805
2805
|
/**
|
|
2806
2806
|
* Sets the parent node of the specified node.
|
|
2807
2807
|
* @param node node for which to set its parent
|
|
2808
|
-
* @param parent parent node to set
|
|
2808
|
+
* @param parent parent node to set, pass `nil` to remove parent
|
|
2809
2809
|
* @param keep_scene_transform optional flag to make the scene position being perserved
|
|
2810
2810
|
*/
|
|
2811
|
-
export function set_parent(node: node, parent
|
|
2811
|
+
export function set_parent(node: node, parent?: node, keep_scene_transform?: boolean): void
|
|
2812
2812
|
|
|
2813
2813
|
/**
|
|
2814
2814
|
* Set the paricle fx for a gui node
|
|
@@ -2925,7 +2925,7 @@ the new state of the emitter:
|
|
|
2925
2925
|
* @param node node to set text for
|
|
2926
2926
|
* @param text text to set
|
|
2927
2927
|
*/
|
|
2928
|
-
export function set_text(node: node, text: string): void
|
|
2928
|
+
export function set_text(node: node, text: string | number): void
|
|
2929
2929
|
|
|
2930
2930
|
/**
|
|
2931
2931
|
* Set the texture on a box or pie node. The texture must be mapped to
|
|
@@ -3019,7 +3019,7 @@ the new state of the emitter:
|
|
|
3019
3019
|
`clear`: instantly clear spawned particles
|
|
3020
3020
|
|
|
3021
3021
|
*/
|
|
3022
|
-
export function stop_particlefx(node: node, options
|
|
3022
|
+
export function stop_particlefx(node: node, options?: any): void
|
|
3023
3023
|
|
|
3024
3024
|
|
|
3025
3025
|
/**
|
|
@@ -3162,6 +3162,26 @@ declare namespace physics {
|
|
|
3162
3162
|
*/
|
|
3163
3163
|
export let JOINT_TYPE_WHEEL: any
|
|
3164
3164
|
|
|
3165
|
+
/**
|
|
3166
|
+
*
|
|
3167
|
+
*/
|
|
3168
|
+
export let SHAPE_TYPE_BOX: any
|
|
3169
|
+
|
|
3170
|
+
/**
|
|
3171
|
+
*
|
|
3172
|
+
*/
|
|
3173
|
+
export let SHAPE_TYPE_CAPSULE: any
|
|
3174
|
+
|
|
3175
|
+
/**
|
|
3176
|
+
*
|
|
3177
|
+
*/
|
|
3178
|
+
export let SHAPE_TYPE_HULL: any
|
|
3179
|
+
|
|
3180
|
+
/**
|
|
3181
|
+
*
|
|
3182
|
+
*/
|
|
3183
|
+
export let SHAPE_TYPE_SPHERE: any
|
|
3184
|
+
|
|
3165
3185
|
/**
|
|
3166
3186
|
* Create a physics joint between two collision object components.
|
|
3167
3187
|
* Note: Currently only supported in 2D physics.
|
|
@@ -3312,7 +3332,7 @@ Set to `true` to return all ray cast hits. If `false`, it will only return the c
|
|
|
3312
3332
|
|
|
3313
3333
|
* @return result It returns a list. If missed it returns `nil`. See ray_cast_response for details on the returned values.
|
|
3314
3334
|
*/
|
|
3315
|
-
export function raycast(from: vmath.vector3, to: vmath.vector3, groups: any, options
|
|
3335
|
+
export function raycast(from: vmath.vector3, to: vmath.vector3, groups: any, options?: any): LuaMultiReturn<[any, any]>
|
|
3316
3336
|
|
|
3317
3337
|
/**
|
|
3318
3338
|
* Ray casts are used to test for intersections against collision objects in the physics world.
|
|
@@ -3418,17 +3438,20 @@ See physics.get_shape for a detailed description of each field in the data table
|
|
|
3418
3438
|
`local function set_shape_data()
|
|
3419
3439
|
-- set capsule shape data
|
|
3420
3440
|
local data = {}
|
|
3441
|
+
data.type = physics.SHAPE_TYPE_CAPSULE
|
|
3421
3442
|
data.diameter = 10
|
|
3422
3443
|
data.height = 20
|
|
3423
3444
|
physics.set_shape("#collisionobject", "my_capsule_shape", data)
|
|
3424
3445
|
|
|
3425
3446
|
-- set sphere shape data
|
|
3426
3447
|
data = {}
|
|
3448
|
+
data.type = physics.SHAPE_TYPE_SPHERE
|
|
3427
3449
|
data.diameter = 10
|
|
3428
3450
|
physics.set_shape("#collisionobject", "my_sphere_shape", data)
|
|
3429
3451
|
|
|
3430
3452
|
-- set box shape data
|
|
3431
3453
|
data = {}
|
|
3454
|
+
data.type = physics.SHAPE_TYPE_BOX
|
|
3432
3455
|
data.dimensions = vmath.vector3(10, 10, 5)
|
|
3433
3456
|
physics.set_shape("#collisionobject", "my_box_shape", data)
|
|
3434
3457
|
end
|
|
@@ -4405,6 +4428,23 @@ to enable those textures as well. Currently 4 color attachments are supported:
|
|
|
4405
4428
|
*/
|
|
4406
4429
|
export function set_blend_func(source_factor: any, destination_factor: any): void
|
|
4407
4430
|
|
|
4431
|
+
/**
|
|
4432
|
+
* Sets the current render camera to be used for rendering. If a render camera
|
|
4433
|
+
* has been set by the render script, the renderer will be using its projection and view matrix
|
|
4434
|
+
* during rendering. If a projection and/or view matrix has been set by the render script,
|
|
4435
|
+
* they will not be used until the current render camera has been reset by calling `render.set_camera()`.
|
|
4436
|
+
* If the 'use_frustum' flag in the options table has been set to true, the renderer will automatically use the
|
|
4437
|
+
* camera frustum for frustum culling regardless of what frustum is being passed into the render.draw() function.
|
|
4438
|
+
* Note that the frustum plane option in render.draw can still be used together with the camera.
|
|
4439
|
+
* @param camera camera id to use, or nil to reset
|
|
4440
|
+
* @param options optional table with properties:
|
|
4441
|
+
|
|
4442
|
+
`use_frustum`
|
|
4443
|
+
If true, the renderer will use the cameras view-projection matrix for frustum culling (default: false)
|
|
4444
|
+
|
|
4445
|
+
*/
|
|
4446
|
+
export function set_camera(camera: any, options?: any): void
|
|
4447
|
+
|
|
4408
4448
|
/**
|
|
4409
4449
|
* Specifies whether the individual color components in the frame buffer is enabled for writing (`true`) or disabled (`false`). For example, if `blue` is `false`, nothing is written to the blue component of any pixel in any of the color buffers, regardless of the drawing operation attempted. Note that writing are either enabled or disabled for entire color components, not the individual bits of a component.
|
|
4410
4450
|
* The component masks are all initially `true`.
|
|
@@ -4926,7 +4966,7 @@ optional flag to determine wether or not the resource should take over ownership
|
|
|
4926
4966
|
|
|
4927
4967
|
* @return path Returns the buffer resource path
|
|
4928
4968
|
*/
|
|
4929
|
-
export function create_buffer(path: string, table
|
|
4969
|
+
export function create_buffer(path: string, table?: any): hash
|
|
4930
4970
|
|
|
4931
4971
|
/**
|
|
4932
4972
|
* Creates a new texture resource that can be used in the same way as any texture created during build time.
|
|
@@ -5370,7 +5410,7 @@ optional flag to determine wether or not the resource should take over ownership
|
|
|
5370
5410
|
|
|
5371
5411
|
|
|
5372
5412
|
*/
|
|
5373
|
-
export function set_buffer(path: hash | string, buffer: buffer, table
|
|
5413
|
+
export function set_buffer(path: hash | string, buffer: buffer, table?: any): void
|
|
5374
5414
|
|
|
5375
5415
|
/**
|
|
5376
5416
|
* Update internal sound resource (wavc/oggc) with new data
|
|
@@ -6229,7 +6269,7 @@ The response data. Contains the fields:
|
|
|
6229
6269
|
* @param options optional table with request parameters. Supported entries:
|
|
6230
6270
|
|
|
6231
6271
|
`timeout`: timeout in seconds
|
|
6232
|
-
|
|
6272
|
+
Path should be absolute
|
|
6233
6273
|
Not available in HTML5 build
|
|
6234
6274
|
Not available in HTML5 build
|
|
6235
6275
|
|
|
@@ -6330,7 +6370,7 @@ declare namespace json {
|
|
|
6330
6370
|
|
|
6331
6371
|
* @return data decoded json
|
|
6332
6372
|
*/
|
|
6333
|
-
export function decode(json: string, options
|
|
6373
|
+
export function decode(json: string, options?: any): any
|
|
6334
6374
|
|
|
6335
6375
|
/**
|
|
6336
6376
|
* Encode a lua table to a JSON string.
|
|
@@ -6342,7 +6382,7 @@ declare namespace json {
|
|
|
6342
6382
|
|
|
6343
6383
|
* @return json encoded json
|
|
6344
6384
|
*/
|
|
6345
|
-
export function encode(tbl: any, options
|
|
6385
|
+
export function encode(tbl: any, options?: any): string
|
|
6346
6386
|
|
|
6347
6387
|
/**
|
|
6348
6388
|
* null
|
|
@@ -6967,14 +7007,6 @@ declare namespace zlib {
|
|
|
6967
7007
|
|
|
6968
7008
|
declare namespace camera {
|
|
6969
7009
|
|
|
6970
|
-
/**
|
|
6971
|
-
* Post this message to a camera-component to activate it.
|
|
6972
|
-
* Several cameras can be active at the same time, but only the camera that was last activated will be used for rendering.
|
|
6973
|
-
* When the camera is deactivated (see `release_camera_focus`), the previously activated camera will again be used for rendering automatically.
|
|
6974
|
-
* The reason it is called "camera focus" is the similarity to how acquiring input focus works (see `acquire_input_focus`).
|
|
6975
|
-
*/
|
|
6976
|
-
export type acquire_camera_focus = "acquire_camera_focus"
|
|
6977
|
-
|
|
6978
7010
|
/**
|
|
6979
7011
|
* The ratio between the frustum width and height. Used when calculating the
|
|
6980
7012
|
* projection of a perspective camera.
|
|
@@ -6982,18 +7014,6 @@ declare namespace camera {
|
|
|
6982
7014
|
*/
|
|
6983
7015
|
export let aspect_ratio: any
|
|
6984
7016
|
|
|
6985
|
-
/**
|
|
6986
|
-
* makes camera active
|
|
6987
|
-
* @param url url of camera component
|
|
6988
|
-
*/
|
|
6989
|
-
export function acquire_focus(url: string | hash | url): void
|
|
6990
|
-
|
|
6991
|
-
/**
|
|
6992
|
-
* deactivate camera
|
|
6993
|
-
* @param url url of camera component
|
|
6994
|
-
*/
|
|
6995
|
-
export function release_focus(url: string | hash | url): void
|
|
6996
|
-
|
|
6997
7017
|
/**
|
|
6998
7018
|
* Camera frustum far plane.
|
|
6999
7019
|
* The type of the property is float.
|
|
@@ -7024,14 +7044,6 @@ declare namespace camera {
|
|
|
7024
7044
|
*/
|
|
7025
7045
|
export let projection: any
|
|
7026
7046
|
|
|
7027
|
-
/**
|
|
7028
|
-
*
|
|
7029
|
-
* Post this message to a camera-component to deactivate it. The camera is then removed from the active cameras.
|
|
7030
|
-
* See `acquire_camera_focus` for more information how the active cameras are used in rendering.
|
|
7031
|
-
*
|
|
7032
|
-
*/
|
|
7033
|
-
export type release_camera_focus = "release_camera_focus"
|
|
7034
|
-
|
|
7035
7047
|
/**
|
|
7036
7048
|
*
|
|
7037
7049
|
* Post this message to a camera-component to set its properties at run-time.
|
|
@@ -7613,7 +7625,7 @@ the new state of the emitter:
|
|
|
7613
7625
|
`clear`: instantly clear spawned particles
|
|
7614
7626
|
|
|
7615
7627
|
*/
|
|
7616
|
-
export function stop(url: string | hash | url, options
|
|
7628
|
+
export function stop(url: string | hash | url, options?: any): void
|
|
7617
7629
|
|
|
7618
7630
|
}
|
|
7619
7631
|
// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
|