@defold-typescript/types 0.40.0 → 0.42.0

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 (224) hide show
  1. package/api-availability.json +3963 -772
  2. package/api-migrations.json +27 -0
  3. package/api-signatures.json +18069 -10240
  4. package/api-targets.json +448 -11
  5. package/examples/translations.json +560 -89
  6. package/fixtures/messages_doc.json +96 -0
  7. package/generated/b2d.d.ts +680 -4
  8. package/generated/b2d_body.d.ts +29 -103
  9. package/generated/b2d_chain.d.ts +5 -6
  10. package/generated/b2d_fixture.d.ts +34 -38
  11. package/generated/b2d_joint.d.ts +503 -25
  12. package/generated/b2d_shape.d.ts +183 -20
  13. package/generated/b2d_world.d.ts +57 -63
  14. package/generated/buffer.d.ts +16 -15
  15. package/generated/builtin-messages.d.ts +7 -1
  16. package/generated/bullet3d.d.ts +91 -0
  17. package/generated/bullet3d_collision_object.d.ts +433 -0
  18. package/generated/bullet3d_constraint.d.ts +818 -0
  19. package/generated/bullet3d_rigid_body.d.ts +429 -0
  20. package/generated/bullet3d_shape.d.ts +123 -0
  21. package/generated/bullet3d_world.d.ts +492 -0
  22. package/generated/camera.d.ts +29 -32
  23. package/generated/collectionfactory.d.ts +15 -18
  24. package/generated/collectionproxy.d.ts +22 -6
  25. package/generated/compute.d.ts +12 -238
  26. package/generated/crash.d.ts +24 -10
  27. package/generated/editor-vm/http.d.ts +90 -7
  28. package/generated/editor-vm/image.d.ts +7 -7
  29. package/generated/editor-vm/json.d.ts +11 -0
  30. package/generated/editor-vm/localization.d.ts +7 -7
  31. package/generated/editor-vm/tilemap_tiles.d.ts +56 -10
  32. package/generated/editor-vm/zip.d.ts +28 -0
  33. package/generated/editor.d.ts +1496 -430
  34. package/generated/factory.d.ts +21 -25
  35. package/generated/font.d.ts +64 -22
  36. package/generated/go.d.ts +235 -182
  37. package/generated/graphics.d.ts +335 -97
  38. package/generated/gui.d.ts +240 -471
  39. package/generated/html5.d.ts +2 -2
  40. package/generated/http.d.ts +28 -35
  41. package/generated/image.d.ts +105 -72
  42. package/generated/json.d.ts +34 -16
  43. package/generated/kinds/gui-script.d.ts +7 -0
  44. package/generated/kinds/render-script.d.ts +7 -0
  45. package/generated/kinds/script.d.ts +7 -0
  46. package/generated/label.d.ts +77 -7
  47. package/generated/liveupdate.d.ts +13 -10
  48. package/generated/material.d.ts +312 -360
  49. package/generated/model.d.ts +40 -39
  50. package/generated/particlefx.d.ts +19 -28
  51. package/generated/physics.d.ts +365 -133
  52. package/generated/profiler.d.ts +13 -23
  53. package/generated/render.d.ts +237 -297
  54. package/generated/resource.d.ts +664 -583
  55. package/generated/socket.d.ts +120 -133
  56. package/generated/sound.d.ts +62 -31
  57. package/generated/sprite.d.ts +31 -17
  58. package/generated/sys.d.ts +234 -190
  59. package/generated/tilemap.d.ts +21 -16
  60. package/generated/timer.d.ts +34 -21
  61. package/generated/versions/defold-1.12.4/b2d_body.d.ts +0 -7
  62. package/generated/versions/defold-1.12.4/buffer.d.ts +1 -3
  63. package/generated/versions/defold-1.12.4/camera.d.ts +21 -21
  64. package/generated/versions/defold-1.12.4/collectionfactory.d.ts +9 -9
  65. package/generated/versions/defold-1.12.4/collectionproxy.d.ts +2 -2
  66. package/generated/versions/defold-1.12.4/crash.d.ts +2 -2
  67. package/generated/versions/defold-1.12.4/factory.d.ts +15 -16
  68. package/generated/versions/defold-1.12.4/go.d.ts +6 -12
  69. package/generated/versions/defold-1.12.4/gui.d.ts +77 -175
  70. package/generated/versions/defold-1.12.4/html5.d.ts +1 -1
  71. package/generated/versions/defold-1.12.4/http.d.ts +0 -13
  72. package/generated/versions/defold-1.12.4/image.d.ts +16 -33
  73. package/generated/versions/defold-1.12.4/index.d.ts +1 -0
  74. package/generated/versions/defold-1.12.4/json.d.ts +10 -6
  75. package/generated/versions/defold-1.12.4/label.d.ts +2 -3
  76. package/generated/versions/defold-1.12.4/liveupdate.d.ts +5 -3
  77. package/generated/versions/defold-1.12.4/model.d.ts +2 -10
  78. package/generated/versions/defold-1.12.4/particlefx.d.ts +2 -5
  79. package/generated/versions/defold-1.12.4/physics.d.ts +69 -67
  80. package/generated/versions/defold-1.12.4/profiler.d.ts +2 -5
  81. package/generated/versions/defold-1.12.4/render.d.ts +99 -128
  82. package/generated/versions/defold-1.12.4/resource.d.ts +120 -148
  83. package/generated/versions/defold-1.12.4/socket.d.ts +34 -60
  84. package/generated/versions/defold-1.12.4/sound.d.ts +8 -8
  85. package/generated/versions/defold-1.12.4/sprite.d.ts +15 -5
  86. package/generated/versions/defold-1.12.4/sys.d.ts +37 -71
  87. package/generated/versions/defold-1.12.4/tilemap.d.ts +18 -11
  88. package/generated/versions/defold-1.12.4/timer.d.ts +5 -3
  89. package/generated/versions/defold-1.12.4/vmath.d.ts +0 -21
  90. package/generated/versions/defold-1.12.4/window.d.ts +1 -16
  91. package/generated/versions/defold-1.13.0/b2d_body.d.ts +10 -55
  92. package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +25 -25
  93. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +169 -8
  94. package/generated/versions/defold-1.13.0/b2d_world.d.ts +16 -10
  95. package/generated/versions/defold-1.13.0/buffer.d.ts +1 -3
  96. package/generated/versions/defold-1.13.0/camera.d.ts +25 -25
  97. package/generated/versions/defold-1.13.0/collectionfactory.d.ts +9 -9
  98. package/generated/versions/defold-1.13.0/collectionproxy.d.ts +2 -2
  99. package/generated/versions/defold-1.13.0/compute.d.ts +0 -69
  100. package/generated/versions/defold-1.13.0/crash.d.ts +2 -2
  101. package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +3 -3
  102. package/generated/versions/defold-1.13.0/editor.d.ts +34 -24
  103. package/generated/versions/defold-1.13.0/factory.d.ts +15 -16
  104. package/generated/versions/defold-1.13.0/go.d.ts +6 -12
  105. package/generated/versions/defold-1.13.0/graphics.d.ts +73 -37
  106. package/generated/versions/defold-1.13.0/gui.d.ts +77 -175
  107. package/generated/versions/defold-1.13.0/html5.d.ts +1 -1
  108. package/generated/versions/defold-1.13.0/http.d.ts +0 -13
  109. package/generated/versions/defold-1.13.0/image.d.ts +16 -33
  110. package/generated/versions/defold-1.13.0/index.d.ts +1 -0
  111. package/generated/versions/defold-1.13.0/json.d.ts +10 -6
  112. package/generated/versions/defold-1.13.0/label.d.ts +2 -3
  113. package/generated/versions/defold-1.13.0/liveupdate.d.ts +7 -5
  114. package/generated/versions/defold-1.13.0/material.d.ts +68 -106
  115. package/generated/versions/defold-1.13.0/model.d.ts +2 -10
  116. package/generated/versions/defold-1.13.0/particlefx.d.ts +2 -5
  117. package/generated/versions/defold-1.13.0/physics.d.ts +69 -67
  118. package/generated/versions/defold-1.13.0/profiler.d.ts +2 -5
  119. package/generated/versions/defold-1.13.0/render.d.ts +99 -128
  120. package/generated/versions/defold-1.13.0/resource.d.ts +126 -150
  121. package/generated/versions/defold-1.13.0/socket.d.ts +34 -60
  122. package/generated/versions/defold-1.13.0/sound.d.ts +8 -8
  123. package/generated/versions/defold-1.13.0/sprite.d.ts +15 -5
  124. package/generated/versions/defold-1.13.0/sys.d.ts +37 -71
  125. package/generated/versions/defold-1.13.0/tilemap.d.ts +18 -11
  126. package/generated/versions/defold-1.13.0/timer.d.ts +5 -3
  127. package/generated/versions/defold-1.13.0/vmath.d.ts +0 -21
  128. package/generated/versions/defold-1.13.0/window.d.ts +1 -16
  129. package/generated/versions/defold-1.13.1/b2d.d.ts +33 -0
  130. package/generated/versions/defold-1.13.1/b2d_body.d.ts +636 -0
  131. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +106 -0
  132. package/generated/versions/defold-1.13.1/b2d_fixture.d.ts +157 -0
  133. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +823 -0
  134. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +400 -0
  135. package/generated/versions/defold-1.13.1/b2d_world.d.ts +320 -0
  136. package/generated/versions/defold-1.13.1/buffer.d.ts +189 -0
  137. package/generated/versions/defold-1.13.1/camera.d.ts +303 -0
  138. package/generated/versions/defold-1.13.1/collectionfactory.d.ts +151 -0
  139. package/generated/versions/defold-1.13.1/collectionproxy.d.ts +93 -0
  140. package/generated/versions/defold-1.13.1/compute.d.ts +237 -0
  141. package/generated/versions/defold-1.13.1/crash.d.ts +143 -0
  142. package/generated/versions/defold-1.13.1/editor-vm/http.d.ts +56 -0
  143. package/generated/versions/defold-1.13.1/editor-vm/image.d.ts +48 -0
  144. package/generated/versions/defold-1.13.1/editor-vm/json.d.ts +10 -0
  145. package/generated/versions/defold-1.13.1/editor-vm/localization.d.ts +42 -0
  146. package/generated/versions/defold-1.13.1/editor-vm/tilemap_tiles.d.ts +80 -0
  147. package/generated/versions/defold-1.13.1/editor-vm/zip.d.ts +10 -0
  148. package/generated/versions/defold-1.13.1/editor-vm/zlib.d.ts +24 -0
  149. package/generated/versions/defold-1.13.1/editor.d.ts +1121 -0
  150. package/generated/versions/defold-1.13.1/factory.d.ts +124 -0
  151. package/generated/versions/defold-1.13.1/font.d.ts +81 -0
  152. package/generated/versions/defold-1.13.1/go.d.ts +1107 -0
  153. package/generated/versions/defold-1.13.1/graphics.d.ts +411 -0
  154. package/generated/versions/defold-1.13.1/gui.d.ts +2353 -0
  155. package/generated/versions/defold-1.13.1/html5.d.ts +55 -0
  156. package/generated/versions/defold-1.13.1/http.d.ts +77 -0
  157. package/generated/versions/defold-1.13.1/image.d.ts +131 -0
  158. package/generated/versions/defold-1.13.1/index.d.ts +57 -0
  159. package/generated/versions/defold-1.13.1/json.d.ts +80 -0
  160. package/generated/versions/defold-1.13.1/kinds/editor-script.d.ts +14 -0
  161. package/generated/versions/defold-1.13.1/label.d.ts +93 -0
  162. package/generated/versions/defold-1.13.1/liveupdate.d.ts +142 -0
  163. package/generated/versions/defold-1.13.1/material.d.ts +408 -0
  164. package/generated/versions/defold-1.13.1/model.d.ts +272 -0
  165. package/generated/versions/defold-1.13.1/msg.d.ts +10 -0
  166. package/generated/versions/defold-1.13.1/particlefx.d.ts +163 -0
  167. package/generated/versions/defold-1.13.1/physics.d.ts +559 -0
  168. package/generated/versions/defold-1.13.1/profiler.d.ts +235 -0
  169. package/generated/versions/defold-1.13.1/render.d.ts +1190 -0
  170. package/generated/versions/defold-1.13.1/resource.d.ts +1523 -0
  171. package/generated/versions/defold-1.13.1/socket.d.ts +784 -0
  172. package/generated/versions/defold-1.13.1/sound.d.ts +292 -0
  173. package/generated/versions/defold-1.13.1/sprite.d.ts +175 -0
  174. package/generated/versions/defold-1.13.1/sys.d.ts +678 -0
  175. package/generated/versions/defold-1.13.1/tilemap.d.ts +208 -0
  176. package/generated/versions/defold-1.13.1/timer.d.ts +125 -0
  177. package/generated/versions/defold-1.13.1/types.d.ts +61 -0
  178. package/generated/versions/defold-1.13.1/vmath.d.ts +774 -0
  179. package/generated/versions/defold-1.13.1/window.d.ts +183 -0
  180. package/generated/versions/defold-1.13.1/zlib.d.ts +41 -0
  181. package/generated/vmath.d.ts +1 -21
  182. package/generated/window.d.ts +71 -71
  183. package/identity-vocabulary.json +561 -0
  184. package/index.d.ts +7 -0
  185. package/package.json +18 -2
  186. package/scripts/example-store-io.ts +12 -1
  187. package/scripts/extension-goldens.ts +1 -0
  188. package/scripts/fidelity-baseline.json +146 -46
  189. package/scripts/generate-api-availability.ts +90 -12
  190. package/scripts/generate-api-signatures.ts +12 -2
  191. package/scripts/import-defold-release.ts +106 -26
  192. package/scripts/prose-constants.ts +77 -16
  193. package/scripts/regen.ts +391 -77
  194. package/scripts/shared-handle-methods.ts +53 -0
  195. package/scripts/signature-store-fs.ts +1 -0
  196. package/scripts/sync-api-docs.ts +48 -10
  197. package/src/api-availability.ts +0 -0
  198. package/src/api-doc.ts +201 -3
  199. package/src/api-identity.ts +252 -0
  200. package/src/core-types.ts +26 -3
  201. package/src/correction-pins.ts +49 -0
  202. package/src/doc-comment.ts +104 -11
  203. package/src/doc-corrections.ts +108 -0
  204. package/src/editor-vm-globals.d.ts +5 -2
  205. package/src/emit-dts.ts +2064 -281
  206. package/src/emit-messages.ts +52 -0
  207. package/src/example-store.ts +125 -14
  208. package/src/field-correction-coverage.ts +204 -0
  209. package/src/fnv1a.ts +16 -0
  210. package/src/go-overloads.d.ts +25 -6
  211. package/src/index-base-table.ts +145 -0
  212. package/src/index-slot-classifications.ts +588 -0
  213. package/src/index.ts +38 -5
  214. package/src/library-index-slot-classifications.ts +332 -0
  215. package/src/lifecycle.ts +61 -199
  216. package/src/luals-type-expr.ts +354 -0
  217. package/src/msg-overloads.d.ts +0 -1
  218. package/src/param-correction-provenance.ts +8 -11
  219. package/src/render-overloads.d.ts +0 -15
  220. package/src/return-correction-provenance.ts +58 -16
  221. package/src/sys-overloads.d.ts +48 -0
  222. package/src/vmath-overloads.d.ts +27 -1
  223. package/src/window-event-guard.d.ts +6 -9
  224. package/url-parameters.json +1 -2
