@ts-defold/types 1.2.9 → 1.2.12
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 +96 -145
- 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.
|
|
5
|
+
// DEFOLD. stable version 1.3.1 (06bc078e490fd7d94ec01e38abac989f6cc351a5)
|
|
6
6
|
// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
|
|
7
7
|
|
|
8
8
|
|
|
@@ -406,6 +406,7 @@ declare namespace go {
|
|
|
406
406
|
* - Sprite
|
|
407
407
|
* - Tile Grid
|
|
408
408
|
* - Model
|
|
409
|
+
* - Mesh
|
|
409
410
|
*
|
|
410
411
|
*/
|
|
411
412
|
export type disable = "disable"
|
|
@@ -423,6 +424,7 @@ declare namespace go {
|
|
|
423
424
|
* - Sprite
|
|
424
425
|
* - Tile Grid
|
|
425
426
|
* - Model
|
|
427
|
+
* - Mesh
|
|
426
428
|
*
|
|
427
429
|
*/
|
|
428
430
|
export type enable = "enable"
|
|
@@ -1485,12 +1487,6 @@ with a custom curve. See the animation guide for more information.
|
|
|
1485
1487
|
*/
|
|
1486
1488
|
export function cancel_flipbook(node: node): void
|
|
1487
1489
|
|
|
1488
|
-
/**
|
|
1489
|
-
* cancel a spine animation
|
|
1490
|
-
* @param node spine node that should cancel its animation
|
|
1491
|
-
*/
|
|
1492
|
-
export function cancel_spine(node: node): void
|
|
1493
|
-
|
|
1494
1490
|
/**
|
|
1495
1491
|
* Make a clone instance of a node.
|
|
1496
1492
|
* This function does not clone the supplied node's children nodes.
|
|
@@ -1838,7 +1834,7 @@ with a custom curve. See the animation guide for more information.
|
|
|
1838
1834
|
* The size mode defines how the node will adjust itself in size. Automatic
|
|
1839
1835
|
* size mode alters the node size based on the node's content. Automatic size
|
|
1840
1836
|
* mode works for Box nodes and Pie nodes which will both adjust their size
|
|
1841
|
-
* to match the assigned image.
|
|
1837
|
+
* to match the assigned image. Particle fx and Text nodes will ignore
|
|
1842
1838
|
* any size mode setting.
|
|
1843
1839
|
* @param node node from which to get the size mode (node)
|
|
1844
1840
|
* @return size_mode the current size mode
|
|
@@ -1856,52 +1852,6 @@ with a custom curve. See the animation guide for more information.
|
|
|
1856
1852
|
*/
|
|
1857
1853
|
export function get_slice9(node: node): vmath.vector4
|
|
1858
1854
|
|
|
1859
|
-
/**
|
|
1860
|
-
* Gets the playing animation on a spine node
|
|
1861
|
-
* @param node node to get spine skin from
|
|
1862
|
-
* @return id spine animation id, 0 if no animation is playing
|
|
1863
|
-
*/
|
|
1864
|
-
export function get_spine_animation(node: node): hash
|
|
1865
|
-
|
|
1866
|
-
/**
|
|
1867
|
-
* The returned node can be used for parenting and transform queries.
|
|
1868
|
-
* This function has complexity O(n), where n is the number of bones in the spine model skeleton.
|
|
1869
|
-
* @param node spine node to query for bone node
|
|
1870
|
-
* @param bone_id id of the corresponding bone
|
|
1871
|
-
* @return bone node corresponding to the spine bone
|
|
1872
|
-
*/
|
|
1873
|
-
export function get_spine_bone(node: node, bone_id: string | hash): node
|
|
1874
|
-
|
|
1875
|
-
/**
|
|
1876
|
-
* This is only useful for spine nodes. Gets the normalized cursor of the animation on a spine node.
|
|
1877
|
-
* @param node spine node to get the cursor for (node)
|
|
1878
|
-
* @return cursor cursor value
|
|
1879
|
-
*/
|
|
1880
|
-
export function get_spine_cursor(node: node): any
|
|
1881
|
-
|
|
1882
|
-
/**
|
|
1883
|
-
* This is only useful for spine nodes. Gets the playback rate of the animation on a spine node.
|
|
1884
|
-
* @param node spine node to set the cursor for
|
|
1885
|
-
* @return rate playback rate
|
|
1886
|
-
*/
|
|
1887
|
-
export function get_spine_playback_rate(node: node): number
|
|
1888
|
-
|
|
1889
|
-
/**
|
|
1890
|
-
* Returns the spine scene id of the supplied node.
|
|
1891
|
-
* This is currently only useful for spine nodes.
|
|
1892
|
-
* The returned spine scene must be mapped to the gui scene in the gui editor.
|
|
1893
|
-
* @param node node to get texture from
|
|
1894
|
-
* @return spine_scene spine scene id
|
|
1895
|
-
*/
|
|
1896
|
-
export function get_spine_scene(node: node): hash
|
|
1897
|
-
|
|
1898
|
-
/**
|
|
1899
|
-
* Gets the spine skin of a spine node
|
|
1900
|
-
* @param node node to get spine skin from
|
|
1901
|
-
* @return id spine skin id, 0 if no explicit skin is set
|
|
1902
|
-
*/
|
|
1903
|
-
export function get_spine_skin(node: node): hash
|
|
1904
|
-
|
|
1905
1855
|
/**
|
|
1906
1856
|
* Returns the text value of a text node. This is only useful for text nodes.
|
|
1907
1857
|
* @param node node from which to get the text
|
|
@@ -2011,14 +1961,6 @@ with a custom curve. See the animation guide for more information.
|
|
|
2011
1961
|
*/
|
|
2012
1962
|
export function new_pie_node(pos: vmath.vector3 | vmath.vector4, size: vmath.vector3): node
|
|
2013
1963
|
|
|
2014
|
-
/**
|
|
2015
|
-
* Dynamically create a new spine node.
|
|
2016
|
-
* @param pos node position
|
|
2017
|
-
* @param spine_scene spine scene id
|
|
2018
|
-
* @return node new spine node
|
|
2019
|
-
*/
|
|
2020
|
-
export function new_spine_node(pos: vmath.vector3 | vmath.vector4, spine_scene: string | hash): node
|
|
2021
|
-
|
|
2022
1964
|
/**
|
|
2023
1965
|
* Dynamically create a new text node.
|
|
2024
1966
|
* @param pos node position
|
|
@@ -2105,32 +2047,6 @@ the new state of the emitter:
|
|
|
2105
2047
|
*/
|
|
2106
2048
|
export function play_particlefx(node: node, emitter_state_function?: any): void
|
|
2107
2049
|
|
|
2108
|
-
/**
|
|
2109
|
-
* Starts a spine animation.
|
|
2110
|
-
* @param node spine node that should play the animation
|
|
2111
|
-
* @param animation_id id of the animation to play
|
|
2112
|
-
* @param playback playback mode
|
|
2113
|
-
|
|
2114
|
-
- `gui.PLAYBACK_ONCE_FORWARD`
|
|
2115
|
-
- `gui.PLAYBACK_ONCE_BACKWARD`
|
|
2116
|
-
- `gui.PLAYBACK_ONCE_PINGPONG`
|
|
2117
|
-
- `gui.PLAYBACK_LOOP_FORWARD`
|
|
2118
|
-
- `gui.PLAYBACK_LOOP_BACKWARD`
|
|
2119
|
-
- `gui.PLAYBACK_LOOP_PINGPONG`
|
|
2120
|
-
|
|
2121
|
-
* @param play_properties optional table with properties
|
|
2122
|
-
|
|
2123
|
-
`blend_duration`
|
|
2124
|
-
The duration of a linear blend between the current and new animation
|
|
2125
|
-
`offset`
|
|
2126
|
-
The normalized initial value of the animation cursor when the animation starts playing
|
|
2127
|
-
`playback_rate`
|
|
2128
|
-
The rate with which the animation will be played. Must be positive
|
|
2129
|
-
|
|
2130
|
-
* @param complete_function function to call when the animation has completed
|
|
2131
|
-
*/
|
|
2132
|
-
export function play_spine_anim(node: node, animation_id: string | hash, playback: any, play_properties?: any, complete_function?: any): void
|
|
2133
|
-
|
|
2134
2050
|
/**
|
|
2135
2051
|
* Resets the input context of keyboard. This will clear marked text.
|
|
2136
2052
|
*/
|
|
@@ -2143,6 +2059,14 @@ The rate with which the animation will be played. Must be positive
|
|
|
2143
2059
|
*/
|
|
2144
2060
|
export function reset_nodes(): void
|
|
2145
2061
|
|
|
2062
|
+
/**
|
|
2063
|
+
* Convert the screen position to the local position of supplied node
|
|
2064
|
+
* @param node node used for getting local transformation matrix
|
|
2065
|
+
* @param screen_position screen position
|
|
2066
|
+
* @return local_position local position
|
|
2067
|
+
*/
|
|
2068
|
+
export function screen_to_local(node: node, screen_position: vmath.vector3): vmath.vector3
|
|
2069
|
+
|
|
2146
2070
|
/**
|
|
2147
2071
|
* Sets the adjust mode on a node.
|
|
2148
2072
|
* The adjust mode defines how the node will adjust itself to screen
|
|
@@ -2415,6 +2339,13 @@ The rate with which the animation will be played. Must be positive
|
|
|
2415
2339
|
*/
|
|
2416
2340
|
export function set_scale(node: node, scale: vmath.vector3 | vmath.vector4): void
|
|
2417
2341
|
|
|
2342
|
+
/**
|
|
2343
|
+
* Set the screen position to the supplied node
|
|
2344
|
+
* @param node node to set the screen position to
|
|
2345
|
+
* @param screen_position screen position
|
|
2346
|
+
*/
|
|
2347
|
+
export function set_screen_position(node: node, screen_position: vmath.vector3): void
|
|
2348
|
+
|
|
2418
2349
|
/**
|
|
2419
2350
|
* Sets the shadow color of the supplied node.
|
|
2420
2351
|
* See gui.set_color for info how vectors encode color values.
|
|
@@ -2436,7 +2367,7 @@ The rate with which the animation will be played. Must be positive
|
|
|
2436
2367
|
* The size mode defines how the node will adjust itself in size. Automatic
|
|
2437
2368
|
* size mode alters the node size based on the node's content. Automatic size
|
|
2438
2369
|
* mode works for Box nodes and Pie nodes which will both adjust their size
|
|
2439
|
-
* to match the assigned image.
|
|
2370
|
+
* to match the assigned image. Particle fx and Text nodes will ignore
|
|
2440
2371
|
* any size mode setting.
|
|
2441
2372
|
* @param node node to set size mode for
|
|
2442
2373
|
* @param size_mode size mode to set
|
|
@@ -2454,35 +2385,6 @@ The rate with which the animation will be played. Must be positive
|
|
|
2454
2385
|
*/
|
|
2455
2386
|
export function set_slice9(node: node, values: vmath.vector4): void
|
|
2456
2387
|
|
|
2457
|
-
/**
|
|
2458
|
-
* This is only useful for spine nodes. The cursor is normalized.
|
|
2459
|
-
* @param node spine node to set the cursor for
|
|
2460
|
-
* @param cursor cursor value
|
|
2461
|
-
*/
|
|
2462
|
-
export function set_spine_cursor(node: node, cursor: number): void
|
|
2463
|
-
|
|
2464
|
-
/**
|
|
2465
|
-
* This is only useful for spine nodes. Sets the playback rate of the animation on a spine node. Must be positive.
|
|
2466
|
-
* @param node spine node to set the cursor for
|
|
2467
|
-
* @param playback_rate playback rate
|
|
2468
|
-
*/
|
|
2469
|
-
export function set_spine_playback_rate(node: node, playback_rate: number): void
|
|
2470
|
-
|
|
2471
|
-
/**
|
|
2472
|
-
* Set the spine scene on a spine node. The spine scene must be mapped to the gui scene in the gui editor.
|
|
2473
|
-
* @param node node to set spine scene for
|
|
2474
|
-
* @param spine_scene spine scene id
|
|
2475
|
-
*/
|
|
2476
|
-
export function set_spine_scene(node: node, spine_scene: string | hash): void
|
|
2477
|
-
|
|
2478
|
-
/**
|
|
2479
|
-
* Sets the spine skin on a spine node.
|
|
2480
|
-
* @param node node to set the spine skin on
|
|
2481
|
-
* @param spine_skin spine skin id
|
|
2482
|
-
* @param spine_slot optional slot id to only change a specific slot
|
|
2483
|
-
*/
|
|
2484
|
-
export function set_spine_skin(node: node, spine_skin: string | hash, spine_slot?: string | hash): void
|
|
2485
|
-
|
|
2486
2388
|
/**
|
|
2487
2389
|
* Set the text value of a text node. This is only useful for text nodes.
|
|
2488
2390
|
* @param node node to set text for
|
|
@@ -2720,9 +2622,9 @@ See each joint type for possible properties field. The one field that is accepte
|
|
|
2720
2622
|
* Returns the group name of a collision object as a hash.
|
|
2721
2623
|
* @param url the collision object to return the group of.
|
|
2722
2624
|
* @return hash value of the group.
|
|
2723
|
-
function
|
|
2724
|
-
local
|
|
2725
|
-
|
|
2625
|
+
local function check_is_enemy()
|
|
2626
|
+
local group = physics.get_group("#collisionobject")
|
|
2627
|
+
return group == hash("enemy")
|
|
2726
2628
|
end
|
|
2727
2629
|
|
|
2728
2630
|
*/
|
|
@@ -2767,10 +2669,10 @@ end
|
|
|
2767
2669
|
* @param url the collision object to check the mask of.
|
|
2768
2670
|
* @param group the name of the group to check for.
|
|
2769
2671
|
* @return boolean value of the maskbit. 'true' if present, 'false' otherwise.
|
|
2770
|
-
function
|
|
2771
|
-
--
|
|
2772
|
-
local
|
|
2773
|
-
return
|
|
2672
|
+
local function is_invincible()
|
|
2673
|
+
-- check if the collisionobject would collide with the "bullet" group
|
|
2674
|
+
local invincible = physics.get_maskbit("#collisionobject", "bullet")
|
|
2675
|
+
return invincible
|
|
2774
2676
|
end
|
|
2775
2677
|
|
|
2776
2678
|
*/
|
|
@@ -2826,7 +2728,7 @@ Set to `true` to return all ray cast hits. If `false`, it will only return the c
|
|
|
2826
2728
|
* a collision object in the editor.
|
|
2827
2729
|
* @param url the collision object affected.
|
|
2828
2730
|
* @param group the new group name to be assigned.
|
|
2829
|
-
function
|
|
2731
|
+
local function change_collision_group()
|
|
2830
2732
|
physics.set_group("#collisionobject", "enemy")
|
|
2831
2733
|
end
|
|
2832
2734
|
|
|
@@ -2855,14 +2757,14 @@ Note: The `collide_connected` field cannot be updated/changed after a connection
|
|
|
2855
2757
|
* Sets or clears the masking of a group (maskbit) in a collision object.
|
|
2856
2758
|
* @param url the collision object to change the mask of.
|
|
2857
2759
|
* @param group the name of the group (maskbit) to modify in the mask.
|
|
2858
|
-
* @param
|
|
2859
|
-
function
|
|
2860
|
-
-- no longer collide with the "
|
|
2861
|
-
physics.set_maskbit("#collisionobject"
|
|
2760
|
+
* @param maskbit boolean value of the new maskbit. 'true' to enable, 'false' to disable.
|
|
2761
|
+
local function make_invincible()
|
|
2762
|
+
-- no longer collide with the "bullet" group
|
|
2763
|
+
physics.set_maskbit("#collisionobject", "bullet", false)
|
|
2862
2764
|
end
|
|
2863
2765
|
|
|
2864
2766
|
*/
|
|
2865
|
-
export function set_maskbit(url: string | hash | url, group: string,
|
|
2767
|
+
export function set_maskbit(url: string | hash | url, group: string, maskbit: boolean): void
|
|
2866
2768
|
|
|
2867
2769
|
/**
|
|
2868
2770
|
* Flips the collision shapes vertically for a collision object
|
|
@@ -3237,35 +3139,55 @@ declare namespace render {
|
|
|
3237
3139
|
*/
|
|
3238
3140
|
export let FORMAT_LUMINANCE: any
|
|
3239
3141
|
|
|
3142
|
+
/**
|
|
3143
|
+
* May be nil if the format isn't supported
|
|
3144
|
+
*/
|
|
3145
|
+
export let FORMAT_R16F: any
|
|
3146
|
+
|
|
3147
|
+
/**
|
|
3148
|
+
* May be nil if the format isn't supported
|
|
3149
|
+
*/
|
|
3150
|
+
export let FORMAT_R32F: any
|
|
3151
|
+
|
|
3152
|
+
/**
|
|
3153
|
+
* May be nil if the format isn't supported
|
|
3154
|
+
*/
|
|
3155
|
+
export let FORMAT_RG16F: any
|
|
3156
|
+
|
|
3157
|
+
/**
|
|
3158
|
+
* May be nil if the format isn't supported
|
|
3159
|
+
*/
|
|
3160
|
+
export let FORMAT_RG32F: any
|
|
3161
|
+
|
|
3240
3162
|
/**
|
|
3241
3163
|
*
|
|
3242
3164
|
*/
|
|
3243
3165
|
export let FORMAT_RGB: any
|
|
3244
3166
|
|
|
3245
3167
|
/**
|
|
3246
|
-
*
|
|
3168
|
+
* May be nil if the format isn't supported
|
|
3247
3169
|
*/
|
|
3248
|
-
export let
|
|
3170
|
+
export let FORMAT_RGB16F: any
|
|
3249
3171
|
|
|
3250
3172
|
/**
|
|
3251
|
-
*
|
|
3173
|
+
* May be nil if the format isn't supported
|
|
3252
3174
|
*/
|
|
3253
|
-
export let
|
|
3175
|
+
export let FORMAT_RGB32F: any
|
|
3254
3176
|
|
|
3255
3177
|
/**
|
|
3256
3178
|
*
|
|
3257
3179
|
*/
|
|
3258
|
-
export let
|
|
3180
|
+
export let FORMAT_RGBA: any
|
|
3259
3181
|
|
|
3260
3182
|
/**
|
|
3261
|
-
*
|
|
3183
|
+
* May be nil if the format isn't supported
|
|
3262
3184
|
*/
|
|
3263
|
-
export let
|
|
3185
|
+
export let FORMAT_RGBA16F: any
|
|
3264
3186
|
|
|
3265
3187
|
/**
|
|
3266
|
-
*
|
|
3188
|
+
* May be nil if the format isn't supported
|
|
3267
3189
|
*/
|
|
3268
|
-
export let
|
|
3190
|
+
export let FORMAT_RGBA32F: any
|
|
3269
3191
|
|
|
3270
3192
|
/**
|
|
3271
3193
|
*
|
|
@@ -3418,14 +3340,25 @@ declare namespace render {
|
|
|
3418
3340
|
* system constants buffer is used containing constants as defined in materials and set through
|
|
3419
3341
|
* go.set (or particlefx.set_constant) on visual components.
|
|
3420
3342
|
* @param predicate predicate to draw for
|
|
3421
|
-
* @param
|
|
3343
|
+
* @param options optional table with properties:
|
|
3344
|
+
|
|
3345
|
+
`frustum`
|
|
3346
|
+
A frustum matrix used to cull renderable items. (E.g. `local frustum = proj * view`). May be nil.
|
|
3347
|
+
`constants`
|
|
3348
|
+
optional constants to use while rendering
|
|
3349
|
+
|
|
3422
3350
|
*/
|
|
3423
|
-
export function draw(predicate: any,
|
|
3351
|
+
export function draw(predicate: any, options?: any): void
|
|
3424
3352
|
|
|
3425
3353
|
/**
|
|
3426
3354
|
* Draws all 3d debug graphics such as lines drawn with "draw_line" messages and physics visualization.
|
|
3355
|
+
* @param options optional table with properties:
|
|
3356
|
+
|
|
3357
|
+
`frustum`
|
|
3358
|
+
A frustum matrix used to cull renderable items. (E.g. `local frustum = proj * view`). May be nil.
|
|
3359
|
+
|
|
3427
3360
|
*/
|
|
3428
|
-
export function draw_debug3d(): void
|
|
3361
|
+
export function draw_debug3d(options?: any): void
|
|
3429
3362
|
|
|
3430
3363
|
/**
|
|
3431
3364
|
* If another material was already enabled, it will be automatically disabled
|
|
@@ -3550,7 +3483,7 @@ declare namespace render {
|
|
|
3550
3483
|
*
|
|
3551
3484
|
*
|
|
3552
3485
|
* `format`
|
|
3553
|
-
* `render.FORMAT_LUMINANCE``render.FORMAT_RGB``render.FORMAT_RGBA
|
|
3486
|
+
* `render.FORMAT_LUMINANCE``render.FORMAT_RGB``render.FORMAT_RGBA``render.FORMAT_DEPTH``render.FORMAT_STENCIL``render.FORMAT_RGBA32F``render.FORMAT_RGBA16F`
|
|
3554
3487
|
*
|
|
3555
3488
|
*
|
|
3556
3489
|
* `width`
|
|
@@ -4391,7 +4324,7 @@ Only available on iOS and Android.
|
|
|
4391
4324
|
`manufacturer`
|
|
4392
4325
|
Only available on iOS and Android.
|
|
4393
4326
|
`system_name`
|
|
4394
|
-
The system
|
|
4327
|
+
The system name: "Darwin", "Linux", "Windows", "HTML5", "Android" or "iPhone OS"
|
|
4395
4328
|
`system_version`
|
|
4396
4329
|
The system OS version.
|
|
4397
4330
|
`api_version`
|
|
@@ -5486,6 +5419,24 @@ declare namespace camera {
|
|
|
5486
5419
|
*/
|
|
5487
5420
|
export type acquire_camera_focus = "acquire_camera_focus"
|
|
5488
5421
|
|
|
5422
|
+
/**
|
|
5423
|
+
* Camera frustum far plane.
|
|
5424
|
+
* The type of the property is float.
|
|
5425
|
+
*/
|
|
5426
|
+
export let far_z: any
|
|
5427
|
+
|
|
5428
|
+
/**
|
|
5429
|
+
* Vertical field of view of the camera.
|
|
5430
|
+
* The type of the property is float.
|
|
5431
|
+
*/
|
|
5432
|
+
export let fov: any
|
|
5433
|
+
|
|
5434
|
+
/**
|
|
5435
|
+
* Camera frustum near plane.
|
|
5436
|
+
* The type of the property is float.
|
|
5437
|
+
*/
|
|
5438
|
+
export let near_z: any
|
|
5439
|
+
|
|
5489
5440
|
/**
|
|
5490
5441
|
*
|
|
5491
5442
|
* Post this message to a camera-component to deactivate it. The camera is then removed from the active cameras.
|