@ts-defold/types 1.2.8 → 1.2.9

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 +98 -5
  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.2.191 (d393bae6a361f86cf2263ab312c9b3cea45253ab)
6
6
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
7
7
 
8
8
 
@@ -2716,6 +2716,18 @@ See each joint type for possible properties field. The one field that is accepte
2716
2716
  */
2717
2717
  export function get_gravity(): vmath.vector3
2718
2718
 
2719
+ /**
2720
+ * Returns the group name of a collision object as a hash.
2721
+ * @param url the collision object to return the group of.
2722
+ * @return hash value of the group.
2723
+ function checkIsEnemy()
2724
+ local grp = physics.get_group(&quot;#collisionobject&quot;)
2725
+ assert( grp == hash(&quot;enemy&quot;) )
2726
+ end
2727
+
2728
+ */
2729
+ export function get_group(url: string | hash | url): hash
2730
+
2719
2731
  /**
2720
2732
  * Get a table for properties for a connected joint. The joint has to be created before
2721
2733
  * properties can be retrieved.
@@ -2749,6 +2761,21 @@ See each joint type for possible properties field. The one field that is accepte
2749
2761
  */
2750
2762
  export function get_joint_reaction_torque(collisionobject: string | hash | url, joint_id: string | hash): any
2751
2763
 
2764
+ /**
2765
+ * Returns true if the specified group is set in the mask of a collision
2766
+ * object, false otherwise.
2767
+ * @param url the collision object to check the mask of.
2768
+ * @param group the name of the group to check for.
2769
+ * @return boolean value of the maskbit. 'true' if present, 'false' otherwise.
2770
+ function checkCollideWithUser()
2771
+ -- to check if the collisionobject would collide with &quot;user&quot; group
2772
+ local hits_user = physics.get_maskbit(&quot;#collisionobject&quot;,&quot;user&quot;)
2773
+ return hits_user
2774
+ end
2775
+
2776
+ */
2777
+ export function get_maskbit(url: string | hash | url, group: string): boolean
2778
+
2752
2779
  /**
2753
2780
  * Ray casts are used to test for intersections against collision objects in the physics world.
2754
2781
  * Collision objects of types kinematic, dynamic and static are tested against. Trigger objects
@@ -2793,6 +2820,19 @@ Set to `true` to return all ray cast hits. If `false`, it will only return the c
2793
2820
  */
2794
2821
  export function set_gravity(gravity: vmath.vector3): void
2795
2822
 
2823
+ /**
2824
+ * Updates the group property of a collision object to the specified
2825
+ * string value. The group name should exist i.e. have been used in
2826
+ * a collision object in the editor.
2827
+ * @param url the collision object affected.
2828
+ * @param group the new group name to be assigned.
2829
+ function changeCollisionGroup()
2830
+ physics.set_group(&quot;#collisionobject&quot;, &quot;enemy&quot;)
2831
+ end
2832
+
2833
+ */
2834
+ export function set_group(url: string | hash | url, group: string): void
2835
+
2796
2836
  /**
2797
2837
  * Flips the collision shapes horizontally for a collision object
2798
2838
  * @param url the collision object that should flip its shapes
@@ -2811,6 +2851,19 @@ Note: The `collide_connected` field cannot be updated/changed after a connection
2811
2851
  */
2812
2852
  export function set_joint_properties(collisionobject: string | hash | url, joint_id: string | hash, properties: any): void
2813
2853
 
2854
+ /**
2855
+ * Sets or clears the masking of a group (maskbit) in a collision object.
2856
+ * @param url the collision object to change the mask of.
2857
+ * @param group the name of the group (maskbit) to modify in the mask.
2858
+ * @param type_boolean boolean value of the new maskbit. 'true' to enable, 'false' to disable.
2859
+ function makeUserAlly()
2860
+ -- no longer collide with the &quot;user&quot; group
2861
+ physics.set_maskbit(&quot;#collisionobject&quot;,&quot;user&quot;,false)
2862
+ end
2863
+
2864
+ */
2865
+ export function set_maskbit(url: string | hash | url, group: string, type_boolean?: any): void
2866
+
2814
2867
  /**
2815
2868
  * Flips the collision shapes vertically for a collision object
2816
2869
  * @param url the collision object that should flip its shapes
@@ -3956,6 +4009,7 @@ declare namespace resource {
3956
4009
  /**
3957
4010
  * Gets the text metrics from a font
3958
4011
  * @param url the font to get the (unscaled) metrics from
4012
+ * @param text text to measure
3959
4013
  * @param options A table containing parameters for the text. Supported entries:
3960
4014
 
3961
4015
  `width`
@@ -3975,7 +4029,7 @@ If the calculation should consider line breaks (default false)
3975
4029
  - max_descent
3976
4030
 
3977
4031
  */
