@ts-defold/types 1.2.8 → 1.2.11

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.
Files changed (2) hide show
  1. package/index.d.ts +136 -123
  2. 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.2.190 (d31d6397a72178541a5ef6e7ef2bed090d828f58)
5
+ // DEFOLD. stable version 1.3.0 (0e77ba11ac957ee01878bbde2e6ac0c9fae6dc01)
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. Spine, Particle fx and Text nodes will ignore
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. Spine, Particle fx and Text nodes will ignore
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
@@ -2716,6 +2618,18 @@ See each joint type for possible properties field. The one field that is accepte
2716
2618
  */
2717
2619
  export function get_gravity(): vmath.vector3
2718
2620
 
2621
+ /**
2622
+ * Returns the group name of a collision object as a hash.
2623
+ * @param url the collision object to return the group of.
2624
+ * @return hash value of the group.
2625
+ local function check_is_enemy()
2626
+ local group = physics.get_group(&quot;#collisionobject&quot;)
2627
+ return group == hash(&quot;enemy&quot;)
2628
+ end
2629
+
2630
+ */
2631
+ export function get_group(url: string | hash | url): hash
2632
+
2719
2633
  /**
2720
2634
  * Get a table for properties for a connected joint. The joint has to be created before
2721
2635
  * properties can be retrieved.
@@ -2749,6 +2663,21 @@ See each joint type for possible properties field. The one field that is accepte
2749
2663
  */
2750
2664
  export function get_joint_reaction_torque(collisionobject: string | hash | url, joint_id: string | hash): any
2751
2665
 
2666
+ /**
2667
+ * Returns true if the specified group is set in the mask of a collision
2668
+ * object, false otherwise.
2669
+ * @param url the collision object to check the mask of.
2670
+ * @param group the name of the group to check for.
2671
+ * @return boolean value of the maskbit. 'true' if present, 'false' otherwise.
2672
+ local function is_invincible()
2673
+ -- check if the collisionobject would collide with the &quot;bullet&quot; group
2674
+ local invincible = physics.get_maskbit(&quot;#collisionobject&quot;, &quot;bullet&quot;)
2675
+ return invincible
2676
+ end
2677
+
2678
+ */
2679
+ export function get_maskbit(url: string | hash | url, group: string): boolean
2680
+
2752
2681
  /**
2753
2682
  * Ray casts are used to test for intersections against collision objects in the physics world.
2754
2683
  * Collision objects of types kinematic, dynamic and static are tested against. Trigger objects
@@ -2793,6 +2722,19 @@ Set to `true` to return all ray cast hits. If `false`, it will only return the c
2793
2722
  */
2794
2723
  export function set_gravity(gravity: vmath.vector3): void
2795
2724
 
2725
+ /**
2726
+ * Updates the group property of a collision object to the specified
2727
+ * string value. The group name should exist i.e. have been used in
2728
+ * a collision object in the editor.
2729
+ * @param url the collision object affected.
2730
+ * @param group the new group name to be assigned.
2731
+ local function change_collision_group()
2732
+ physics.set_group(&quot;#collisionobject&quot;, &quot;enemy&quot;)
2733
+ end
2734
+
2735
+ */
2736
+ export function set_group(url: string | hash | url, group: string): void
2737
+
2796
2738
  /**
2797
2739
  * Flips the collision shapes horizontally for a collision object
2798
2740
  * @param url the collision object that should flip its shapes
@@ -2811,6 +2753,19 @@ Note: The `collide_connected` field cannot be updated/changed after a connection
2811
2753
  */
2812
2754
  export function set_joint_properties(collisionobject: string | hash | url, joint_id: string | hash, properties: any): void
2813
2755
 
2756
+ /**
2757
+ * Sets or clears the masking of a group (maskbit) in a collision object.
2758
+ * @param url the collision object to change the mask of.
2759
+ * @param group the name of the group (maskbit) to modify in the mask.
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 &quot;bullet&quot; group
2763
+ physics.set_maskbit(&quot;#collisionobject&quot;, &quot;bullet&quot;, false)
2764
+ end
2765
+
2766
+ */
2767
+ export function set_maskbit(url: string | hash | url, group: string, maskbit: boolean): void
2768
+
2814
2769
  /**
2815
2770
  * Flips the collision shapes vertically for a collision object
2816
2771
  * @param url the collision object that should flip its shapes
@@ -3956,6 +3911,7 @@ declare namespace resource {
3956
3911
  /**
3957
3912
  * Gets the text metrics from a font
3958
3913
  * @param url the font to get the (unscaled) metrics from
3914
+ * @param text text to measure
3959
3915
  * @param options A table containing parameters for the text. Supported entries:
3960
3916
 
3961
3917
  `width`
@@ -3975,7 +3931,7 @@ If the calculation should consider line breaks (default false)
3975
3931
  - max_descent
3976
3932
 
3977
3933
  */
3978
- export function get_text_metrics(url: hash, options: any): any
3934
+ export function get_text_metrics(url: hash, text: string, options?: any): any
3979
3935
 