@@ -0,0 +1,1107 @@
1
+ /** @noSelfInFile */
2
+ import type { Hash, Matrix4, Opaque, Quaternion, Url, Vector, Vector3, Vector4 } from "../../../src/core-types";
3
+
4
+ declare global {
5
+ /**
6
+ * Game object API documentation
7
+ */
8
+ namespace go {
9
+ export type Easing = typeof go.EASING_INBACK | typeof go.EASING_INBOUNCE | typeof go.EASING_INCIRC | typeof go.EASING_INCUBIC | typeof go.EASING_INELASTIC | typeof go.EASING_INEXPO | typeof go.EASING_INOUTBACK | typeof go.EASING_INOUTBOUNCE | typeof go.EASING_INOUTCIRC | typeof go.EASING_INOUTCUBIC | typeof go.EASING_INOUTELASTIC | typeof go.EASING_INOUTEXPO | typeof go.EASING_INOUTQUAD | typeof go.EASING_INOUTQUART | typeof go.EASING_INOUTQUINT | typeof go.EASING_INOUTSINE | typeof go.EASING_INQUAD | typeof go.EASING_INQUART | typeof go.EASING_INQUINT | typeof go.EASING_INSINE | typeof go.EASING_LINEAR | typeof go.EASING_OUTBACK | typeof go.EASING_OUTBOUNCE | typeof go.EASING_OUTCIRC | typeof go.EASING_OUTCUBIC | typeof go.EASING_OUTELASTIC | typeof go.EASING_OUTEXPO | typeof go.EASING_OUTINBACK | typeof go.EASING_OUTINBOUNCE | typeof go.EASING_OUTINCIRC | typeof go.EASING_OUTINCUBIC | typeof go.EASING_OUTINELASTIC | typeof go.EASING_OUTINEXPO | typeof go.EASING_OUTINQUAD | typeof go.EASING_OUTINQUART | typeof go.EASING_OUTINQUINT | typeof go.EASING_OUTINSINE | typeof go.EASING_OUTQUAD | typeof go.EASING_OUTQUART | typeof go.EASING_OUTQUINT | typeof go.EASING_OUTSINE;
10
+ export type Playback = typeof go.PLAYBACK_ONCE_FORWARD | typeof go.PLAYBACK_ONCE_BACKWARD | typeof go.PLAYBACK_ONCE_PINGPONG | typeof go.PLAYBACK_LOOP_FORWARD | typeof go.PLAYBACK_LOOP_BACKWARD | typeof go.PLAYBACK_LOOP_PINGPONG;
11
+ /**
12
+ * in-back
13
+ */
14
+ export const EASING_INBACK: number & { readonly __brand: "go.EASING_INBACK" };
15
+ /**
16
+ * in-bounce
17
+ */
18
+ export const EASING_INBOUNCE: number & { readonly __brand: "go.EASING_INBOUNCE" };
19
+ /**
20
+ * in-circlic
21
+ */
22
+ export const EASING_INCIRC: number & { readonly __brand: "go.EASING_INCIRC" };
23
+ /**
24
+ * in-cubic
25
+ */
26
+ export const EASING_INCUBIC: number & { readonly __brand: "go.EASING_INCUBIC" };
27
+ /**
28
+ * in-elastic
29
+ */
30
+ export const EASING_INELASTIC: number & { readonly __brand: "go.EASING_INELASTIC" };
31
+ /**
32
+ * in-exponential
33
+ */
34
+ export const EASING_INEXPO: number & { readonly __brand: "go.EASING_INEXPO" };
35
+ /**
36
+ * in-out-back
37
+ */
38
+ export const EASING_INOUTBACK: number & { readonly __brand: "go.EASING_INOUTBACK" };
39
+ /**
40
+ * in-out-bounce
41
+ */
42
+ export const EASING_INOUTBOUNCE: number & { readonly __brand: "go.EASING_INOUTBOUNCE" };
43
+ /**
44
+ * in-out-circlic
45
+ */
46
+ export const EASING_INOUTCIRC: number & { readonly __brand: "go.EASING_INOUTCIRC" };
47
+ /**
48
+ * in-out-cubic
49
+ */
50
+ export const EASING_INOUTCUBIC: number & { readonly __brand: "go.EASING_INOUTCUBIC" };
51
+ /**
52
+ * in-out-elastic
53
+ */
54
+ export const EASING_INOUTELASTIC: number & { readonly __brand: "go.EASING_INOUTELASTIC" };
55
+ /**
56
+ * in-out-exponential
57
+ */
58
+ export const EASING_INOUTEXPO: number & { readonly __brand: "go.EASING_INOUTEXPO" };
59
+ /**
60
+ * in-out-quadratic
61
+ */
62
+ export const EASING_INOUTQUAD: number & { readonly __brand: "go.EASING_INOUTQUAD" };
63
+ /**
64
+ * in-out-quartic
65
+ */
66
+ export const EASING_INOUTQUART: number & { readonly __brand: "go.EASING_INOUTQUART" };
67
+ /**
68
+ * in-out-quintic
69
+ */
70
+ export const EASING_INOUTQUINT: number & { readonly __brand: "go.EASING_INOUTQUINT" };
71
+ /**
72
+ * in-out-sine
73
+ */
74
+ export const EASING_INOUTSINE: number & { readonly __brand: "go.EASING_INOUTSINE" };
75
+ /**
76
+ * in-quadratic
77
+ */
78
+ export const EASING_INQUAD: number & { readonly __brand: "go.EASING_INQUAD" };
79
+ /**
80
+ * in-quartic
81
+ */
82
+ export const EASING_INQUART: number & { readonly __brand: "go.EASING_INQUART" };
83
+ /**
84
+ * in-quintic
85
+ */
86
+ export const EASING_INQUINT: number & { readonly __brand: "go.EASING_INQUINT" };
87
+ /**
88
+ * in-sine
89
+ */
90
+ export const EASING_INSINE: number & { readonly __brand: "go.EASING_INSINE" };
91
+ /**
92
+ * linear interpolation
93
+ */
94
+ export const EASING_LINEAR: number & { readonly __brand: "go.EASING_LINEAR" };
95
+ /**
96
+ * out-back
97
+ */
98
+ export const EASING_OUTBACK: number & { readonly __brand: "go.EASING_OUTBACK" };
99
+ /**
100
+ * out-bounce
101
+ */
102
+ export const EASING_OUTBOUNCE: number & { readonly __brand: "go.EASING_OUTBOUNCE" };
103
+ /**
104
+ * out-circlic
105
+ */
106
+ export const EASING_OUTCIRC: number & { readonly __brand: "go.EASING_OUTCIRC" };
107
+ /**
108
+ * out-cubic
109
+ */
110
+ export const EASING_OUTCUBIC: number & { readonly __brand: "go.EASING_OUTCUBIC" };
111
+ /**
112
+ * out-elastic
113
+ */
114
+ export const EASING_OUTELASTIC: number & { readonly __brand: "go.EASING_OUTELASTIC" };
115
+ /**
116
+ * out-exponential
117
+ */
118
+ export const EASING_OUTEXPO: number & { readonly __brand: "go.EASING_OUTEXPO" };
119
+ /**
120
+ * out-in-back
121
+ */
122
+ export const EASING_OUTINBACK: number & { readonly __brand: "go.EASING_OUTINBACK" };
123
+ /**
124
+ * out-in-bounce
125
+ */
126
+ export const EASING_OUTINBOUNCE: number & { readonly __brand: "go.EASING_OUTINBOUNCE" };
127
+ /**
128
+ * out-in-circlic
129
+ */
130
+ export const EASING_OUTINCIRC: number & { readonly __brand: "go.EASING_OUTINCIRC" };
131
+ /**
132
+ * out-in-cubic
133
+ */
134
+ export const EASING_OUTINCUBIC: number & { readonly __brand: "go.EASING_OUTINCUBIC" };
135
+ /**
136
+ * out-in-elastic
137
+ */
138
+ export const EASING_OUTINELASTIC: number & { readonly __brand: "go.EASING_OUTINELASTIC" };
139
+ /**
140
+ * out-in-exponential
141
+ */
142
+ export const EASING_OUTINEXPO: number & { readonly __brand: "go.EASING_OUTINEXPO" };
143
+ /**
144
+ * out-in-quadratic
145
+ */
146
+ export const EASING_OUTINQUAD: number & { readonly __brand: "go.EASING_OUTINQUAD" };
147
+ /**
148
+ * out-in-quartic
149
+ */
150
+ export const EASING_OUTINQUART: number & { readonly __brand: "go.EASING_OUTINQUART" };
151
+ /**
152
+ * out-in-quintic
153
+ */
154
+ export const EASING_OUTINQUINT: number & { readonly __brand: "go.EASING_OUTINQUINT" };
155
+ /**
156
+ * out-in-sine
157
+ */
158
+ export const EASING_OUTINSINE: number & { readonly __brand: "go.EASING_OUTINSINE" };
159
+ /**
160
+ * out-quadratic
161
+ */
162
+ export const EASING_OUTQUAD: number & { readonly __brand: "go.EASING_OUTQUAD" };
163
+ /**
164
+ * out-quartic
165
+ */
166
+ export const EASING_OUTQUART: number & { readonly __brand: "go.EASING_OUTQUART" };
167
+ /**
168
+ * out-quintic
169
+ */
170
+ export const EASING_OUTQUINT: number & { readonly __brand: "go.EASING_OUTQUINT" };
171
+ /**
172
+ * out-sine
173
+ */
174
+ export const EASING_OUTSINE: number & { readonly __brand: "go.EASING_OUTSINE" };
175
+ /**
176
+ * loop backward
177
+ */
178
+ export const PLAYBACK_LOOP_BACKWARD: number & { readonly __brand: "go.PLAYBACK_LOOP_BACKWARD" };
179
+ /**
180
+ * loop forward
181
+ */
182
+ export const PLAYBACK_LOOP_FORWARD: number & { readonly __brand: "go.PLAYBACK_LOOP_FORWARD" };
183
+ /**
184
+ * ping pong loop
185
+ */
186
+ export const PLAYBACK_LOOP_PINGPONG: number & { readonly __brand: "go.PLAYBACK_LOOP_PINGPONG" };
187
+ /**
188
+ * no playback
189
+ */
190
+ export const PLAYBACK_NONE: number & { readonly __brand: "go.PLAYBACK_NONE" };
191
+ /**
192
+ * once backward
193
+ */
194
+ export const PLAYBACK_ONCE_BACKWARD: number & { readonly __brand: "go.PLAYBACK_ONCE_BACKWARD" };
195
+ /**
196
+ * once forward
197
+ */
198
+ export const PLAYBACK_ONCE_FORWARD: number & { readonly __brand: "go.PLAYBACK_ONCE_FORWARD" };
199
+ /**
200
+ * once ping pong
201
+ */
202
+ export const PLAYBACK_ONCE_PINGPONG: number & { readonly __brand: "go.PLAYBACK_ONCE_PINGPONG" };
203
+ /**
204
+ * This is only supported for numerical properties. If the node property is already being
205
+ * animated, that animation will be canceled and replaced by the new one.
206
+ * If a `complete_function` (lua function) is specified, that function will be called when the animation has completed.
207
+ * By starting a new animation in that function, several animations can be sequenced together. See the examples for more information.
208
+ * If you call `go.animate()` from a game object's `final()` function,
209
+ * any passed `complete_function` will be ignored and never called upon animation completion.
210
+ * See the properties guide for which properties can be animated and the animation guide for how
211
+ * them.
212
+ *
213
+ * @param url - url of the game object or component having the property
214
+ * @param property - id of the property to animate
215
+ * @param playback - playback mode of the animation
216
+ *
217
+ * - `go.PLAYBACK_ONCE_FORWARD`
218
+ * - `go.PLAYBACK_ONCE_BACKWARD`
219
+ * - `go.PLAYBACK_ONCE_PINGPONG`
220
+ * - `go.PLAYBACK_LOOP_FORWARD`
221
+ * - `go.PLAYBACK_LOOP_BACKWARD`
222
+ * - `go.PLAYBACK_LOOP_PINGPONG`
223
+ * @param to - target property value
224
+ * @param easing - easing to use during animation. Either specify a constant, see the animation guide for a complete list, or a vmath.vector with a curve
225
+ * @param duration - duration of the animation in seconds
226
+ * @param delay - delay before the animation starts in seconds
227
+ * @param complete_function - optional function to call when the animation has completed
228
+ *
229
+ * `self`
230
+ *
231
+ * object The current object.
232
+ *
233
+ * `url`
234
+ *
235
+ * url The game object or component instance for which the property is animated.
236
+ *
237
+ * `property`
238
+ *
239
+ * hash The id of the animated property.
240
+ * @example
241
+ * Animate the position of a game object to x = 10 during 1 second, then y = 20 during 1 second:
242
+ * ```ts
243
+ * go.animate(go.get_id(), "position.x", go.PLAYBACK_ONCE_FORWARD, 10, go.EASING_LINEAR, 1, 0, () => {
244
+ * go.animate(go.get_id(), "position.y", go.PLAYBACK_ONCE_FORWARD, 20, go.EASING_LINEAR, 1);
245
+ * });
246
+ * ```
247
+ * @example
248
+ * Animate the y position of a game object using a crazy custom easing curve:
249
+ * ```ts
250
+ * const values = [
251
+ * 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
252
+ * 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
253
+ * 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
254
+ * 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
255
+ * ];
256
+ * const vec = vmath.vector(values);
257
+ * go.animate("go", "position.y", go.PLAYBACK_LOOP_PINGPONG, 100, vec, 2.0);
258
+ * ```
259
+ */
260
+ export function animate(url: SceneAddress | Hash | Url, property: string | Hash, playback: go.Playback, to: number | Vector3 | Vector4 | Quaternion, easing: Vector | go.Easing, duration: number, delay?: number, complete_function?: (self: unknown, url: unknown, property: unknown) => void): void;
261
+ /**
262
+ * By calling this function, all or specified stored property animations of the game object or component will be canceled.
263
+ * See the properties guide for which properties can be animated and the animation guide for how to animate them.
264
+ *
265
+ * @param url - url of the game object or component
266
+ * @param property - optional id of the property to cancel
267
+ * @example
268
+ * Cancel the animation of the position of a game object:
269
+ * ```ts
270
+ * go.cancel_animations(go.get_id(), "position");
271
+ * ```
272
+ * @example
273
+ * Cancel all property animations of the current game object:
274
+ * ```ts
275
+ * go.cancel_animations(".");
276
+ * ```
277
+ * @example
278
+ * Cancel all property animations of the sprite component of the current game object:
279
+ * ```ts
280
+ * go.cancel_animations("#sprite");
281
+ * ```
282
+ */
283
+ export function cancel_animations(url?: SceneAddress | Hash | Url, property?: string | Hash): void;
284
+ /**
285
+ * Delete one or more game objects identified by id. Deletion is asynchronous meaning that
286
+ * the game object(s) are scheduled for deletion which will happen at the end of the current
287
+ * frame. Note that game objects scheduled for deletion will be counted against
288
+ * `max_instances` in "game.project" until they are actually removed.
289
+ * Deleting a game object containing a particle FX component emitting particles will not immediately stop the particle FX from emitting particles. You need to manually stop the particle FX using `particlefx.stop()`.
290
+ * Deleting a game object containing a sound component that is playing will not immediately stop the sound from playing. You need to manually stop the sound using `sound.stop()`.
291
+ *
292
+ * @param id - optional id or table of id's of the instance(s) to delete, the instance of the calling script is deleted by default
293
+ * @param recursive - optional boolean, set to true to recursively delete child hiearchy in child to parent order
294
+ * @example
295
+ * This example demonstrates how to delete game objects
296
+ * ```ts
297
+ * // Delete the script's own game object.
298
+ * go.delete();
299
+ * // Delete a game object with the id "my_game_object".
300
+ * const id = go.get_id("my_game_object");
301
+ * go.delete(id);
302
+ * // Delete a list of game objects.
303
+ * const ids = [hash("/my_object_1"), hash("/my_object_2"), hash("/my_object_3")];
304
+ * go.delete(ids);
305
+ * ```
306
+ * @example
307
+ * This example demonstrates how to delete a game objects and their children (child to parent order)
308
+ * ```ts
309
+ * // Delete the script's own game object and its children.
310
+ * go.delete(true);
311
+ * // Delete a game object with the id "my_game_object" and its children.
312
+ * const id = go.get_id("my_game_object");
313
+ * go.delete(id, true);
314
+ * // Delete a list of game objects and their children.
315
+ * const ids = [hash("/my_object_1"), hash("/my_object_2"), hash("/my_object_3")];
316
+ * go.delete(ids, true);
317
+ * ```
318
+ */
319
+ function _delete(id?: SceneGameObjectAddress | Hash | Url | (SceneGameObjectAddress | Hash | Url)[] | boolean, recursive?: boolean): void;
320
+ /**
321
+ * This function can check for game objects in any collection by specifying
322
+ * the collection name in the URL.
323
+ *
324
+ * @param url - url of the game object to check
325
+ * @returns true if the game object exists
326
+ * @example
327
+ * Check if game object "my_game_object" exists in the current collection
328
+ * ```ts
329
+ * go.exists("/my_game_object");
330
+ * ```
331
+ * @example
332
+ * Check if game object exists in another collection
333
+ * ```ts
334
+ * go.exists("other_collection:/my_game_object");
335
+ * ```
336
+ */
337
+ export function exists(url: SceneGameObjectAddress | Hash | Url): boolean;
338
+ /**
339
+ * This is a callback-function, which is called by the engine when a script component is finalized (destroyed). It can
340
+ * be used to e.g. take some last action, report the finalization to other game object instances, delete spawned objects
341
+ * or release user input focus (see release_input_focus).
342
+ *
343
+ * @param self - reference to the script state to be used for storing data
344
+ * @example
345
+ * ```ts
346
+ * export default defineScript({
347
+ * init() {
348
+ * return { some_value: 0 };
349
+ * },
350
+ *
351
+ * final(self) {
352
+ * // report finalization
353
+ * msg.post("my_friend_instance", "im_dead", { my_stats: self.some_value });
354
+ * },
355
+ * });
356
+ * ```
357
+ */
358
+ export function final(self: Opaque<"userdata">): void;
359
+ /**
360
+ * This is a callback-function, which is called by the engine at fixed intervals to update the state of a script
361
+ * component. The function will be called if 'Fixed Update Frequency' is enabled in the Engine section of game.project.
362
+ * It can for instance be used to update game logic with the physics simulation if using a fixed timestep for the
363
+ * physics (enabled by ticking 'Use Fixed Timestep' in the Physics section of game.project).
364
+ *
365
+ * @param self - reference to the script state to be used for storing data
366
+ * @param dt - the time-step of the frame update
367
+ */
368
+ export function fixed_update(self: Opaque<"userdata">, dt: number): void;
369
+ /**
370
+ * Returns or constructs an instance identifier. The instance id is a hash
371
+ * of the absolute path to the instance.
372
+ *
373
+ * - If `path` is specified, it can either be absolute or relative to the instance of the calling script.
374
+ * - If `path` is not specified, the id of the game object instance the script is attached to will be returned.
375
+ *
376
+ * @param path - path of the instance for which to return the id
377
+ * @returns instance id
378
+ * @example
379
+ * ```ts
380
+ * // For the instance with path /my_sub_collection/my_instance, the following calls
381
+ * // are equivalent:
382
+ * const id = go.get_id(); // no path, defaults to the instance containing the calling script
383
+ * print(id); // => hash: [/my_sub_collection/my_instance]
384
+ *
385
+ * const id2 = go.get_id("/my_sub_collection/my_instance"); // absolute path
386
+ * print(id2); // => hash: [/my_sub_collection/my_instance]
387
+ *
388
+ * const id3 = go.get_id("my_instance"); // relative path
389
+ * print(id3); // => hash: [/my_sub_collection/my_instance]
390
+ * ```
391
+ */
392
+ export function get_id(path?: string): Hash;
393
+ /**
394
+ * Get the parent for a game object instance.
395
+ *
396
+ * @param id - optional id of the game object instance to get parent for, defaults to the instance containing the calling script
397
+ * @returns parent instance or `nil`
398
+ * @example
399
+ * Get parent of the instance containing the calling script:
400
+ * ```ts
401
+ * const parent_id = go.get_parent();
402
+ * ```
403
+ * @example
404
+ * Get parent of the instance with id "x":
405
+ * ```ts
406
+ * const parent_id = go.get_parent("x");
407
+ * ```
408
+ */
409
+ export function get_parent(id?: SceneGameObjectAddress | Hash | Url): Hash | undefined;
410
+ /**
411
+ * The position is relative the parent (if any). Use go.get_world_position to retrieve the global world position.
412
+ *
413
+ * @param id - optional id of the game object instance to get the position for, by default the instance of the calling script
414
+ * @returns instance position
415
+ * @example
416
+ * Get the position of the game object instance the script is attached to:
417
+ * ```ts
418
+ * const p = go.get_position();
419
+ * ```
420
+ * @example
421
+ * Get the position of another game object instance "my_gameobject":
422
+ * ```ts
423
+ * const pos = go.get_position("my_gameobject");
424
+ * ```
425
+ */
426
+ export function get_position(id?: SceneGameObjectAddress | Hash | Url): Vector3;
427
+ /**
428
+ * The rotation is relative to the parent (if any). Use go.get_world_rotation to retrieve the global world rotation.
429
+ *
430
+ * @param id - optional id of the game object instance to get the rotation for, by default the instance of the calling script
431
+ * @returns instance rotation
432
+ * @example
433
+ * Get the rotation of the game object instance the script is attached to:
434
+ * ```ts
435
+ * const r = go.get_rotation();
436
+ * ```
437
+ * @example
438
+ * Get the rotation of another game object instance with id "x":
439
+ * ```ts
440
+ * const r = go.get_rotation("x");
441
+ * ```
442
+ */
443
+ export function get_rotation(id?: SceneGameObjectAddress | Hash | Url): Quaternion;
444
+ /**
445
+ * The scale is relative the parent (if any). Use go.get_world_scale to retrieve the global world 3D scale factor.
446
+ *
447
+ * @param id - optional id of the game object instance to get the scale for, by default the instance of the calling script
448
+ * @returns instance scale factor
449
+ * @example
450
+ * Get the scale of the game object instance the script is attached to:
451
+ * ```ts
452
+ * const s = go.get_scale();
453
+ * ```
454
+ * @example
455
+ * Get the scale of another game object instance with id "x":
456
+ * ```ts
457
+ * const s = go.get_scale("x");
458
+ * ```
459
+ */
460
+ export function get_scale(id?: SceneGameObjectAddress | Hash | Url): Vector3;
461
+ /**
462
+ * The uniform scale is relative the parent (if any). If the underlying scale vector is non-uniform the min element of the vector is returned as the uniform scale factor.
463
+ *
464
+ * @param id - optional id of the game object instance to get the uniform scale for, by default the instance of the calling script
465
+ * @returns uniform instance scale factor
466
+ * @example
467
+ * Get the scale of the game object instance the script is attached to:
468
+ * ```ts
469
+ * const s = go.get_scale_uniform();
470
+ * ```
471
+ * @example
472
+ * Get the uniform scale of another game object instance with id "x":
473
+ * ```ts
474
+ * const s = go.get_scale_uniform("x");
475
+ * ```
476
+ */
477
+ export function get_scale_uniform(id?: SceneGameObjectAddress | Hash | Url): number;
478
+ /**
479
+ * The function will return the world position calculated at the end of the previous frame.
480
+ * To recalculate it within the current frame, use go.update_world_transform on the instance before calling this.
481
+ * Use go.get_position to retrieve the position relative to the parent.
482
+ *
483
+ * @param id - optional id of the game object instance to get the world position for, by default the instance of the calling script
484
+ * @returns instance world position
485
+ * @example
486
+ * Get the world position of the game object instance the script is attached to:
487
+ * ```ts
488
+ * const p = go.get_world_position();
489
+ * ```
490
+ * @example
491
+ * Get the world position of another game object instance with id "x":
492
+ * ```ts
493
+ * // Relative addressing by id — no socket prefix:
494
+ * const p = go.get_world_position("x");
495
+ * ```
496
+ */
497
+ export function get_world_position(id?: SceneGameObjectAddress | Hash | Url): Vector3;
498
+ /**
499
+ * The function will return the world rotation calculated at the end of the previous frame.
500
+ * To recalculate it within the current frame, use go.update_world_transform on the instance before calling this.
501
+ * Use go.get_rotation to retrieve the rotation relative to the parent.
502
+ *
503
+ * @param id - optional id of the game object instance to get the world rotation for, by default the instance of the calling script
504
+ * @returns instance world rotation
505
+ * @example
506
+ * Get the world rotation of the game object instance the script is attached to:
507
+ * ```ts
508
+ * const r = go.get_world_rotation();
509
+ * ```
510
+ * @example
511
+ * Get the world rotation of another game object instance with id "x":
512
+ * ```ts
513
+ * const r = go.get_world_rotation("x");
514
+ * ```
515
+ */
516
+ export function get_world_rotation(id?: SceneGameObjectAddress | Hash | Url): Quaternion;
517
+ /**
518
+ * The function will return the world 3D scale factor calculated at the end of the previous frame.
519
+ * To recalculate it within the current frame, use go.update_world_transform on the instance before calling this.
520
+ * Use go.get_scale to retrieve the 3D scale factor relative to the parent.
521
+ * This vector is derived by decomposing the transformation matrix and should be used with care.
522
+ * For most cases it should be fine to use go.get_world_scale_uniform instead.
523
+ *
524
+ * @param id - optional id of the game object instance to get the world scale for, by default the instance of the calling script
525
+ * @returns instance world 3D scale factor
526
+ * @example
527
+ * Get the world 3D scale of the game object instance the script is attached to:
528
+ * ```ts
529
+ * const s = go.get_world_scale();
530
+ * ```
531
+ * @example
532
+ * Get the world scale of another game object instance "x":
533
+ * ```ts
534
+ * const s = go.get_world_scale("x");
535
+ * ```
536
+ */
537
+ export function get_world_scale(id?: SceneGameObjectAddress | Hash | Url): Vector3;
538
+ /**
539
+ * The function will return the world scale factor calculated at the end of the previous frame.
540
+ * To recalculate it within the current frame, use go.update_world_transform on the instance before calling this.
541
+ * Use go.get_scale_uniform to retrieve the scale factor relative to the parent.
542
+ *
543
+ * @param id - optional id of the game object instance to get the world scale for, by default the instance of the calling script
544
+ * @returns instance world scale factor
545
+ * @example
546
+ * Get the world scale of the game object instance the script is attached to:
547
+ * ```ts
548
+ * const s = go.get_world_scale_uniform();
549
+ * ```
550
+ * @example
551
+ * Get the world scale of another game object instance with id "x":
552
+ * ```ts
553
+ * const s = go.get_world_scale_uniform("x");
554
+ * ```
555
+ */
556
+ export function get_world_scale_uniform(id?: SceneGameObjectAddress | Hash | Url): number;
557
+ /**
558
+ * The function will return the world transform matrix calculated at the end of the previous frame.
559
+ * To recalculate it within the current frame, use go.update_world_transform on the instance before calling this.
560
+ *
561
+ * @param id - optional id of the game object instance to get the world transform for, by default the instance of the calling script
562
+ * @returns instance world transform
563
+ * @example
564
+ * Get the world transform of the game object instance the script is attached to:
565
+ * ```ts
566
+ * const m = go.get_world_transform();
567
+ * ```
568
+ * @example
569
+ * Get the world transform of another game object instance with id "x":
570
+ * ```ts
571
+ * const m = go.get_world_transform("x");
572
+ * ```
573
+ */
574
+ export function get_world_transform(id?: SceneGameObjectAddress | Hash | Url): Matrix4;
575
+ /**
576
+ * This is a callback-function, which is called by the engine when a script component is initialized. It can be used
577
+ * to set the initial state of the script.
578
+ *
579
+ * @param self - reference to the script state to be used for storing data
580
+ * @example
581
+ * ```ts
582
+ * export default defineScript({
583
+ * init() {
584
+ * // set up useful data
585
+ * return { my_value: 1 };
586
+ * },
587
+ * });
588
+ * ```
589
+ */
590
+ export function init(self: Opaque<"userdata">): void;
591
+ /**
592
+ * This is a callback-function, which is called by the engine at the end of the frame to update the state of a script
593
+ * component. Use it to make final adjustments to the game object instance.
594
+ *
595
+ * @param self - reference to the script state to be used for storing data
596
+ * @param dt - the time-step of the frame update
597
+ */
598
+ export function late_update(self: Opaque<"userdata">, dt: number): void;
599
+ /**
600
+ * This is a callback-function, which is called by the engine when user input is sent to the game object instance of the script.
601
+ * It can be used to take action on the input, e.g. move the instance according to the input.
602
+ * For an instance to obtain user input, it must first acquire input focus
603
+ * through the message `acquire_input_focus`.
604
+ * Any instance that has obtained input will be put on top of an
605
+ * input stack. Input is sent to all listeners on the stack until the
606
+ * end of stack is reached, or a listener returns `true`
607
+ * to signal that it wants input to be consumed.
608
+ * See the documentation of acquire_input_focus for more
609
+ * information.
610
+ * The `action` parameter is a table containing data about the input mapped to the
611
+ * `action_id`.
612
+ * For mapped actions it specifies the value of the input and if it was just pressed or released.
613
+ * Actions are mapped to input in an input_binding-file.
614
+ * Mouse movement is specifically handled and uses `nil` as its `action_id`.
615
+ * The `action` only contains positional parameters in this case, such as x and y of the pointer.
616
+ * Here is a brief description of the available table fields:
617
+ *
618
+ * Field
619
+ * Description
620
+ *
621
+ * `value`
622
+ * The amount of input given by the user. This is usually 1 for buttons and 0-1 for analogue inputs. This is not present for mouse movement and text input.
623
+ *
624
+ * `pressed`
625
+ * If the input was pressed this frame. This is not present for mouse movement and text input.
626
+ *
627
+ * `released`
628
+ * If the input was released this frame. This is not present for mouse movement and text input.
629
+ *
630
+ * `repeated`
631
+ * If the input was repeated this frame. This is similar to how a key on a keyboard is repeated when you hold it down. This is not present for mouse movement and text input.
632
+ *
633
+ * `x`
634
+ * The x value of a pointer device, if present. This is not present for gamepad, key and text input.
635
+ *
636
+ * `y`
637
+ * The y value of a pointer device, if present. This is not present for gamepad, key and text input.
638
+ *
639
+ * `screen_x`
640
+ * The screen space x value of a pointer device, if present. This is not present for gamepad, key and text input.
641
+ *
642
+ * `screen_y`
643
+ * The screen space y value of a pointer device, if present. This is not present for gamepad, key and text input.
644
+ *
645
+ * `dx`
646
+ * The change in x value of a pointer device, if present. This is not present for gamepad, key and text input.
647
+ *
648
+ * `dy`
649
+ * The change in y value of a pointer device, if present. This is not present for gamepad, key and text input.
650
+ *
651
+ * `screen_dx`
652
+ * The change in screen space x value of a pointer device, if present. This is not present for gamepad, key and text input.
653
+ *
654
+ * `screen_dy`
655
+ * The change in screen space y value of a pointer device, if present. This is not present for gamepad, key and text input.
656
+ *
657
+ * `gamepad`
658
+ * The index of the gamepad device that provided the input. See table below about gamepad input.
659
+ *
660
+ * `touch`
661
+ * List of touch input, one element per finger, if present. See table below about touch input
662
+ *
663
+ * `text`
664
+ * Text input from a (virtual) keyboard or similar.
665
+ *
666
+ * `marked_text`
667
+ * Sequence of entered symbols while entering a symbol combination, for example Japanese Kana.
668
+ *
669
+ * Gamepad specific fields:
670
+ *
671
+ * Field
672
+ * Description
673
+ *
674
+ * `gamepad`
675
+ * The index of the gamepad device that provided the input.
676
+ *
677
+ * `userid`
678
+ * Id of the user associated with the controller. Usually only relevant on consoles.
679
+ *
680
+ * `gamepad_guid`
681
+ * The guid of the gamepad controller. Only passed with "connected" action.
682
+ *
683
+ * `gamepad_guid_info`
684
+ * Parsed guid info table. Only passed with "connected" action. See table below.
685
+ *
686
+ * `gamepad_unknown`
687
+ * True if the input originated from an unknown/unmapped gamepad.
688
+ *
689
+ * `gamepad_name`
690
+ * Name of the gamepad
691
+ *
692
+ * `gamepad_axis`
693
+ * List of gamepad axis values. For raw gamepad input only.
694
+ *
695
+ * `gamepadhats`
696
+ * List of gamepad hat values. For raw gamepad input only.
697
+ *
698
+ * `gamepad_buttons`
699
+ * List of gamepad button values. For raw gamepad input only.
700
+ *
701
+ * Touch input table:
702
+ *
703
+ * Field
704
+ * Description
705
+ *
706
+ * `id`
707
+ * A number identifying the touch input during its duration.
708
+ *
709
+ * `pressed`
710
+ * True if the finger was pressed this frame.
711
+ *
712
+ * `released`
713
+ * True if the finger was released this frame.
714
+ *
715
+ * `tap_count`
716
+ * Number of taps, one for single, two for double-tap, etc
717
+ *
718
+ * `x`
719
+ * The x touch location.
720
+ *
721
+ * `y`
722
+ * The y touch location.
723
+ *
724
+ * `dx`
725
+ * The change in x value.
726
+ *
727
+ * `dy`
728
+ * The change in y value.
729
+ *
730
+ * `acc_x`
731
+ * Accelerometer x value (if present).
732
+ *
733
+ * `acc_y`
734
+ * Accelerometer y value (if present).
735
+ *
736
+ * `acc_z`
737
+ * Accelerometer z value (if present).
738
+ *
739
+ * Guid info table:
740
+ * This info is only passed with a `connected` action.
741
+ *
742
+ * Field
743
+ * Description
744
+ *
745
+ * `vendor`
746
+ * USB vendor id. E.g. Nintendo 0x057e, Sony 0x054c, or Microsoft 0x045e
747
+ *
748
+ * `product`
749
+ * USB product id
750
+ *
751
+ * `bus`
752
+ * How device is communicating. E.g.0x0003 for USB devices and 0x0005 for Bluetooth devices.
753
+ *
754
+ * `crc`
755
+ * SDL CRC16 signature, typically used when vendor and product ids are unavailable
756
+ *
757
+ * `version`
758
+ * The device or firmware version
759
+ *
760
+ * @param self - reference to the script state to be used for storing data
761
+ * @param action_id - id of the received input action, as mapped in the input_binding-file
762
+ * @param action - a table containing the input data, see above for a description. **0️⃣ `gamepad` is 0-based; passed to Defold unchanged.**
763
+ * @returns optional boolean to signal if the input should be consumed (not passed on to others) or not, default is false
764
+ * @example
765
+ * ```ts
766
+ * // This example demonstrates how a game object instance can be moved as a response to user input.
767
+ * export default defineScript({
768
+ * init() {
769
+ * // acquire input focus
770
+ * msg.post(".", "acquire_input_focus");
771
+ * return {
772
+ * // maximum speed the instance can be moved
773
+ * max_speed: 2,
774
+ * // velocity of the instance, initially zero
775
+ * velocity: vmath.vector3(),
776
+ * };
777
+ * },
778
+ *
779
+ * update(self, dt) {
780
+ * // move the instance
781
+ * go.set_position(go.get_position().add(self.velocity.mul(dt)));
782
+ * },
783
+ *
784
+ * on_input(self, action_id, action) {
785
+ * // check for movement input
786
+ * if (action_id === hash("right")) {
787
+ * if (action.released) {
788
+ * // reset velocity if input was released
789
+ * self.velocity = vmath.vector3();
790
+ * } else {
791
+ * // update velocity
792
+ * self.velocity = vmath.vector3((action.value ?? 0) * self.max_speed, 0, 0);
793
+ * }
794
+ * }
795
+ * },
796
+ * });
797
+ * ```
798
+ */
799
+ export function on_input(self: Opaque<"userdata">, action_id: Hash, action: { value?: number; pressed?: boolean; released?: boolean; repeated?: boolean; x?: number; y?: number; screen_x?: number; screen_y?: number; dx?: number; dy?: number; screen_dx?: number; screen_dy?: number; gamepad?: number; gamepad_axis?: Vector3; touch?: { id?: number; pressed?: boolean; released?: boolean; tap_count?: number; x?: number; y?: number; dx?: number; dy?: number; acc_x?: number; acc_y?: number; acc_z?: number }[]; text?: string }): boolean | undefined;
800
+ /**
801
+ * This is a callback-function, which is called by the engine whenever a message has been sent to the script component.
802
+ * It can be used to take action on the message, e.g. send a response back to the sender of the message.
803
+ * The `message` parameter is a table containing the message data. If the message is sent from the engine, the
804
+ * documentation of the message specifies which data is supplied.
805
+ *
806
+ * @param self - reference to the script state to be used for storing data
807
+ * @param message_id - id of the received message
808
+ * @param message - a table containing the message data
809
+ * @param sender - address of the sender
810
+ * @example
811
+ * This example demonstrates how a game object instance, called "a", can communicate with another instance, called "b". It
812
+ * is assumed that both script components of the instances has id "script".
813
+ * Script of instance "a":
814
+ * ```ts
815
+ * // This example demonstrates how a game object instance, called "a", can communicate with another instance, called "b". It
816
+ * // is assumed that both script components of the instances has id "script".
817
+ *
818
+ * // a.script — Script of instance "a":
819
+ * export default defineScript({
820
+ * init() {
821
+ * // let b know about some important data
822
+ * msg.post("b#script", "my_data", { important_value: 1 });
823
+ * },
824
+ * });
825
+ * ```
826
+ * @example
827
+ * Script of instance "b":
828
+ * ```ts
829
+ * // b.script — Script of instance "b":
830
+ * export default defineScript({
831
+ * init() {
832
+ * // store the url of instance "a" for later use, by specifying undefined as socket we
833
+ * // automatically use our own socket
834
+ * return { a_url: msg.url(undefined, go.get_id("a"), "script"), important_value: 0 };
835
+ * },
836
+ *
837
+ * on_message(self, message_id, message, sender) {
838
+ * // check message and sender
839
+ * if (message_id === hash("my_data") && sender === self.a_url && typeof message.important_value === "number") {
840
+ * // use the data in some way
841
+ * self.important_value = message.important_value;
842
+ * }
843
+ * },
844
+ * });
845
+ * ```
846
+ */
847
+ export function on_message(self: Opaque<"userdata">, message_id: Hash, message: Record<string | number, unknown>, sender: Url): void;
848
+ /**
849
+ * This is a callback-function, which is called by the engine when the script component is reloaded, e.g. from the editor.
850
+ * It can be used for live development, e.g. to tweak constants or set up the state properly for the instance.
851
+ *
852
+ * @param self - reference to the script state to be used for storing data
853
+ * @example
854
+ * ```ts
855
+ * // This example demonstrates how to tweak the speed of a game object instance that is moved on user input.
856
+ * export default defineScript({
857
+ * init() {
858
+ * // acquire input focus
859
+ * msg.post(".", "acquire_input_focus");
860
+ * return {
861
+ * // maximum speed the instance can be moved, this value is tweaked in the on_reload function below
862
+ * max_speed: 2,
863
+ * // velocity of the instance, initially zero
864
+ * velocity: vmath.vector3(),
865
+ * };
866
+ * },
867
+ *
868
+ * update(self, dt) {
869
+ * // move the instance
870
+ * go.set_position(go.get_position().add(self.velocity.mul(dt)));
871
+ * },
872
+ *
873
+ * on_input(self, action_id, action) {
874
+ * // check for movement input
875
+ * if (action_id === hash("right")) {
876
+ * if (action.released) {
877
+ * // reset velocity if input was released
878
+ * self.velocity = vmath.vector3();
879
+ * } else {
880
+ * // update velocity
881
+ * self.velocity = vmath.vector3((action.value ?? 0) * self.max_speed, 0, 0);
882
+ * }
883
+ * }
884
+ * },
885
+ *
886
+ * on_reload(self) {
887
+ * // edit this value and reload the script component
888
+ * self.max_speed = 100;
889
+ * },
890
+ * });
891
+ * ```
892
+ */
893
+ export function on_reload(self: Opaque<"userdata">): void;
894
+ /**
895
+ * Sets the parent for a game object instance. This means that the instance will exist in the geometrical space of its parent,
896
+ * like a basic transformation hierarchy or scene graph. If no parent is specified, the instance will be detached from any parent and exist in world
897
+ * space.
898
+ * This function will generate a `set_parent` message. It is not until the message has been processed that the change actually takes effect. This
899
+ * typically happens later in the same frame or the beginning of the next frame. Refer to the manual to learn how messages are processed by the
900
+ * engine.
901
+ *
902
+ * @param id - optional id of the game object instance to set parent for, defaults to the instance containing the calling script
903
+ * @param parent_id - optional id of the new parent game object, defaults to detaching game object from its parent
904
+ * @param keep_world_transform - optional boolean, set to true to maintain the world transform when changing spaces. Defaults to false.
905
+ * @example
906
+ * Attach myself to another instance "my_parent":
907
+ * ```ts
908
+ * go.set_parent(go.get_id(), go.get_id("my_parent"));
909
+ * ```
910
+ * @example
911
+ * Attach an instance "my_instance" to another instance "my_parent":
912
+ * ```ts
913
+ * go.set_parent(go.get_id("my_instance"), go.get_id("my_parent"));
914
+ * ```
915
+ * @example
916
+ * Detach an instance "my_instance" from its parent (if any):
917
+ * ```ts
918
+ * go.set_parent(go.get_id("my_instance"));
919
+ * ```
920
+ */
921
+ export function set_parent(id?: SceneGameObjectAddress | Hash | Url, parent_id?: SceneGameObjectAddress | Hash | Url, keep_world_transform?: boolean): void;
922
+ /**
923
+ * The position is relative to the parent (if any). The global world position cannot be manually set.
924
+ *
925
+ * @param position - position to set
926
+ * @param id - optional id of the game object instance to set the position for, by default the instance of the calling script
927
+ * @example
928
+ * Set the position of the game object instance the script is attached to:
929
+ * ```ts
930
+ * // `p` is the desired position (a Vector3).
931
+ * const p = vmath.vector3();
932
+ * go.set_position(p);
933
+ * ```
934
+ * @example
935
+ * Set the position of another game object instance with id "x":
936
+ * ```ts
937
+ * // `p` is the desired position (a Vector3).
938
+ * const p = vmath.vector3();
939
+ *
940
+ * // Relative addressing by id — no socket prefix:
941
+ * go.set_position(p, "x");
942
+ * ```
943
+ */
944
+ export function set_position(position: Vector3, id?: SceneGameObjectAddress | Hash | Url): void;
945
+ /**
946
+ * The rotation is relative to the parent (if any). The global world rotation cannot be manually set.
947
+ *
948
+ * @param rotation - rotation to set
949
+ * @param id - optional id of the game object instance to get the rotation for, by default the instance of the calling script
950
+ * @example
951
+ * Set the rotation of the game object instance the script is attached to:
952
+ * ```ts
953
+ * // `r` is the desired rotation (a Quaternion).
954
+ * const r = vmath.quat();
955
+ * go.set_rotation(r);
956
+ * ```
957
+ * @example
958
+ * Set the rotation of another game object instance with id "x":
959
+ * ```ts
960
+ * // `r` is the desired rotation (a Quaternion).
961
+ * const r = vmath.quat();
962
+ * go.set_rotation(r, "x");
963
+ * ```
964
+ */
965
+ export function set_rotation(rotation: Quaternion, id?: SceneGameObjectAddress | Hash | Url): void;
966
+ /**
967
+ * The scale factor is relative to the parent (if any). The global world scale factor cannot be manually set.
968
+ * See manual to know how physics affected when setting scale from this function.
969
+ *
970
+ * @param scale - vector or uniform scale factor, must be greater than 0
971
+ * @param id - optional id of the game object instance to get the scale for, by default the instance of the calling script
972
+ * @example
973
+ * Set the scale of the game object instance the script is attached to:
974
+ * ```ts
975
+ * const s = vmath.vector3(2.0, 1.0, 1.0);
976
+ * go.set_scale(s);
977
+ * ```
978
+ * @example
979
+ * Set the scale of another game object instance with id "obj_id":
980
+ * ```ts
981
+ * const s = 1.2;
982
+ * go.set_scale(s, "obj_id");
983
+ * ```
984
+ */
985
+ export function set_scale(scale: number | Vector3, id?: SceneGameObjectAddress | Hash | Url): void;
986
+ /**
987
+ * The scale factor is relative to the parent (if any). The global world scale factor cannot be manually set.
988
+ * See manual to know how physics affected when setting scale from this function.
989
+ *
990
+ * @param scale - vector or uniform scale factor, must be greater than 0
991
+ * @param id - optional id of the game object instance to get the scale for, by default the instance of the calling script
992
+ * @example
993
+ * Set the scale of the game object instance the script is attached to:
994
+ * ```ts
995
+ * const s = vmath.vector3(2.0, 1.0, 5.0);
996
+ * go.set_scale_xy(s); // z will not be set here, only x and y
997
+ * ```
998
+ * @example
999
+ * Set the scale of another game object instance with id "obj_id":
1000
+ * ```ts
1001
+ * const s = 1.2;
1002
+ * go.set_scale_xy(s, "obj_id"); // z will not be set here, only x and y
1003
+ * ```
1004
+ */
1005
+ export function set_scale_xy(scale: number | Vector3, id?: SceneGameObjectAddress | Hash | Url): void;
1006
+ /**
1007
+ * This is a callback-function, which is called by the engine every frame to update the state of a script component.
1008
+ * It can be used to perform any kind of game related tasks, e.g. moving the game object instance.
1009
+ *
1010
+ * @param self - reference to the script state to be used for storing data
1011
+ * @param dt - the time-step of the frame update
1012
+ * @example
1013
+ * ```ts
1014
+ * // This example demonstrates how to move a game object instance through the script component:
1015
+ * export default defineScript({
1016
+ * init() {
1017
+ * // set initial velocity to be 1 along world x-axis
1018
+ * return { my_velocity: vmath.vector3(1, 0, 0) };
1019
+ * },
1020
+ *
1021
+ * update(self, dt) {
1022
+ * // move the game object instance
1023
+ * go.set_position(go.get_position().add(self.my_velocity.mul(dt)));
1024
+ * },
1025
+ * });
1026
+ * ```
1027
+ */
1028
+ export function update(self: Opaque<"userdata">, dt: number): void;
1029
+ /**
1030
+ * Recalculates and updates the cached world transform immediately for the target instance
1031
+ * and its ancestors (parent chain up to the collection root). Descendants (children) are
1032
+ * not updated by this function.
1033
+ * If no id is provided, the instance of the calling script is used.
1034
+ * Use this after changing local transform mid-frame when you need the
1035
+ * new world transform right away (e.g. before end-of-frame updates). Note that child
1036
+ * instances will still have last-frame world transforms until the regular update.
1037
+ *
1038
+ * @param id - optional id of the game object instance to update
1039
+ * @example
1040
+ * Update this game object's world transform:
1041
+ * ```ts
1042
+ * go.update_world_transform();
1043
+ * ```
1044
+ * @example
1045
+ * Update another game object's world transform:
1046
+ * ```ts
1047
+ * go.update_world_transform("/other");
1048
+ * ```
1049
+ */
1050
+ export function update_world_transform(id?: SceneGameObjectAddress | Hash | Url): void;
1051
+ /**
1052
+ * The function uses world transformation calculated at the end of previous frame.
1053
+ *
1054
+ * @param position - position which need to be converted
1055
+ * @param url - url of the game object which coordinate system convert to
1056
+ * @returns converted position
1057
+ * @example
1058
+ * ```ts
1059
+ * // Convert position of "test" game object into coordinate space of "child" object.
1060
+ * const test_pos = go.get_world_position("/test");
1061
+ * const child_pos = go.get_world_position("/child");
1062
+ * const new_position = go.world_to_local_position(test_pos, "/child");
1063
+ * ```
1064
+ */
1065
+ export function world_to_local_position(position: Vector3, url?: SceneGameObjectAddress | Hash | Url): Vector3;
1066
+ /**
1067
+ * The function uses world transformation calculated at the end of previous frame.
1068
+ *
1069
+ * @param transformation - transformation which need to be converted
1070
+ * @param url - url of the game object which coordinate system convert to
1071
+ * @returns converted transformation
1072
+ * @example
1073
+ * ```ts
1074
+ * // Convert transform of "test" game object into coordinate space of "child" object.
1075
+ * const test_transform = go.get_world_transform("/test");
1076
+ * const child_transform = go.get_world_transform("/child");
1077
+ * const result_transform = go.world_to_local_transform(test_transform, "/child");
1078
+ * ```
1079
+ */
1080
+ export function world_to_local_transform(transformation: Matrix4, url?: SceneGameObjectAddress | Hash | Url): Matrix4;
1081
+ export { _delete as delete };
1082
+ export interface properties {
1083
+ /**
1084
+ * The rotation of the game object expressed in Euler angles.
1085
+ * Euler angles are specified in degrees in the interval (-360, 360).
1086
+ * The type of the property is vector3.
1087
+ */
1088
+ euler: Vector3;
1089
+ /**
1090
+ * The position of the game object.
1091
+ * The type of the property is vector3.
1092
+ */
1093
+ position: Vector3;
1094
+ /**
1095
+ * The rotation of the game object.
1096
+ * The type of the property is quaternion.
1097
+ */
1098
+ rotation: Quaternion;
1099
+ /**
1100
+ * The scale of the game object. `go.get` returns a vector3; `go.set` and `go.animate` also take a number, which sets a uniform scale.
1101
+ */
1102
+ scale: number | Vector3;
1103
+ }
1104
+ }
1105
+ }
1106
+
1107
+ export {};