@ts-defold/types 1.2.13 → 1.2.16
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 +101 -63
- 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.3.
|
|
5
|
+
// DEFOLD. stable version 1.3.5 (28eafea5a8bfedfddc621a7cd00b39f25bd34922)
|
|
6
6
|
// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
|
|
7
7
|
|
|
8
8
|
|
|
@@ -720,12 +720,12 @@ The id of the animated property.
|
|
|
720
720
|
export function animate(url: string | hash | url, property: string | hash, playback: any, to: number | vmath.vector3 | vmath.vector4 | vmath.quaternion, easing: any, duration: number, delay?: number, complete_function?: any): void
|
|
721
721
|
|
|
722
722
|
/**
|
|
723
|
-
* By calling this function, all stored animations of the
|
|
723
|
+
* By calling this function, all or specified stored property animations of the game object or component will be canceled.
|
|
724
724
|
* See the properties guide for which properties can be animated and the animation guide for how to animate them.
|
|
725
|
-
* @param url url of the game object or component
|
|
726
|
-
* @param property id of the property to cancel
|
|
725
|
+
* @param url url of the game object or component
|
|
726
|
+
* @param property optional id of the property to cancel
|
|
727
727
|
*/
|
|
728
|
-
export function cancel_animations(url: string | hash | url, property
|
|
728
|
+
export function cancel_animations(url: string | hash | url, property?: string | hash): void
|
|
729
729
|
|
|
730
730
|
/**
|
|
731
731
|
* Delete one or more game objects identified by id. Deletion is asynchronous meaning that
|
|
@@ -1875,6 +1875,14 @@ with a custom curve. See the animation guide for more information.
|
|
|
1875
1875
|
*/
|
|
1876
1876
|
export function get_tracking(node: node): number
|
|
1877
1877
|
|
|
1878
|
+
/**
|
|
1879
|
+
* Returns `true` if a node is visible and `false` if it's not.
|
|
1880
|
+
* Invisible nodes are not rendered.
|
|
1881
|
+
* @param node node to query
|
|
1882
|
+
* @return visible whether the node is visible or not
|
|
1883
|
+
*/
|
|
1884
|
+
export function get_visible(node: node): boolean
|
|
1885
|
+
|
|
1878
1886
|
/**
|
|
1879
1887
|
* Returns the scene width.
|
|
1880
1888
|
* @return width scene width
|
|
@@ -2429,6 +2437,13 @@ the new state of the emitter:
|
|
|
2429
2437
|
*/
|
|
2430
2438
|
export function set_tracking(node: node, tracking: number): void
|
|
2431
2439
|
|
|
2440
|
+
/**
|
|
2441
|
+
* Set if a node should be visible or not. Only visible nodes are rendered.
|
|
2442
|
+
* @param node node to be visible or not
|
|
2443
|
+
* @param visible whether the node should be visible or not
|
|
2444
|
+
*/
|
|
2445
|
+
export function set_visible(node: node, visible: boolean): void
|
|
2446
|
+
|
|
2432
2447
|
/**
|
|
2433
2448
|
* The x-anchor specifies how the node is moved when the game is run in a different resolution.
|
|
2434
2449
|
* @param node node to set x-anchor for
|
|
@@ -2472,8 +2487,12 @@ the new state of the emitter:
|
|
|
2472
2487
|
/**
|
|
2473
2488
|
* Stops the particle fx for a gui node
|
|
2474
2489
|
* @param node node to stop particle fx for
|
|
2490
|
+
* @param options options when stopping the particle fx. Supported options:
|
|
2491
|
+
|
|
2492
|
+
`clear`: instantly clear spawned particles
|
|
2493
|
+
|
|
2475
2494
|
*/
|
|
2476
|
-
export function stop_particlefx(node: node): void
|
|
2495
|
+
export function stop_particlefx(node: node, options: any): void
|
|
2477
2496
|
|
|
2478
2497
|
|
|
2479
2498
|
/**
|
|
@@ -2622,11 +2641,11 @@ See each joint type for possible properties field. The one field that is accepte
|
|
|
2622
2641
|
* Returns the group name of a collision object as a hash.
|
|
2623
2642
|
* @param url the collision object to return the group of.
|
|
2624
2643
|
* @return hash value of the group.
|
|
2625
|
-
local function check_is_enemy()
|
|
2644
|
+
`local function check_is_enemy()
|
|
2626
2645
|
local group = physics.get_group("#collisionobject")
|
|
2627
2646
|
return group == hash("enemy")
|
|
2628
2647
|
end
|
|
2629
|
-
|
|
2648
|
+
`
|
|
2630
2649
|
*/
|
|
2631
2650
|
export function get_group(url: string | hash | url): hash
|
|
2632
2651
|
|
|
@@ -2669,12 +2688,12 @@ end
|
|
|
2669
2688
|
* @param url the collision object to check the mask of.
|
|
2670
2689
|
* @param group the name of the group to check for.
|
|
2671
2690
|
* @return boolean value of the maskbit. 'true' if present, 'false' otherwise.
|
|
2672
|
-
local function is_invincible()
|
|
2691
|
+
`local function is_invincible()
|
|
2673
2692
|
-- check if the collisionobject would collide with the "bullet" group
|
|
2674
2693
|
local invincible = physics.get_maskbit("#collisionobject", "bullet")
|
|
2675
2694
|
return invincible
|
|
2676
2695
|
end
|
|
2677
|
-
|
|
2696
|
+
`
|
|
2678
2697
|
*/
|
|
2679
2698
|
export function get_maskbit(url: string | hash | url, group: string): boolean
|
|
2680
2699
|
|
|
@@ -2728,10 +2747,10 @@ Set to `true` to return all ray cast hits. If `false`, it will only return the c
|
|
|
2728
2747
|
* a collision object in the editor.
|
|
2729
2748
|
* @param url the collision object affected.
|
|
2730
2749
|
* @param group the new group name to be assigned.
|
|
2731
|
-
local function change_collision_group()
|
|
2750
|
+
`local function change_collision_group()
|
|
2732
2751
|
physics.set_group("#collisionobject", "enemy")
|
|
2733
2752
|
end
|
|
2734
|
-
|
|
2753
|
+
`
|
|
2735
2754
|
*/
|
|
2736
2755
|
export function set_group(url: string | hash | url, group: string): void
|
|
2737
2756
|
|
|
@@ -2758,11 +2777,11 @@ Note: The `collide_connected` field cannot be updated/changed after a connection
|
|
|
2758
2777
|
* @param url the collision object to change the mask of.
|
|
2759
2778
|
* @param group the name of the group (maskbit) to modify in the mask.
|
|
2760
2779
|
* @param maskbit boolean value of the new maskbit. 'true' to enable, 'false' to disable.
|
|
2761
|
-
local function make_invincible()
|
|
2780
|
+
`local function make_invincible()
|
|
2762
2781
|
-- no longer collide with the "bullet" group
|
|
2763
2782
|
physics.set_maskbit("#collisionobject", "bullet", false)
|
|
2764
2783
|
end
|
|
2765
|
-
|
|
2784
|
+
`
|
|
2766
2785
|
*/
|
|
2767
2786
|
export function set_maskbit(url: string | hash | url, group: string, maskbit: boolean): void
|
|
2768
2787
|
|
|
@@ -2777,12 +2796,12 @@ end
|
|
|
2777
2796
|
* Collision objects tend to fall asleep when inactive for a small period of time for
|
|
2778
2797
|
* efficiency reasons. This function wakes them up.
|
|
2779
2798
|
* @param url the collision object to wake.
|
|
2780
|
-
function on_input(self, action_id, action)
|
|
2799
|
+
`function on_input(self, action_id, action)
|
|
2781
2800
|
if action_id == hash("test") and action.pressed then
|
|
2782
2801
|
physics.wakeup("#collisionobject")
|
|
2783
2802
|
end
|
|
2784
2803
|
end
|
|
2785
|
-
|
|
2804
|
+
`
|
|
2786
2805
|
*/
|
|
2787
2806
|
export function wakeup(url: string | hash | url): void
|
|
2788
2807
|
|
|
@@ -2895,12 +2914,29 @@ declare namespace profiler {
|
|
|
2895
2914
|
*/
|
|
2896
2915
|
export function get_memory_usage(): number
|
|
2897
2916
|
|
|
2917
|
+
/**
|
|
2918
|
+
* Send a text to the profiler
|
|
2919
|
+
* @param text the string to send to the profiler
|
|
2920
|
+
*/
|
|
2921
|
+
export function log_text(text: string): void
|
|
2922
|
+
|
|
2898
2923
|
/**
|
|
2899
2924
|
* Get the number of recorded frames in the on-screen profiler ui recording buffer
|
|
2900
2925
|
* @return frame_count the number of recorded frames, zero if on-screen profiler is disabled
|
|
2901
2926
|
*/
|
|
2902
2927
|
export function recorded_frame_count(): number
|
|
2903
2928
|
|
|
2929
|
+
/**
|
|
2930
|
+
* Starts a profile scope.
|
|
2931
|
+
* @param name The name of the scope
|
|
2932
|
+
*/
|
|
2933
|
+
export function scope_begin(name: string): void
|
|
2934
|
+
|
|
2935
|
+
/**
|
|
2936
|
+
* End the current profile scope.
|
|
2937
|
+
*/
|
|
2938
|
+
export function scope_end(): void
|
|
2939
|
+
|
|
2904
2940
|
/**
|
|
2905
2941
|
* Set the on-screen profile mode - run, pause, record or show peak frame
|
|
2906
2942
|
* @param mode the mode to set the ui profiler in
|
|
@@ -3049,6 +3085,26 @@ declare namespace render {
|
|
|
3049
3085
|
*/
|
|
3050
3086
|
export let BLEND_ZERO: any
|
|
3051
3087
|
|
|
3088
|
+
/**
|
|
3089
|
+
*
|
|
3090
|
+
*/
|
|
3091
|
+
export let BUFFER_COLOR0_BIT: any
|
|
3092
|
+
|
|
3093
|
+
/**
|
|
3094
|
+
*
|
|
3095
|
+
*/
|
|
3096
|
+
export let BUFFER_COLOR1_BIT: any
|
|
3097
|
+
|
|
3098
|
+
/**
|
|
3099
|
+
*
|
|
3100
|
+
*/
|
|
3101
|
+
export let BUFFER_COLOR2_BIT: any
|
|
3102
|
+
|
|
3103
|
+
/**
|
|
3104
|
+
*
|
|
3105
|
+
*/
|
|
3106
|
+
export let BUFFER_COLOR3_BIT: any
|
|
3107
|
+
|
|
3052
3108
|
/**
|
|
3053
3109
|
*
|
|
3054
3110
|
*/
|
|
@@ -3285,7 +3341,8 @@ declare namespace render {
|
|
|
3285
3341
|
export let WRAP_REPEAT: any
|
|
3286
3342
|
|
|
3287
3343
|
/**
|
|
3288
|
-
* Clear buffers in the currently enabled render target with specified value.
|
|
3344
|
+
* Clear buffers in the currently enabled render target with specified value. If the render target has been created with multiple
|
|
3345
|
+
* color attachments, all buffers will be cleared with the same value.
|
|
3289
3346
|
* @param buffers table with keys specifying which buffers to clear and values set to clear values. Available keys are:
|
|
3290
3347
|
|
|
3291
3348
|
- `render.BUFFER_COLOR_BIT`
|
|
@@ -3395,6 +3452,14 @@ A frustum matrix used to cull renderable items. (E.g. `local frustum = proj * vi
|
|
|
3395
3452
|
- `render.BUFFER_DEPTH_BIT`
|
|
3396
3453
|
- `render.BUFFER_STENCIL_BIT`
|
|
3397
3454
|
|
|
3455
|
+
If the render target has been created with multiple color attachments, these buffer types can be used
|
|
3456
|
+
to enable those textures as well. Currently only 4 color attachments are supported.
|
|
3457
|
+
|
|
3458
|
+
- `render.BUFFER_COLOR0_BIT`
|
|
3459
|
+
- `render.BUFFER_COLOR1_BIT`
|
|
3460
|
+
- `render.BUFFER_COLOR2_BIT`
|
|
3461
|
+
- `render.BUFFER_COLOR3_BIT`
|
|
3462
|
+
|
|
3398
3463
|
*/
|
|
3399
3464
|
export function enable_texture(unit: number, render_target: any, buffer_type: any): void
|
|
3400
3465
|
|
|
@@ -3511,6 +3576,9 @@ A frustum matrix used to cull renderable items. (E.g. `local frustum = proj * vi
|
|
|
3511
3576
|
*
|
|
3512
3577
|
*
|
|
3513
3578
|
*
|
|
3579
|
+
* The render target can be created to support multiple color attachments. Each attachment can have different format settings and texture filters,
|
|
3580
|
+
* but attachments must be added in sequence, meaning you cannot create a render target at slot 0 and 3.
|
|
3581
|
+
* Instead it has to be created with all four buffer types ranging from [0..3] (as denoted by render.BUFFER_COLORX_BIT where 'X' is the attachment you want to create).
|
|
3514
3582
|
* @param name render target name
|
|
3515
3583
|
* @param parameters table of buffer parameters, see the description for available keys and values
|
|
3516
3584
|
* @return render_target new render target
|
|
@@ -4041,8 +4109,11 @@ The texture format. Supported values:
|
|
|
4041
4109
|
export function set_texture(path: hash | string, table: any, buffer: buffer): void
|
|
4042
4110
|
|
|
4043
4111
|
/**
|
|
4044
|
-
* Stores a zip file and uses it for live update content.
|
|
4045
|
-
*
|
|
4112
|
+
* Stores a zip file and uses it for live update content. The contents of the
|
|
4113
|
+
* zip file will be verified against the manifest to ensure file integrity.
|
|
4114
|
+
* It is possible to opt out of the resource verification using an option passed
|
|
4115
|
+
* to this function.
|
|
4116
|
+
* The path is stored in the (internal) live update location.
|
|
4046
4117
|
* @param path the path to the original file on disc
|
|
4047
4118
|
* @param callback the callback function
|
|
4048
4119
|
executed after the storage has completed
|
|
@@ -4052,8 +4123,12 @@ The current object.
|
|
|
4052
4123
|
`status`
|
|
4053
4124
|
the status of the store operation (See resource.store_manifest)
|
|
4054
4125
|
|
|
4126
|
+
* @param options optional table with extra parameters. Supported entries:
|
|
4127
|
+
|
|
4128
|
+
`verify`: if archive should be verified as well as stored (defaults to true)
|
|
4129
|
+
|
|
4055
4130
|
*/
|
|
4056
|
-
export function store_archive(path: string, callback: any): void
|
|
4131
|
+
export function store_archive(path: string, callback: any, options?: any): void
|
|
4057
4132
|
|
|
4058
4133
|
/**
|
|
4059
4134
|
* Create a new manifest from a buffer. The created manifest is verified
|
|
@@ -4751,6 +4826,7 @@ The response data. Contains the fields:
|
|
|
4751
4826
|
`timeout`: timeout in seconds
|
|
4752
4827
|
`path`: path on disc where to download the file. Only overwrites the path if status is 200
|
|
4753
4828
|
`ignore_cache`: don't return cached data if we get a 304
|
|
4829
|
+
`chunked_transfer`: use chunked transfer encoding for https requests larger than 16kb. Defaults to true.
|
|
4754
4830
|
|
|
4755
4831
|
*/
|
|
4756
4832
|
export function request(url: string, method: string, callback: any, headers?: any, post_data?: string, options?: any): void
|
|
@@ -5546,20 +5622,6 @@ declare namespace collectionproxy {
|
|
|
5546
5622
|
*/
|
|
5547
5623
|
export type async_load = "async_load"
|
|
5548
5624
|
|
|
5549
|
-
/**
|
|
5550
|
-
* return an indexed table of missing resources for a collection proxy. Each
|
|
5551
|
-
* entry is a hexadecimal string that represents the data of the specific
|
|
5552
|
-
* resource. This representation corresponds with the filename for each
|
|
5553
|
-
* individual resource that is exported when you bundle an application with
|
|
5554
|
-
* LiveUpdate functionality. It should be considered good practise to always
|
|
5555
|
-
* check whether or not there are any missing resources in a collection proxy
|
|
5556
|
-
* before attempting to load the collection proxy.
|
|
5557
|
-
* @param collectionproxy the collectionproxy to check for missing
|
|
5558
|
-
resources.
|
|
5559
|
-
* @return resources the missing resources
|
|
5560
|
-
*/
|
|
5561
|
-
export function missing_resources(collectionproxy: url): any
|
|
5562
|
-
|
|
5563
5625
|
/**
|
|
5564
5626
|
* Post this message to a collection-proxy-component to disable the referenced collection, which in turn disables the contained game objects and components.
|
|
5565
5627
|
*/
|
|
@@ -5953,8 +6015,12 @@ the new state of the emitter:
|
|
|
5953
6015
|
* Stopping a particle FX does not remove already spawned particles.
|
|
5954
6016
|
* Which particle FX to stop is identified by the URL.
|
|
5955
6017
|
* @param url the particle fx that should stop playing
|
|
6018
|
+
* @param options Options when stopping the particle fx. Supported options:
|
|
6019
|
+
|
|
6020
|
+
`clear`: instantly clear spawned particles
|
|
6021
|
+
|
|
5956
6022
|
*/
|
|
5957
|
-
export function stop(url: string | hash | url): void
|
|
6023
|
+
export function stop(url: string | hash | url, options: any): void
|
|
5958
6024
|
|
|
5959
6025
|
}
|
|
5960
6026
|
// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
|
|
@@ -6186,34 +6252,6 @@ The invoker of the callback: the sound component.
|
|
|
6186
6252
|
// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
|
|
6187
6253
|
|
|
6188
6254
|
|
|
6189
|
-
declare namespace spine {
|
|
6190
|
-
|
|
6191
|
-
/**
|
|
6192
|
-
* This message is sent when a Spine animation has finished playing back to the script
|
|
6193
|
-
* that started the animation.
|
|
6194
|
-
* ⚠ No message is sent if a completion callback function was supplied
|
|
6195
|
-
* when the animation was started. No message is sent if the animation is cancelled with
|
|
6196
|
-
* model.cancel(). This message is sent only for animations that play with
|
|
6197
|
-
* the following playback modes:
|
|
6198
|
-
*
|
|
6199
|
-
* - `go.PLAYBACK_ONCE_FORWARD`
|
|
6200
|
-
* - `go.PLAYBACK_ONCE_BACKWARD`
|
|
6201
|
-
* - `go.PLAYBACK_ONCE_PINGPONG`
|
|
6202
|
-
*
|
|
6203
|
-
*/
|
|
6204
|
-
export type spine_animation_done = "spine_animation_done"
|
|
6205
|
-
|
|
6206
|
-
/**
|
|
6207
|
-
* This message is sent when Spine animation playback fires events. These events
|
|
6208
|
-
* has to be defined on the animation track in the Spine animation editor. An event
|
|
6209
|
-
* can contain custom values expressed in the fields `integer`, `float` and `string`.
|
|
6210
|
-
*/
|
|
6211
|
-
export type spine_event = "spine_event"
|
|
6212
|
-
|
|
6213
|
-
}
|
|
6214
|
-
// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
6255
|
declare namespace sprite {
|
|
6218
6256
|
|
|
6219
6257
|
/**
|