3980
3936
  /**
3981
3937
  * Is any liveupdate data mounted and currently in use?
@@ -4337,7 +4293,7 @@ Only available on iOS and Android.
4337
4293
  `manufacturer`
4338
4294
  Only available on iOS and Android.
4339
4295
  `system_name`
4340
- The system OS name: "Darwin", "Linux", "Windows", "HTML5", "Android" or "iPhone OS"
4296
+ The system name: "Darwin", "Linux", "Windows", "HTML5", "Android" or "iPhone OS"
4341
4297
  `system_version`
4342
4298
  The system OS version.
4343
4299
  `api_version`
@@ -4919,6 +4875,13 @@ The elapsed time - on first trigger it is time since timer.delay call, otherwise
4919
4875
  */
4920
4876
  export function delay(delay: number, repeat: boolean, callback: any): hash
4921
4877
 
4878
+ /**
4879
+ * Manual triggering a callback for a timer.
4880
+ * @param handle the timer handle returned by timer.delay()
4881
+ * @return true if the timer was active, false if the timer is already cancelled / complete
4882
+ */
4883
+ export function trigger(handle: hash): boolean
4884
+
4922
4885
  }
4923
4886
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
4924
4887
 
@@ -5425,6 +5388,24 @@ declare namespace camera {
5425
5388
  */
5426
5389
  export type acquire_camera_focus = "acquire_camera_focus"
5427
5390
 
5391
+ /**
5392
+ * Camera frustum far plane.
5393
+ * The type of the property is float.
5394
+ */
5395
+ export let far_z: any
5396
+
5397
+ /**
5398
+ * Vertical field of view of the camera.
5399
+ * The type of the property is float.
5400
+ */
5401
+ export let fov: any
5402
+
5403
+ /**
5404
+ * Camera frustum near plane.
5405
+ * The type of the property is float.
5406
+ */
5407
+ export let near_z: any
5408
+
5428
5409
  /**
5429
5410
  *
5430
5411
  * Post this message to a camera-component to deactivate it. The camera is then removed from the active cameras.
@@ -6204,6 +6185,11 @@ declare namespace spine {
6204
6185
 
6205
6186
  declare namespace sprite {
6206
6187
 
6188
+ /**
6189
+ * hash.
6190
+ */
6191
+ export let animation: any
6192
+
6207
6193
  /**
6208
6194
  * This message is sent to the sender of a `play_animation` message when the
6209
6195
  * animation has completed.
@@ -6324,6 +6310,31 @@ declare namespace tilemap {
6324
6310
  */
6325
6311
  export let tile_source: any
6326
6312
 
6313
+ /**
6314
+ * flip tile horizontally
6315
+ */
6316
+ export let H_FLIP: any
6317
+
6318
+ /**
6319
+ * rotate tile 180 degrees clockwise
6320
+ */
6321
+ export let ROTATE_180: any
6322
+
6323
+ /**
6324
+ * rotate tile 270 degrees clockwise
6325
+ */
6326
+ export let ROTATE_270: any
6327
+
6328
+ /**
6329
+ * rotate tile 90 degrees clockwise
6330
+ */
6331
+ export let ROTATE_90: any
6332
+
6333
+ /**
6334
+ * flip tile vertically
6335
+ */
6336
+ export let V_FLIP: any
6337
+
6327
6338
  /**
6328
6339
  * Get the bounds for a tile map. This function returns multiple values:
6329
6340
  * The lower left corner index x and y coordinates (1-indexed),
@@ -6372,15 +6383,17 @@ declare namespace tilemap {
6372
6383
  * The coordinates must be within the bounds of the tile map as it were created.
6373
6384
  * That is, it is not possible to extend the size of a tile map by setting tiles outside the edges.
6374
6385
  * To clear a tile, set the tile to number 0. Which tile map and layer to manipulate is identified by the URL and the layer name parameters.
6386
+ * Transform bitmask is arithmetic sum of one or both FLIP constants (`tilemap.H_FLIP`, `tilemap.V_FLIP`) and/or one of ROTATION constants
6387
+ * (`tilemap.ROTATE_90`, `tilemap.ROTATE_180`, `tilemap.ROTATE_270`).
6388
+ * Flip always applies before rotation (clockwise).
6375
6389
  * @param url the tile map
6376
6390
  * @param layer name of the layer for the tile
6377
6391
  * @param x x-coordinate of the tile
6378
6392
  * @param y y-coordinate of the tile
6379
6393
  * @param tile index of new tile to set. 0 resets the cell
6380
- * @param h_flipped optional if the tile should be horizontally flipped
6381
- * @param v_flipped optional i the tile should be vertically flipped
6394
+ * @param transform_bitmask optional flip and/or rotation should be applied to the tile
6382
6395
  */
6383
- export function set_tile(url: string | hash | url, layer: string | hash, x: number, y: number, tile: number, h_flipped?: boolean, v_flipped?: boolean): void
6396
+ export function set_tile(url: string | hash | url, layer: string | hash, x: number, y: number, tile: number, transform_bitmask?: number): void
6384
6397
 
6385
6398
  /**
6386
6399
  * Sets the visibility of the tilemap layer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-defold/types",
3
- "version": "1.2.8",
3
+ "version": "1.2.11",
4
4
  "description": "TypeScript definitions for Defold",
5
5
  "repository": "github:ts-defold/types",
6
6
  "keywords": [