3978
- export function get_text_metrics(url: hash, options: any): any
4032
+ export function get_text_metrics(url: hash, text: string, options?: any): any
3979
4033
 
3980
4034
  /**
3981
4035
  * Is any liveupdate data mounted and currently in use?
@@ -4919,6 +4973,13 @@ The elapsed time - on first trigger it is time since timer.delay call, otherwise
4919
4973
  */
4920
4974
  export function delay(delay: number, repeat: boolean, callback: any): hash
4921
4975
 
4976
+ /**
4977
+ * Manual triggering a callback for a timer.
4978
+ * @param handle the timer handle returned by timer.delay()
4979
+ * @return true if the timer was active, false if the timer is already cancelled / complete
4980
+ */
4981
+ export function trigger(handle: hash): boolean
4982
+
4922
4983
  }
4923
4984
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
4924
4985
 
@@ -6204,6 +6265,11 @@ declare namespace spine {
6204
6265
 
6205
6266
  declare namespace sprite {
6206
6267
 
6268
+ /**
6269
+ * hash.
6270
+ */
6271
+ export let animation: any
6272
+
6207
6273
  /**
6208
6274
  * This message is sent to the sender of a `play_animation` message when the
6209
6275
  * animation has completed.
@@ -6324,6 +6390,31 @@ declare namespace tilemap {
6324
6390
  */
6325
6391
  export let tile_source: any
6326
6392
 
6393
+ /**
6394
+ * flip tile horizontally
6395
+ */
6396
+ export let H_FLIP: any
6397
+
6398
+ /**
6399
+ * rotate tile 180 degrees clockwise
6400
+ */
6401
+ export let ROTATE_180: any
6402
+
6403
+ /**
6404
+ * rotate tile 270 degrees clockwise
6405
+ */
6406
+ export let ROTATE_270: any
6407
+
6408
+ /**
6409
+ * rotate tile 90 degrees clockwise
6410
+ */
6411
+ export let ROTATE_90: any
6412
+
6413
+ /**
6414
+ * flip tile vertically
6415
+ */
6416
+ export let V_FLIP: any
6417
+
6327
6418
  /**
6328
6419
  * Get the bounds for a tile map. This function returns multiple values:
6329
6420
  * The lower left corner index x and y coordinates (1-indexed),
@@ -6372,15 +6463,17 @@ declare namespace tilemap {
6372
6463
  * The coordinates must be within the bounds of the tile map as it were created.
6373
6464
  * That is, it is not possible to extend the size of a tile map by setting tiles outside the edges.
6374
6465
  * 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.
6466
+ * Transform bitmask is arithmetic sum of one or both FLIP constants (`tilemap.H_FLIP`, `tilemap.V_FLIP`) and/or one of ROTATION constants
6467
+ * (`tilemap.ROTATE_90`, `tilemap.ROTATE_180`, `tilemap.ROTATE_270`).
6468
+ * Flip always applies before rotation (clockwise).
6375
6469
  * @param url the tile map
6376
6470
  * @param layer name of the layer for the tile
6377
6471
  * @param x x-coordinate of the tile
6378
6472
  * @param y y-coordinate of the tile
6379
6473
  * @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
6474
+ * @param transform_bitmask optional flip and/or rotation should be applied to the tile
6382
6475
  */
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
6476
+ export function set_tile(url: string | hash | url, layer: string | hash, x: number, y: number, tile: number, transform_bitmask?: number): void
6384
6477
 
6385
6478
  /**
6386
6479
  * 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.9",
4
4
  "description": "TypeScript definitions for Defold",
5
5
  "repository": "github:ts-defold/types",
6
6
  "keywords": [