@defold-typescript/types 0.53.0 → 0.54.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 (335) hide show
  1. package/dist/cli-runtime.js +8966 -0
  2. package/dist/identity-vocabulary.json +660 -0
  3. package/dist/src/index.d.ts +18 -0
  4. package/fixtures/defold-1.12.4/b2d_body_doc.json +1327 -0
  5. package/fixtures/defold-1.12.4/b2d_doc.json +107 -0
  6. package/fixtures/defold-1.12.4/base_doc.json +758 -0
  7. package/fixtures/defold-1.12.4/bit_doc.json +404 -0
  8. package/fixtures/defold-1.12.4/buffer_doc.json +422 -0
  9. package/fixtures/defold-1.12.4/camera_doc.json +664 -0
  10. package/fixtures/defold-1.12.4/collectionfactory_doc.json +219 -0
  11. package/fixtures/defold-1.12.4/collectionproxy_doc.json +289 -0
  12. package/fixtures/defold-1.12.4/coroutine_doc.json +151 -0
  13. package/fixtures/defold-1.12.4/crash_doc.json +497 -0
  14. package/fixtures/defold-1.12.4/debug_doc.json +410 -0
  15. package/fixtures/defold-1.12.4/factory_doc.json +219 -0
  16. package/fixtures/defold-1.12.4/font_doc.json +141 -0
  17. package/fixtures/defold-1.12.4/globals_doc.json +42 -0
  18. package/fixtures/defold-1.12.4/go-instance-functions.json +111 -0
  19. package/fixtures/defold-1.12.4/go_doc.json +1901 -0
  20. package/fixtures/defold-1.12.4/graphics_doc.json +1634 -0
  21. package/fixtures/defold-1.12.4/gui_doc.json +5249 -0
  22. package/fixtures/defold-1.12.4/html5_doc.json +64 -0
  23. package/fixtures/defold-1.12.4/http_doc.json +66 -0
  24. package/fixtures/defold-1.12.4/image_doc.json +170 -0
  25. package/fixtures/defold-1.12.4/io_doc.json +399 -0
  26. package/fixtures/defold-1.12.4/json_doc.json +97 -0
  27. package/fixtures/defold-1.12.4/label_doc.json +220 -0
  28. package/fixtures/defold-1.12.4/liveupdate_doc.json +308 -0
  29. package/fixtures/defold-1.12.4/math_doc.json +702 -0
  30. package/fixtures/defold-1.12.4/messages_doc.json +579 -0
  31. package/fixtures/defold-1.12.4/model_doc.json +315 -0
  32. package/fixtures/defold-1.12.4/msg_doc.json +137 -0
  33. package/fixtures/defold-1.12.4/os_doc.json +266 -0
  34. package/fixtures/defold-1.12.4/package_doc.json +139 -0
  35. package/fixtures/defold-1.12.4/particlefx_doc.json +249 -0
  36. package/fixtures/defold-1.12.4/physics_doc.json +1120 -0
  37. package/fixtures/defold-1.12.4/profiler_doc.json +375 -0
  38. package/fixtures/defold-1.12.4/render_doc.json +1167 -0
  39. package/fixtures/defold-1.12.4/resource_doc.json +762 -0
  40. package/fixtures/defold-1.12.4/socket_doc.json +2194 -0
  41. package/fixtures/defold-1.12.4/sound_doc.json +582 -0
  42. package/fixtures/defold-1.12.4/sprite_doc.json +245 -0
  43. package/fixtures/defold-1.12.4/string_doc.json +412 -0
  44. package/fixtures/defold-1.12.4/sys_doc.json +853 -0
  45. package/fixtures/defold-1.12.4/table_doc.json +166 -0
  46. package/fixtures/defold-1.12.4/tilemap_doc.json +374 -0
  47. package/fixtures/defold-1.12.4/timer_doc.json +153 -0
  48. package/fixtures/defold-1.12.4/types_doc.json +212 -0
  49. package/fixtures/defold-1.12.4/vmath_doc.json +1814 -0
  50. package/fixtures/defold-1.12.4/window_doc.json +388 -0
  51. package/fixtures/defold-1.12.4/zlib_doc.json +70 -0
  52. package/fixtures/defold-1.13.0/b2d_body_doc.json +2428 -0
  53. package/fixtures/defold-1.13.0/b2d_chain_doc.json +394 -0
  54. package/fixtures/defold-1.13.0/b2d_doc.json +128 -0
  55. package/fixtures/defold-1.13.0/b2d_fixture_doc.json +594 -0
  56. package/fixtures/defold-1.13.0/b2d_joint_doc.json +3315 -0
  57. package/fixtures/defold-1.13.0/b2d_shape_doc.json +802 -0
  58. package/fixtures/defold-1.13.0/b2d_world_doc.json +1314 -0
  59. package/fixtures/defold-1.13.0/base_doc.json +758 -0
  60. package/fixtures/defold-1.13.0/bit_doc.json +404 -0
  61. package/fixtures/defold-1.13.0/buffer_doc.json +422 -0
  62. package/fixtures/defold-1.13.0/camera_doc.json +900 -0
  63. package/fixtures/defold-1.13.0/collectionfactory_doc.json +219 -0
  64. package/fixtures/defold-1.13.0/collectionproxy_doc.json +289 -0
  65. package/fixtures/defold-1.13.0/compute_doc.json +182 -0
  66. package/fixtures/defold-1.13.0/coroutine_doc.json +151 -0
  67. package/fixtures/defold-1.13.0/crash_doc.json +497 -0
  68. package/fixtures/defold-1.13.0/debug_doc.json +410 -0
  69. package/fixtures/defold-1.13.0/editor_doc.json +3665 -0
  70. package/fixtures/defold-1.13.0/editor_http_doc.json +273 -0
  71. package/fixtures/defold-1.13.0/editor_json_doc.json +59 -0
  72. package/fixtures/defold-1.13.0/editor_localization_doc.json +138 -0
  73. package/fixtures/defold-1.13.0/editor_pprint_doc.json +36 -0
  74. package/fixtures/defold-1.13.0/editor_tilemap_tiles_doc.json +235 -0
  75. package/fixtures/defold-1.13.0/editor_zip_doc.json +163 -0
  76. package/fixtures/defold-1.13.0/editor_zlib_doc.json +48 -0
  77. package/fixtures/defold-1.13.0/factory_doc.json +219 -0
  78. package/fixtures/defold-1.13.0/font_doc.json +141 -0
  79. package/fixtures/defold-1.13.0/globals_doc.json +42 -0
  80. package/fixtures/defold-1.13.0/go-instance-functions.json +101 -0
  81. package/fixtures/defold-1.13.0/go_doc.json +1989 -0
  82. package/fixtures/defold-1.13.0/graphics_doc.json +1886 -0
  83. package/fixtures/defold-1.13.0/gui_doc.json +5277 -0
  84. package/fixtures/defold-1.13.0/html5_doc.json +64 -0
  85. package/fixtures/defold-1.13.0/http_doc.json +66 -0
  86. package/fixtures/defold-1.13.0/image_doc.json +170 -0
  87. package/fixtures/defold-1.13.0/import-manifest.json +10558 -0
  88. package/fixtures/defold-1.13.0/io_doc.json +399 -0
  89. package/fixtures/defold-1.13.0/json_doc.json +97 -0
  90. package/fixtures/defold-1.13.0/label_doc.json +220 -0
  91. package/fixtures/defold-1.13.0/liveupdate_doc.json +330 -0
  92. package/fixtures/defold-1.13.0/material_doc.json +238 -0
  93. package/fixtures/defold-1.13.0/math_doc.json +702 -0
  94. package/fixtures/defold-1.13.0/model_doc.json +412 -0
  95. package/fixtures/defold-1.13.0/msg_doc.json +137 -0
  96. package/fixtures/defold-1.13.0/os_doc.json +266 -0
  97. package/fixtures/defold-1.13.0/package_doc.json +139 -0
  98. package/fixtures/defold-1.13.0/particlefx_doc.json +249 -0
  99. package/fixtures/defold-1.13.0/physics_doc.json +1492 -0
  100. package/fixtures/defold-1.13.0/profiler_doc.json +375 -0
  101. package/fixtures/defold-1.13.0/render_doc.json +1381 -0
  102. package/fixtures/defold-1.13.0/resource_doc.json +762 -0
  103. package/fixtures/defold-1.13.0/socket_doc.json +2194 -0
  104. package/fixtures/defold-1.13.0/sound_doc.json +582 -0
  105. package/fixtures/defold-1.13.0/sprite_doc.json +335 -0
  106. package/fixtures/defold-1.13.0/string_doc.json +412 -0
  107. package/fixtures/defold-1.13.0/sys_doc.json +1142 -0
  108. package/fixtures/defold-1.13.0/table_doc.json +166 -0
  109. package/fixtures/defold-1.13.0/tilemap_doc.json +402 -0
  110. package/fixtures/defold-1.13.0/timer_doc.json +153 -0
  111. package/fixtures/defold-1.13.0/types_doc.json +212 -0
  112. package/fixtures/defold-1.13.0/vmath_doc.json +1814 -0
  113. package/fixtures/defold-1.13.0/window_doc.json +388 -0
  114. package/fixtures/defold-1.13.0/zlib_doc.json +70 -0
  115. package/fixtures/defold-1.13.1/b2d_body_doc.json +2428 -0
  116. package/fixtures/defold-1.13.1/b2d_chain_doc.json +394 -0
  117. package/fixtures/defold-1.13.1/b2d_doc.json +128 -0
  118. package/fixtures/defold-1.13.1/b2d_fixture_doc.json +594 -0
  119. package/fixtures/defold-1.13.1/b2d_joint_doc.json +3315 -0
  120. package/fixtures/defold-1.13.1/b2d_shape_doc.json +802 -0
  121. package/fixtures/defold-1.13.1/b2d_world_doc.json +1314 -0
  122. package/fixtures/defold-1.13.1/base_doc.json +758 -0
  123. package/fixtures/defold-1.13.1/bit_doc.json +404 -0
  124. package/fixtures/defold-1.13.1/buffer_doc.json +422 -0
  125. package/fixtures/defold-1.13.1/camera_doc.json +900 -0
  126. package/fixtures/defold-1.13.1/collectionfactory_doc.json +219 -0
  127. package/fixtures/defold-1.13.1/collectionproxy_doc.json +323 -0
  128. package/fixtures/defold-1.13.1/compute_doc.json +182 -0
  129. package/fixtures/defold-1.13.1/coroutine_doc.json +151 -0
  130. package/fixtures/defold-1.13.1/crash_doc.json +497 -0
  131. package/fixtures/defold-1.13.1/debug_doc.json +410 -0
  132. package/fixtures/defold-1.13.1/editor_doc.json +3880 -0
  133. package/fixtures/defold-1.13.1/editor_http_doc.json +273 -0
  134. package/fixtures/defold-1.13.1/editor_image_doc.json +128 -0
  135. package/fixtures/defold-1.13.1/editor_json_doc.json +59 -0
  136. package/fixtures/defold-1.13.1/editor_localization_doc.json +138 -0
  137. package/fixtures/defold-1.13.1/editor_pprint_doc.json +36 -0
  138. package/fixtures/defold-1.13.1/editor_tilemap_tiles_doc.json +235 -0
  139. package/fixtures/defold-1.13.1/editor_zip_doc.json +163 -0
  140. package/fixtures/defold-1.13.1/editor_zlib_doc.json +48 -0
  141. package/fixtures/defold-1.13.1/factory_doc.json +219 -0
  142. package/fixtures/defold-1.13.1/font_doc.json +141 -0
  143. package/fixtures/defold-1.13.1/globals_doc.json +42 -0
  144. package/fixtures/defold-1.13.1/go-instance-functions.json +102 -0
  145. package/fixtures/defold-1.13.1/go_doc.json +1989 -0
  146. package/fixtures/defold-1.13.1/graphics_doc.json +1886 -0
  147. package/fixtures/defold-1.13.1/gui_doc.json +5277 -0
  148. package/fixtures/defold-1.13.1/html5_doc.json +64 -0
  149. package/fixtures/defold-1.13.1/http_doc.json +66 -0
  150. package/fixtures/defold-1.13.1/image_doc.json +170 -0
  151. package/fixtures/defold-1.13.1/import-manifest.json +10091 -0
  152. package/fixtures/defold-1.13.1/io_doc.json +399 -0
  153. package/fixtures/defold-1.13.1/json_doc.json +97 -0
  154. package/fixtures/defold-1.13.1/label_doc.json +220 -0
  155. package/fixtures/defold-1.13.1/liveupdate_doc.json +330 -0
  156. package/fixtures/defold-1.13.1/material_doc.json +238 -0
  157. package/fixtures/defold-1.13.1/math_doc.json +702 -0
  158. package/fixtures/defold-1.13.1/model_doc.json +412 -0
  159. package/fixtures/defold-1.13.1/msg_doc.json +137 -0
  160. package/fixtures/defold-1.13.1/os_doc.json +266 -0
  161. package/fixtures/defold-1.13.1/package_doc.json +139 -0
  162. package/fixtures/defold-1.13.1/particlefx_doc.json +249 -0
  163. package/fixtures/defold-1.13.1/physics_doc.json +1492 -0
  164. package/fixtures/defold-1.13.1/profiler_doc.json +375 -0
  165. package/fixtures/defold-1.13.1/render_doc.json +1381 -0
  166. package/fixtures/defold-1.13.1/resource_doc.json +762 -0
  167. package/fixtures/defold-1.13.1/socket_doc.json +2194 -0
  168. package/fixtures/defold-1.13.1/sound_doc.json +582 -0
  169. package/fixtures/defold-1.13.1/sprite_doc.json +335 -0
  170. package/fixtures/defold-1.13.1/string_doc.json +412 -0
  171. package/fixtures/defold-1.13.1/sys_doc.json +1142 -0
  172. package/fixtures/defold-1.13.1/table_doc.json +166 -0
  173. package/fixtures/defold-1.13.1/tilemap_doc.json +402 -0
  174. package/fixtures/defold-1.13.1/timer_doc.json +153 -0
  175. package/fixtures/defold-1.13.1/types_doc.json +212 -0
  176. package/fixtures/defold-1.13.1/vmath_doc.json +1814 -0
  177. package/fixtures/defold-1.13.1/window_doc.json +388 -0
  178. package/fixtures/defold-1.13.1/zlib_doc.json +70 -0
  179. package/fixtures/defold-1.13.2/b2d_body_doc.json +2359 -0
  180. package/fixtures/defold-1.13.2/b2d_chain_doc.json +395 -0
  181. package/fixtures/defold-1.13.2/b2d_doc.json +1945 -0
  182. package/fixtures/defold-1.13.2/b2d_fixture_doc.json +595 -0
  183. package/fixtures/defold-1.13.2/b2d_joint_doc.json +3178 -0
  184. package/fixtures/defold-1.13.2/b2d_shape_doc.json +767 -0
  185. package/fixtures/defold-1.13.2/b2d_world_doc.json +1315 -0
  186. package/fixtures/defold-1.13.2/base_doc.json +759 -0
  187. package/fixtures/defold-1.13.2/bit_doc.json +405 -0
  188. package/fixtures/defold-1.13.2/buffer_doc.json +393 -0
  189. package/fixtures/defold-1.13.2/bullet3d_collision_object_doc.json +1206 -0
  190. package/fixtures/defold-1.13.2/bullet3d_constraint_doc.json +2455 -0
  191. package/fixtures/defold-1.13.2/bullet3d_doc.json +215 -0
  192. package/fixtures/defold-1.13.2/bullet3d_rigid_body_doc.json +1376 -0
  193. package/fixtures/defold-1.13.2/bullet3d_shape_doc.json +430 -0
  194. package/fixtures/defold-1.13.2/bullet3d_world_doc.json +855 -0
  195. package/fixtures/defold-1.13.2/camera_doc.json +887 -0
  196. package/fixtures/defold-1.13.2/collectionfactory_doc.json +206 -0
  197. package/fixtures/defold-1.13.2/collectionproxy_doc.json +397 -0
  198. package/fixtures/defold-1.13.2/compute_doc.json +183 -0
  199. package/fixtures/defold-1.13.2/coroutine_doc.json +152 -0
  200. package/fixtures/defold-1.13.2/crash_doc.json +483 -0
  201. package/fixtures/defold-1.13.2/debug_doc.json +411 -0
  202. package/fixtures/defold-1.13.2/editor_doc.json +6320 -0
  203. package/fixtures/defold-1.13.2/editor_http_doc.json +476 -0
  204. package/fixtures/defold-1.13.2/editor_image_doc.json +129 -0
  205. package/fixtures/defold-1.13.2/editor_json_doc.json +81 -0
  206. package/fixtures/defold-1.13.2/editor_localization_doc.json +139 -0
  207. package/fixtures/defold-1.13.2/editor_pprint_doc.json +37 -0
  208. package/fixtures/defold-1.13.2/editor_tilemap_tiles_doc.json +292 -0
  209. package/fixtures/defold-1.13.2/editor_zip_doc.json +237 -0
  210. package/fixtures/defold-1.13.2/editor_zlib_doc.json +49 -0
  211. package/fixtures/defold-1.13.2/factory_doc.json +206 -0
  212. package/fixtures/defold-1.13.2/font_doc.json +230 -0
  213. package/fixtures/defold-1.13.2/globals_doc.json +64 -0
  214. package/fixtures/defold-1.13.2/go-instance-functions.json +106 -0
  215. package/fixtures/defold-1.13.2/go_doc.json +1789 -0
  216. package/fixtures/defold-1.13.2/graphics_doc.json +1211 -0
  217. package/fixtures/defold-1.13.2/gui_doc.json +4735 -0
  218. package/fixtures/defold-1.13.2/html5_doc.json +65 -0
  219. package/fixtures/defold-1.13.2/http_doc.json +174 -0
  220. package/fixtures/defold-1.13.2/image_doc.json +298 -0
  221. package/fixtures/defold-1.13.2/import-manifest.json +10902 -0
  222. package/fixtures/defold-1.13.2/io_doc.json +400 -0
  223. package/fixtures/defold-1.13.2/json_doc.json +140 -0
  224. package/fixtures/defold-1.13.2/label_doc.json +427 -0
  225. package/fixtures/defold-1.13.2/liveupdate_doc.json +221 -0
  226. package/fixtures/defold-1.13.2/material_doc.json +773 -0
  227. package/fixtures/defold-1.13.2/math_doc.json +703 -0
  228. package/fixtures/defold-1.13.2/model_doc.json +472 -0
  229. package/fixtures/defold-1.13.2/msg_doc.json +169 -0
  230. package/fixtures/defold-1.13.2/os_doc.json +269 -0
  231. package/fixtures/defold-1.13.2/package_doc.json +140 -0
  232. package/fixtures/defold-1.13.2/particlefx_doc.json +249 -0
  233. package/fixtures/defold-1.13.2/physics_doc.json +1624 -0
  234. package/fixtures/defold-1.13.2/profiler_doc.json +348 -0
  235. package/fixtures/defold-1.13.2/render_doc.json +1623 -0
  236. package/fixtures/defold-1.13.2/resource_doc.json +1539 -0
  237. package/fixtures/defold-1.13.2/socket_doc.json +2335 -0
  238. package/fixtures/defold-1.13.2/sound_doc.json +673 -0
  239. package/fixtures/defold-1.13.2/sprite_doc.json +364 -0
  240. package/fixtures/defold-1.13.2/string_doc.json +413 -0
  241. package/fixtures/defold-1.13.2/sys_doc.json +1347 -0
  242. package/fixtures/defold-1.13.2/table_doc.json +167 -0
  243. package/fixtures/defold-1.13.2/tilemap_doc.json +369 -0
  244. package/fixtures/defold-1.13.2/timer_doc.json +214 -0
  245. package/fixtures/defold-1.13.2/types_doc.json +213 -0
  246. package/fixtures/defold-1.13.2/vmath_doc.json +2056 -0
  247. package/fixtures/defold-1.13.2/window_doc.json +426 -0
  248. package/fixtures/defold-1.13.2/zlib_doc.json +71 -0
  249. package/fixtures/defold-1.14.0/b2d_body_doc.json +2359 -0
  250. package/fixtures/defold-1.14.0/b2d_chain_doc.json +395 -0
  251. package/fixtures/defold-1.14.0/b2d_doc.json +1973 -0
  252. package/fixtures/defold-1.14.0/b2d_fixture_doc.json +595 -0
  253. package/fixtures/defold-1.14.0/b2d_joint_doc.json +3178 -0
  254. package/fixtures/defold-1.14.0/b2d_shape_doc.json +767 -0
  255. package/fixtures/defold-1.14.0/b2d_world_doc.json +1315 -0
  256. package/fixtures/defold-1.14.0/base_doc.json +759 -0
  257. package/fixtures/defold-1.14.0/bit_doc.json +405 -0
  258. package/fixtures/defold-1.14.0/buffer_doc.json +393 -0
  259. package/fixtures/defold-1.14.0/bullet3d_collision_object_doc.json +1206 -0
  260. package/fixtures/defold-1.14.0/bullet3d_constraint_doc.json +2455 -0
  261. package/fixtures/defold-1.14.0/bullet3d_doc.json +243 -0
  262. package/fixtures/defold-1.14.0/bullet3d_rigid_body_doc.json +1376 -0
  263. package/fixtures/defold-1.14.0/bullet3d_shape_doc.json +430 -0
  264. package/fixtures/defold-1.14.0/bullet3d_world_doc.json +855 -0
  265. package/fixtures/defold-1.14.0/camera_doc.json +887 -0
  266. package/fixtures/defold-1.14.0/collectionfactory_doc.json +206 -0
  267. package/fixtures/defold-1.14.0/collectionproxy_doc.json +397 -0
  268. package/fixtures/defold-1.14.0/compute_doc.json +183 -0
  269. package/fixtures/defold-1.14.0/coroutine_doc.json +152 -0
  270. package/fixtures/defold-1.14.0/crash_doc.json +483 -0
  271. package/fixtures/defold-1.14.0/debug_doc.json +411 -0
  272. package/fixtures/defold-1.14.0/editor_doc.json +6320 -0
  273. package/fixtures/defold-1.14.0/editor_http_doc.json +476 -0
  274. package/fixtures/defold-1.14.0/editor_image_doc.json +129 -0
  275. package/fixtures/defold-1.14.0/editor_json_doc.json +81 -0
  276. package/fixtures/defold-1.14.0/editor_localization_doc.json +139 -0
  277. package/fixtures/defold-1.14.0/editor_pprint_doc.json +37 -0
  278. package/fixtures/defold-1.14.0/editor_tilemap_tiles_doc.json +292 -0
  279. package/fixtures/defold-1.14.0/editor_zip_doc.json +237 -0
  280. package/fixtures/defold-1.14.0/editor_zlib_doc.json +49 -0
  281. package/fixtures/defold-1.14.0/factory_doc.json +206 -0
  282. package/fixtures/defold-1.14.0/font_doc.json +230 -0
  283. package/fixtures/defold-1.14.0/globals_doc.json +64 -0
  284. package/fixtures/defold-1.14.0/go-instance-functions.json +106 -0
  285. package/fixtures/defold-1.14.0/go_doc.json +1789 -0
  286. package/fixtures/defold-1.14.0/graphics_doc.json +1257 -0
  287. package/fixtures/defold-1.14.0/gui_doc.json +4735 -0
  288. package/fixtures/defold-1.14.0/html5_doc.json +65 -0
  289. package/fixtures/defold-1.14.0/http_doc.json +174 -0
  290. package/fixtures/defold-1.14.0/image_doc.json +298 -0
  291. package/fixtures/defold-1.14.0/import-manifest.json +10260 -0
  292. package/fixtures/defold-1.14.0/io_doc.json +400 -0
  293. package/fixtures/defold-1.14.0/json_doc.json +140 -0
  294. package/fixtures/defold-1.14.0/label_doc.json +427 -0
  295. package/fixtures/defold-1.14.0/liveupdate_doc.json +221 -0
  296. package/fixtures/defold-1.14.0/material_doc.json +773 -0
  297. package/fixtures/defold-1.14.0/math_doc.json +703 -0
  298. package/fixtures/defold-1.14.0/model_doc.json +472 -0
  299. package/fixtures/defold-1.14.0/msg_doc.json +169 -0
  300. package/fixtures/defold-1.14.0/os_doc.json +269 -0
  301. package/fixtures/defold-1.14.0/package_doc.json +140 -0
  302. package/fixtures/defold-1.14.0/particlefx_doc.json +249 -0
  303. package/fixtures/defold-1.14.0/physics_doc.json +1624 -0
  304. package/fixtures/defold-1.14.0/profiler_doc.json +348 -0
  305. package/fixtures/defold-1.14.0/render_doc.json +1628 -0
  306. package/fixtures/defold-1.14.0/resource_doc.json +1539 -0
  307. package/fixtures/defold-1.14.0/socket_doc.json +2335 -0
  308. package/fixtures/defold-1.14.0/sound_doc.json +673 -0
  309. package/fixtures/defold-1.14.0/sprite_doc.json +364 -0
  310. package/fixtures/defold-1.14.0/string_doc.json +413 -0
  311. package/fixtures/defold-1.14.0/sys_doc.json +1347 -0
  312. package/fixtures/defold-1.14.0/table_doc.json +167 -0
  313. package/fixtures/defold-1.14.0/tilemap_doc.json +369 -0
  314. package/fixtures/defold-1.14.0/timer_doc.json +214 -0
  315. package/fixtures/defold-1.14.0/types_doc.json +213 -0
  316. package/fixtures/defold-1.14.0/vmath_doc.json +2056 -0
  317. package/fixtures/defold-1.14.0/window_doc.json +426 -0
  318. package/fixtures/defold-1.14.0/zlib_doc.json +71 -0
  319. package/package.json +13 -6
  320. package/scripts/cli-runtime.ts +18 -0
  321. package/scripts/example-store-io.ts +2 -2
  322. package/scripts/extension-goldens.ts +9 -5
  323. package/scripts/generate-api-availability.ts +1 -1
  324. package/scripts/generate-api-signatures.ts +1 -1
  325. package/scripts/import-defold-release.ts +1 -1
  326. package/scripts/regen.ts +35 -9
  327. package/scripts/signature-store-fs.ts +37 -17
  328. package/scripts/sync-api-docs.ts +127 -20
  329. package/src/api-doc.ts +11 -4
  330. package/src/emit-dts.ts +115 -21
  331. package/src/index-slot-classifications.ts +75 -9
  332. package/src/index.ts +3 -1
  333. package/src/publish-dts.ts +16 -0
  334. package/src/script-api.ts +36 -38
  335. package/src/library-index-slot-classifications.ts +0 -332
@@ -0,0 +1,1789 @@
1
+ {
2
+ "elements": [
3
+ {
4
+ "type": "MESSAGE",
5
+ "name": "acquire_input_focus",
6
+ "brief": "acquires the user input focus",
7
+ "description": "Post this message to a game object instance to make that instance acquire the user input focus.\nUser input is distributed by the engine to every instance that has\nrequested it. The last instance to request focus will receive it first.\nThis means that the scripts in the instance will have first-hand-chance\nat reacting on user input, possibly consuming it (by returning\n<code>true</code> from <code>on_input</code>) so that no other instances\ncan react on it. The most common case is for a script to send this message\nto itself when it needs to respond to user input.\nA script belonging to an instance which has the user input focus will\nreceive the input actions in its <code>on_input</code> callback function.\nSee <a href=\"#on_input\">on_input</a> for more information on how user input can be\nhandled.",
8
+ "returnvalues": [],
9
+ "parameters": [],
10
+ "examples": "This example demonstrates how to acquire and act on user input.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- acquire input focus as soon as the instance has been initialized</span>\n <span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;.&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;acquire_input_focus&quot;</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">on_input</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">action_id</span><span class=\"p\">,</span> <span class=\"n\">action</span><span class=\"p\">)</span>\n <span class=\"c1\">-- check which input we received</span>\n <span class=\"kr\">if</span> <span class=\"n\">action_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_action&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- act on the input</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_action_amount</span> <span class=\"o\">=</span> <span class=\"n\">action</span><span class=\"p\">.</span><span class=\"n\">value</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
11
+ "replaces": "",
12
+ "error": "",
13
+ "tparams": [],
14
+ "members": [],
15
+ "notes": [],
16
+ "language": ""
17
+ },
18
+ {
19
+ "type": "MESSAGE",
20
+ "name": "release_input_focus",
21
+ "brief": "releases the user input focus",
22
+ "description": "Post this message to an instance to make that instance release the user input focus.\nSee <a href=\"#acquire_input_focus\">acquire_input_focus</a> for more information on how the user input handling\nworks.",
23
+ "returnvalues": [],
24
+ "parameters": [],
25
+ "examples": "How to make a game object stop receiving input:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;.&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;release_input_focus&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
26
+ "replaces": "",
27
+ "error": "",
28
+ "tparams": [],
29
+ "members": [],
30
+ "notes": [],
31
+ "language": ""
32
+ },
33
+ {
34
+ "type": "MESSAGE",
35
+ "name": "set_parent",
36
+ "brief": "sets the parent of the receiving instance",
37
+ "description": "When this message is sent to an instance, it sets the parent of that instance. This means that the instance will exist\nin the geometrical space of its parent, like a basic transformation hierarchy or scene graph. If no parent is specified,\nthe instance will be detached from any parent and exist in world space. A script can send this message to itself to set\nthe parent of its instance.",
38
+ "returnvalues": [],
39
+ "parameters": [
40
+ {
41
+ "name": "parent_id",
42
+ "doc": "the id of the new parent",
43
+ "types": ["hash"],
44
+ "is_optional": "False"
45
+ },
46
+ {
47
+ "name": "keep_world_transform",
48
+ "doc": "if the world transform of the instance should be preserved when changing spaces, 0 for false and 1 for true. The default value is 1.",
49
+ "types": ["number"],
50
+ "is_optional": "False"
51
+ }
52
+ ],
53
+ "examples": "Attach myself to another instance \"my_parent\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;.&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;set_parent&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">parent_id</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_parent&quot;</span><span class=\"p\">)})</span>\n</code></pre></div>\n\nAttach an instance \"my_instance\" to another instance \"my_parent\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_instance&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;set_parent&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">parent_id</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_parent&quot;</span><span class=\"p\">)})</span>\n</code></pre></div>\n\nDetach an instance \"my_instance\" from its parent (if any):\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_instance&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;set_parent&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
54
+ "replaces": "",
55
+ "error": "",
56
+ "tparams": [],
57
+ "members": [],
58
+ "notes": [],
59
+ "language": ""
60
+ },
61
+ {
62
+ "type": "MESSAGE",
63
+ "name": "enable",
64
+ "brief": "enables the receiving component",
65
+ "description": "This message enables the receiving component. All components are enabled by default, which means they will receive input, updates\nand be a part of the simulation. A component is disabled when it receives the <code>disable</code> message.\n<span class=\"icon-alert\"></span> Components that currently supports this message are:\n<ul>\n<li>Camera</li>\n<li>Collection Proxy</li>\n<li>Collision Object</li>\n<li>Gui</li>\n<li>Label</li>\n<li>Spine Model</li>\n<li>Sprite</li>\n<li>Tile Grid</li>\n<li>Model</li>\n<li>Mesh</li>\n</ul>",
66
+ "returnvalues": [],
67
+ "parameters": [],
68
+ "examples": "Enable the component \"my_component\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;#my_component&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;enable&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
69
+ "replaces": "",
70
+ "error": "",
71
+ "tparams": [],
72
+ "members": [],
73
+ "notes": [],
74
+ "language": ""
75
+ },
76
+ {
77
+ "type": "MESSAGE",
78
+ "name": "disable",
79
+ "brief": "disables the receiving component",
80
+ "description": "This message disables the receiving component. All components are enabled by default, which means they will receive input, updates\nand be a part of the simulation. A component is disabled when it receives the <code>disable</code> message.\n<span class=\"icon-alert\"></span> Components that currently supports this message are:\n<ul>\n<li>Camera</li>\n<li>Collection Proxy</li>\n<li>Collision Object</li>\n<li>Gui</li>\n<li>Label</li>\n<li>Spine Model</li>\n<li>Sprite</li>\n<li>Tile Grid</li>\n<li>Model</li>\n<li>Mesh</li>\n</ul>",
81
+ "returnvalues": [],
82
+ "parameters": [],
83
+ "examples": "Disable the component \"my_component\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;#my_component&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;disable&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
84
+ "replaces": "",
85
+ "error": "",
86
+ "tparams": [],
87
+ "members": [],
88
+ "notes": [],
89
+ "language": ""
90
+ },
91
+ {
92
+ "type": "ENUM",
93
+ "name": "go.EASING",
94
+ "brief": "Easing curves",
95
+ "description": "Easing curves",
96
+ "returnvalues": [],
97
+ "parameters": [],
98
+ "examples": "",
99
+ "replaces": "",
100
+ "error": "",
101
+ "tparams": [],
102
+ "members": [
103
+ {
104
+ "name": "go.EASING_INBACK",
105
+ "doc": "in-back",
106
+ "type": ""
107
+ },
108
+ {
109
+ "name": "go.EASING_INBOUNCE",
110
+ "doc": "in-bounce",
111
+ "type": ""
112
+ },
113
+ {
114
+ "name": "go.EASING_INCIRC",
115
+ "doc": "in-circlic",
116
+ "type": ""
117
+ },
118
+ {
119
+ "name": "go.EASING_INCUBIC",
120
+ "doc": "in-cubic",
121
+ "type": ""
122
+ },
123
+ {
124
+ "name": "go.EASING_INELASTIC",
125
+ "doc": "in-elastic",
126
+ "type": ""
127
+ },
128
+ {
129
+ "name": "go.EASING_INEXPO",
130
+ "doc": "in-exponential",
131
+ "type": ""
132
+ },
133
+ {
134
+ "name": "go.EASING_INOUTBACK",
135
+ "doc": "in-out-back",
136
+ "type": ""
137
+ },
138
+ {
139
+ "name": "go.EASING_INOUTBOUNCE",
140
+ "doc": "in-out-bounce",
141
+ "type": ""
142
+ },
143
+ {
144
+ "name": "go.EASING_INOUTCIRC",
145
+ "doc": "in-out-circlic",
146
+ "type": ""
147
+ },
148
+ {
149
+ "name": "go.EASING_INOUTCUBIC",
150
+ "doc": "in-out-cubic",
151
+ "type": ""
152
+ },
153
+ {
154
+ "name": "go.EASING_INOUTELASTIC",
155
+ "doc": "in-out-elastic",
156
+ "type": ""
157
+ },
158
+ {
159
+ "name": "go.EASING_INOUTEXPO",
160
+ "doc": "in-out-exponential",
161
+ "type": ""
162
+ },
163
+ {
164
+ "name": "go.EASING_INOUTQUAD",
165
+ "doc": "in-out-quadratic",
166
+ "type": ""
167
+ },
168
+ {
169
+ "name": "go.EASING_INOUTQUART",
170
+ "doc": "in-out-quartic",
171
+ "type": ""
172
+ },
173
+ {
174
+ "name": "go.EASING_INOUTQUINT",
175
+ "doc": "in-out-quintic",
176
+ "type": ""
177
+ },
178
+ {
179
+ "name": "go.EASING_INOUTSINE",
180
+ "doc": "in-out-sine",
181
+ "type": ""
182
+ },
183
+ {
184
+ "name": "go.EASING_INQUAD",
185
+ "doc": "in-quadratic",
186
+ "type": ""
187
+ },
188
+ {
189
+ "name": "go.EASING_INQUART",
190
+ "doc": "in-quartic",
191
+ "type": ""
192
+ },
193
+ {
194
+ "name": "go.EASING_INQUINT",
195
+ "doc": "in-quintic",
196
+ "type": ""
197
+ },
198
+ {
199
+ "name": "go.EASING_INSINE",
200
+ "doc": "in-sine",
201
+ "type": ""
202
+ },
203
+ {
204
+ "name": "go.EASING_LINEAR",
205
+ "doc": "linear interpolation",
206
+ "type": ""
207
+ },
208
+ {
209
+ "name": "go.EASING_OUTBACK",
210
+ "doc": "out-back",
211
+ "type": ""
212
+ },
213
+ {
214
+ "name": "go.EASING_OUTBOUNCE",
215
+ "doc": "out-bounce",
216
+ "type": ""
217
+ },
218
+ {
219
+ "name": "go.EASING_OUTCIRC",
220
+ "doc": "out-circlic",
221
+ "type": ""
222
+ },
223
+ {
224
+ "name": "go.EASING_OUTCUBIC",
225
+ "doc": "out-cubic",
226
+ "type": ""
227
+ },
228
+ {
229
+ "name": "go.EASING_OUTELASTIC",
230
+ "doc": "out-elastic",
231
+ "type": ""
232
+ },
233
+ {
234
+ "name": "go.EASING_OUTEXPO",
235
+ "doc": "out-exponential",
236
+ "type": ""
237
+ },
238
+ {
239
+ "name": "go.EASING_OUTINBACK",
240
+ "doc": "out-in-back",
241
+ "type": ""
242
+ },
243
+ {
244
+ "name": "go.EASING_OUTINBOUNCE",
245
+ "doc": "out-in-bounce",
246
+ "type": ""
247
+ },
248
+ {
249
+ "name": "go.EASING_OUTINCIRC",
250
+ "doc": "out-in-circlic",
251
+ "type": ""
252
+ },
253
+ {
254
+ "name": "go.EASING_OUTINCUBIC",
255
+ "doc": "out-in-cubic",
256
+ "type": ""
257
+ },
258
+ {
259
+ "name": "go.EASING_OUTINELASTIC",
260
+ "doc": "out-in-elastic",
261
+ "type": ""
262
+ },
263
+ {
264
+ "name": "go.EASING_OUTINEXPO",
265
+ "doc": "out-in-exponential",
266
+ "type": ""
267
+ },
268
+ {
269
+ "name": "go.EASING_OUTINQUAD",
270
+ "doc": "out-in-quadratic",
271
+ "type": ""
272
+ },
273
+ {
274
+ "name": "go.EASING_OUTINQUART",
275
+ "doc": "out-in-quartic",
276
+ "type": ""
277
+ },
278
+ {
279
+ "name": "go.EASING_OUTINQUINT",
280
+ "doc": "out-in-quintic",
281
+ "type": ""
282
+ },
283
+ {
284
+ "name": "go.EASING_OUTINSINE",
285
+ "doc": "out-in-sine",
286
+ "type": ""
287
+ },
288
+ {
289
+ "name": "go.EASING_OUTQUAD",
290
+ "doc": "out-quadratic",
291
+ "type": ""
292
+ },
293
+ {
294
+ "name": "go.EASING_OUTQUART",
295
+ "doc": "out-quartic",
296
+ "type": ""
297
+ },
298
+ {
299
+ "name": "go.EASING_OUTQUINT",
300
+ "doc": "out-quintic",
301
+ "type": ""
302
+ },
303
+ {
304
+ "name": "go.EASING_OUTSINE",
305
+ "doc": "out-sine",
306
+ "type": ""
307
+ }
308
+ ],
309
+ "notes": [],
310
+ "language": ""
311
+ },
312
+ {
313
+ "type": "ENUM",
314
+ "name": "go.PLAYBACK",
315
+ "brief": "Playback modes",
316
+ "description": "Playback modes",
317
+ "returnvalues": [],
318
+ "parameters": [],
319
+ "examples": "",
320
+ "replaces": "",
321
+ "error": "",
322
+ "tparams": [],
323
+ "members": [
324
+ {
325
+ "name": "go.PLAYBACK_LOOP_BACKWARD",
326
+ "doc": "loop backward",
327
+ "type": ""
328
+ },
329
+ {
330
+ "name": "go.PLAYBACK_LOOP_FORWARD",
331
+ "doc": "loop forward",
332
+ "type": ""
333
+ },
334
+ {
335
+ "name": "go.PLAYBACK_LOOP_PINGPONG",
336
+ "doc": "ping pong loop",
337
+ "type": ""
338
+ },
339
+ {
340
+ "name": "go.PLAYBACK_NONE",
341
+ "doc": "no playback",
342
+ "type": ""
343
+ },
344
+ {
345
+ "name": "go.PLAYBACK_ONCE_BACKWARD",
346
+ "doc": "once backward",
347
+ "type": ""
348
+ },
349
+ {
350
+ "name": "go.PLAYBACK_ONCE_FORWARD",
351
+ "doc": "once forward",
352
+ "type": ""
353
+ },
354
+ {
355
+ "name": "go.PLAYBACK_ONCE_PINGPONG",
356
+ "doc": "once ping pong",
357
+ "type": ""
358
+ }
359
+ ],
360
+ "notes": [],
361
+ "language": ""
362
+ },
363
+ {
364
+ "type": "STRUCT",
365
+ "name": "go.property_options",
366
+ "brief": "Property access options",
367
+ "description": "Options for accessing indexed or internal component properties with <a href=\"/ref/go#go.get\">go.get</a> and <a href=\"/ref/go#go.set\">go.set</a>.",
368
+ "returnvalues": [],
369
+ "parameters": [],
370
+ "examples": "",
371
+ "replaces": "",
372
+ "error": "",
373
+ "tparams": [],
374
+ "members": [
375
+ {
376
+ "name": "index?",
377
+ "doc": "Index into an array property, starting at one.",
378
+ "type": "integer"
379
+ },
380
+ {
381
+ "name": "key?",
382
+ "doc": "Name of an internal property.",
383
+ "type": "hash"
384
+ },
385
+ {
386
+ "name": "keys?",
387
+ "doc": "Internal component resources identified by key, such as particle FX emitters.",
388
+ "type": "hash[]"
389
+ }
390
+ ],
391
+ "notes": [],
392
+ "language": ""
393
+ },
394
+ {
395
+ "type": "STRUCT",
396
+ "name": "on_input.action",
397
+ "brief": "Input action",
398
+ "description": "Data supplied to the global <code>on_input</code> lifecycle function.",
399
+ "returnvalues": [],
400
+ "parameters": [],
401
+ "examples": "",
402
+ "replaces": "",
403
+ "error": "",
404
+ "tparams": [],
405
+ "members": [
406
+ {
407
+ "name": "value?",
408
+ "doc": "Amount of input, usually 1 for buttons or between 0 and 1 for analogue input; absent for pointer movement and text input.",
409
+ "type": "number"
410
+ },
411
+ {
412
+ "name": "pressed?",
413
+ "doc": "Whether the input was pressed this frame; absent for pointer movement and text input.",
414
+ "type": "boolean"
415
+ },
416
+ {
417
+ "name": "released?",
418
+ "doc": "Whether the input was released this frame; absent for pointer movement and text input.",
419
+ "type": "boolean"
420
+ },
421
+ {
422
+ "name": "repeated?",
423
+ "doc": "Whether the input was repeated this frame; absent for pointer movement and text input.",
424
+ "type": "boolean"
425
+ },
426
+ {
427
+ "name": "x?",
428
+ "doc": "Pointer x-coordinate; absent for gamepad, key, and text input.",
429
+ "type": "number"
430
+ },
431
+ {
432
+ "name": "y?",
433
+ "doc": "Pointer y-coordinate; absent for gamepad, key, and text input.",
434
+ "type": "number"
435
+ },
436
+ {
437
+ "name": "screen_x?",
438
+ "doc": "Pointer x-coordinate in screen space; absent for gamepad, key, and text input.",
439
+ "type": "number"
440
+ },
441
+ {
442
+ "name": "screen_y?",
443
+ "doc": "Pointer y-coordinate in screen space; absent for gamepad, key, and text input.",
444
+ "type": "number"
445
+ },
446
+ {
447
+ "name": "dx?",
448
+ "doc": "Change in the pointer x-coordinate; absent for gamepad, key, and text input.",
449
+ "type": "number"
450
+ },
451
+ {
452
+ "name": "dy?",
453
+ "doc": "Change in the pointer y-coordinate; absent for gamepad, key, and text input.",
454
+ "type": "number"
455
+ },
456
+ {
457
+ "name": "screen_dx?",
458
+ "doc": "Change in the pointer x-coordinate in screen space; absent for gamepad, key, and text input.",
459
+ "type": "number"
460
+ },
461
+ {
462
+ "name": "screen_dy?",
463
+ "doc": "Change in the pointer y-coordinate in screen space; absent for gamepad, key, and text input.",
464
+ "type": "number"
465
+ },
466
+ {
467
+ "name": "acc_x?",
468
+ "doc": "Accelerometer x value, when present.",
469
+ "type": "number"
470
+ },
471
+ {
472
+ "name": "acc_y?",
473
+ "doc": "Accelerometer y value, when present.",
474
+ "type": "number"
475
+ },
476
+ {
477
+ "name": "acc_z?",
478
+ "doc": "Accelerometer z value, when present.",
479
+ "type": "number"
480
+ },
481
+ {
482
+ "name": "gamepad?",
483
+ "doc": "Index of the gamepad that provided the input.",
484
+ "type": "integer"
485
+ },
486
+ {
487
+ "name": "userid?",
488
+ "doc": "Id of the user associated with the controller.",
489
+ "type": "integer"
490
+ },
491
+ {
492
+ "name": "gamepad_guid?",
493
+ "doc": "SDL-compatible guid, supplied with a gamepad-connected action.",
494
+ "type": "string"
495
+ },
496
+ {
497
+ "name": "gamepad_guid_info?",
498
+ "doc": "Parsed guid information, supplied with a gamepad-connected action.",
499
+ "type": "on_input.gamepad_guid_info"
500
+ },
501
+ {
502
+ "name": "gamepad_unknown?",
503
+ "doc": "Whether the input originated from an unknown or unmapped gamepad.",
504
+ "type": "boolean"
505
+ },
506
+ {
507
+ "name": "gamepad_name?",
508
+ "doc": "Name of a connected gamepad.",
509
+ "type": "string"
510
+ },
511
+ {
512
+ "name": "gamepad_axis?",
513
+ "doc": "Axis values, supplied only for raw gamepad input.",
514
+ "type": "number[]"
515
+ },
516
+ {
517
+ "name": "gamepad_hats?",
518
+ "doc": "Hat values, supplied only for raw gamepad input.",
519
+ "type": "number[]"
520
+ },
521
+ {
522
+ "name": "gamepad_buttons?",
523
+ "doc": "Button values, supplied only for raw gamepad input.",
524
+ "type": "number[]"
525
+ },
526
+ {
527
+ "name": "touch?",
528
+ "doc": "Touch inputs, one entry per finger.",
529
+ "type": "on_input.touch[]"
530
+ },
531
+ {
532
+ "name": "text?",
533
+ "doc": "Text entered by a text action, or the current sequence for marked-text composition such as Japanese Kana.",
534
+ "type": "string"
535
+ }
536
+ ],
537
+ "notes": [],
538
+ "language": ""
539
+ },
540
+ {
541
+ "type": "STRUCT",
542
+ "name": "on_input.touch",
543
+ "brief": "Touch input",
544
+ "description": "One touch entry in <a href=\"/ref/on_input#on_input.action\">on_input.action</a>.",
545
+ "returnvalues": [],
546
+ "parameters": [],
547
+ "examples": "",
548
+ "replaces": "",
549
+ "error": "",
550
+ "tparams": [],
551
+ "members": [
552
+ {
553
+ "name": "id",
554
+ "doc": "Identifier for the touch during its lifetime.",
555
+ "type": "integer"
556
+ },
557
+ {
558
+ "name": "pressed",
559
+ "doc": "Whether the finger was pressed this frame.",
560
+ "type": "boolean"
561
+ },
562
+ {
563
+ "name": "released",
564
+ "doc": "Whether the finger was released this frame.",
565
+ "type": "boolean"
566
+ },
567
+ {
568
+ "name": "tap_count",
569
+ "doc": "Number of taps, such as one for a single tap and two for a double tap.",
570
+ "type": "integer"
571
+ },
572
+ {
573
+ "name": "x",
574
+ "doc": "Touch x-coordinate.",
575
+ "type": "number"
576
+ },
577
+ {
578
+ "name": "y",
579
+ "doc": "Touch y-coordinate.",
580
+ "type": "number"
581
+ },
582
+ {
583
+ "name": "screen_x",
584
+ "doc": "Touch x-coordinate in screen space.",
585
+ "type": "number"
586
+ },
587
+ {
588
+ "name": "screen_y",
589
+ "doc": "Touch y-coordinate in screen space.",
590
+ "type": "number"
591
+ },
592
+ {
593
+ "name": "dx",
594
+ "doc": "Change in the touch x-coordinate.",
595
+ "type": "number"
596
+ },
597
+ {
598
+ "name": "dy",
599
+ "doc": "Change in the touch y-coordinate.",
600
+ "type": "number"
601
+ },
602
+ {
603
+ "name": "screen_dx",
604
+ "doc": "Change in the touch x-coordinate in screen space.",
605
+ "type": "number"
606
+ },
607
+ {
608
+ "name": "screen_dy",
609
+ "doc": "Change in the touch y-coordinate in screen space.",
610
+ "type": "number"
611
+ }
612
+ ],
613
+ "notes": [],
614
+ "language": ""
615
+ },
616
+ {
617
+ "type": "STRUCT",
618
+ "name": "on_input.gamepad_guid_info",
619
+ "brief": "Gamepad guid information",
620
+ "description": "Parsed fields from a connected gamepad guid.",
621
+ "returnvalues": [],
622
+ "parameters": [],
623
+ "examples": "",
624
+ "replaces": "",
625
+ "error": "",
626
+ "tparams": [],
627
+ "members": [
628
+ {
629
+ "name": "vendor",
630
+ "doc": "USB vendor id.",
631
+ "type": "integer"
632
+ },
633
+ {
634
+ "name": "product",
635
+ "doc": "USB product id.",
636
+ "type": "integer"
637
+ },
638
+ {
639
+ "name": "bus",
640
+ "doc": "Bus used to communicate with the device.",
641
+ "type": "integer"
642
+ },
643
+ {
644
+ "name": "crc",
645
+ "doc": "SDL CRC16 signature.",
646
+ "type": "integer"
647
+ },
648
+ {
649
+ "name": "version",
650
+ "doc": "Device or firmware version.",
651
+ "type": "integer"
652
+ }
653
+ ],
654
+ "notes": [],
655
+ "language": ""
656
+ },
657
+ {
658
+ "type": "PROPERTY",
659
+ "name": "position",
660
+ "brief": "<span class=\"type\">vector3</span> game object position",
661
+ "description": "The position of the game object.\nThe type of the property is vector3.",
662
+ "returnvalues": [],
663
+ "parameters": [],
664
+ "examples": "How to query a game object's position, either as a vector3 or selecting a specific dimension:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- get position from &quot;player&quot;</span>\n <span class=\"kd\">local</span> <span class=\"n\">pos</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"s2\">&quot;player&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;position&quot;</span><span class=\"p\">)</span>\n <span class=\"kd\">local</span> <span class=\"n\">posx</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"s2\">&quot;player&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;position.x&quot;</span><span class=\"p\">)</span>\n <span class=\"c1\">-- do something useful</span>\n <span class=\"nb\">assert</span><span class=\"p\">(</span><span class=\"n\">pos</span><span class=\"p\">.</span><span class=\"n\">x</span> <span class=\"o\">==</span> <span class=\"n\">posx</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
665
+ "replaces": "",
666
+ "error": "",
667
+ "tparams": [],
668
+ "members": [],
669
+ "notes": [],
670
+ "language": ""
671
+ },
672
+ {
673
+ "type": "PROPERTY",
674
+ "name": "rotation",
675
+ "brief": "<span class=\"type\">quaternion</span> game object rotation",
676
+ "description": "The rotation of the game object.\nThe type of the property is quaternion.",
677
+ "returnvalues": [],
678
+ "parameters": [],
679
+ "examples": "How to set a game object's rotation:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- set &quot;player&quot; rotation to 45 degrees around z.</span>\n <span class=\"kd\">local</span> <span class=\"n\">rotz</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">quat_rotation_z</span><span class=\"p\">(</span><span class=\"mf\">3.141592</span> <span class=\"o\">/</span> <span class=\"mi\">4</span><span class=\"p\">)</span>\n <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"s2\">&quot;player&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;rotation&quot;</span><span class=\"p\">,</span> <span class=\"n\">rotz</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
680
+ "replaces": "",
681
+ "error": "",
682
+ "tparams": [],
683
+ "members": [],
684
+ "notes": [],
685
+ "language": ""
686
+ },
687
+ {
688
+ "type": "PROPERTY",
689
+ "name": "euler",
690
+ "brief": "<span class=\"type\">vector3</span> game object euler rotation",
691
+ "description": "The rotation of the game object expressed in Euler angles.\nEuler angles are specified in degrees in the interval (-360, 360).\nThe type of the property is vector3.",
692
+ "returnvalues": [],
693
+ "parameters": [],
694
+ "examples": "How to set a game object's rotation with euler angles, either as a vector3 or selecting a specific dimension:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- set &quot;player&quot; euler z rotation component to 45 degrees around z.</span>\n <span class=\"kd\">local</span> <span class=\"n\">rotz</span> <span class=\"o\">=</span> <span class=\"mi\">45</span>\n <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"s2\">&quot;player&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;euler.z&quot;</span><span class=\"p\">,</span> <span class=\"n\">rotz</span><span class=\"p\">)</span>\n <span class=\"kd\">local</span> <span class=\"n\">rot</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"s2\">&quot;player&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;euler&quot;</span><span class=\"p\">)</span>\n <span class=\"c1\">-- do something useful</span>\n <span class=\"nb\">assert</span><span class=\"p\">(</span><span class=\"n\">rot</span><span class=\"p\">.</span><span class=\"n\">z</span> <span class=\"o\">==</span> <span class=\"n\">rotz</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
695
+ "replaces": "",
696
+ "error": "",
697
+ "tparams": [],
698
+ "members": [],
699
+ "notes": [],
700
+ "language": ""
701
+ },
702
+ {
703
+ "type": "PROPERTY",
704
+ "name": "scale",
705
+ "brief": "<span class=\"type\">number</span> game object scale",
706
+ "description": "The uniform scale of the game object. The type of the property is number.",
707
+ "returnvalues": [],
708
+ "parameters": [],
709
+ "examples": "How to scale a game object:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- Double the scaling on &quot;player&quot;</span>\n <span class=\"kd\">local</span> <span class=\"n\">scale</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"s2\">&quot;player&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;scale&quot;</span><span class=\"p\">)</span>\n <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"s2\">&quot;player&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;scale&quot;</span><span class=\"p\">,</span> <span class=\"n\">scale</span> <span class=\"o\">*</span> <span class=\"mi\">2</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
710
+ "replaces": "",
711
+ "error": "",
712
+ "tparams": [],
713
+ "members": [],
714
+ "notes": [],
715
+ "language": ""
716
+ },
717
+ {
718
+ "type": "FUNCTION",
719
+ "name": "go.get",
720
+ "brief": "gets a named property of the specified game object or component",
721
+ "description": "gets a named property of the specified game object or component",
722
+ "returnvalues": [
723
+ {
724
+ "name": "value",
725
+ "doc": "the value of the specified property",
726
+ "types": [
727
+ "number",
728
+ "boolean",
729
+ "hash",
730
+ "string",
731
+ "url",
732
+ "vector3",
733
+ "vector4",
734
+ "quaternion",
735
+ "resource_data"
736
+ ]
737
+ }
738
+ ],
739
+ "parameters": [
740
+ {
741
+ "name": "url",
742
+ "doc": "url of the game object or component having the property",
743
+ "types": ["string", "hash", "url"],
744
+ "is_optional": "False"
745
+ },
746
+ {
747
+ "name": "property",
748
+ "doc": "id of the property to retrieve",
749
+ "types": ["string", "hash"],
750
+ "is_optional": "False"
751
+ },
752
+ {
753
+ "name": "options",
754
+ "doc": "optional property access options",
755
+ "types": ["go.property_options"],
756
+ "is_optional": "True"
757
+ }
758
+ ],
759
+ "examples": "Get a property \"speed\" from a script \"player\", the property must be declared in the player-script:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">property</span><span class=\"p\">(</span><span class=\"s2\">&quot;speed&quot;</span><span class=\"p\">,</span> <span class=\"mi\">50</span><span class=\"p\">)</span>\n</code></pre></div>\n\nThen in the calling script (assumed to belong to the same game object, but does not have to):\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">speed</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"s2\">&quot;#player&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;speed&quot;</span><span class=\"p\">)</span>\n</code></pre></div>\n\nGet a value in a material property array\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- get the first vector4 in the array: example[0] (the glsl indices are 0-based)</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"n\">url</span><span class=\"p\">,</span> <span class=\"s2\">&quot;example&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">index</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">})</span>\n\n<span class=\"c1\">-- get the last vector4 in the array: example[15] (the glsl indices are 0-based)</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"n\">url</span><span class=\"p\">,</span> <span class=\"s2\">&quot;example&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">index</span><span class=\"o\">=</span><span class=\"mi\">16</span><span class=\"p\">})</span>\n\n<span class=\"c1\">-- get an element of a vector4 in the array: example[0].x (the glsl indices are 0-based)</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"n\">url</span><span class=\"p\">,</span> <span class=\"s2\">&quot;example.x&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">index</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">})</span>\n</code></pre></div>\n\nGetting all values in a material property array as a table\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- get all vector4&#39;s in the constant array</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"n\">url</span><span class=\"p\">,</span> <span class=\"s2\">&quot;example&quot;</span><span class=\"p\">)</span>\n<span class=\"c1\">-- result: { vector4, vector4, ... }</span>\n\n<span class=\"c1\">-- get all elements of the vector4&#39;s from an array</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"n\">url</span><span class=\"p\">,</span> <span class=\"s2\">&quot;example.x&quot;</span><span class=\"p\">)</span>\n<span class=\"c1\">-- result: { number1, number2, ... }</span>\n</code></pre></div>\n\nGet a named property\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- get the resource of a certain gui font</span>\n<span class=\"kd\">local</span> <span class=\"n\">font_hash</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"s2\">&quot;#gui&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;fonts&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">key</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;system_font_BIG&quot;</span><span class=\"p\">})</span>\n</code></pre></div>\n\nGet a property from a sub-component, using the \"keys\" options table\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- Addressing the first level of a component:</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"s2\">&quot;#particlefx&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;material&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">keys</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"s2\">&quot;cone_emitter&quot;</span> <span class=\"p\">}</span> <span class=\"p\">})</span>\n</code></pre></div>\n\nGet a property into a deeper sub-hierarchy (if the component supports it).\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- Note: There is currently no component that supports this, but a custom component could.</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"s2\">&quot;#my_component&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;some_property&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">keys</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"s2\">&quot;root&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;child_node&quot;</span> <span class=\"p\">}</span> <span class=\"p\">})</span>\n</code></pre></div>",
760
+ "replaces": "",
761
+ "error": "",
762
+ "tparams": [],
763
+ "members": [],
764
+ "notes": [],
765
+ "language": ""
766
+ },
767
+ {
768
+ "type": "FUNCTION",
769
+ "name": "go.set",
770
+ "brief": "sets a named property of the specified game object or component, or a material constant",
771
+ "description": "sets a named property of the specified game object or component, or a material constant",
772
+ "returnvalues": [],
773
+ "parameters": [
774
+ {
775
+ "name": "url",
776
+ "doc": "url of the game object or component having the property",
777
+ "types": ["string", "hash", "url"],
778
+ "is_optional": "False"
779
+ },
780
+ {
781
+ "name": "property",
782
+ "doc": "id of the property to set",
783
+ "types": ["string", "hash"],
784
+ "is_optional": "False"
785
+ },
786
+ {
787
+ "name": "value",
788
+ "doc": "the value to set",
789
+ "types": [
790
+ "number",
791
+ "boolean",
792
+ "hash",
793
+ "string",
794
+ "url",
795
+ "vector3",
796
+ "vector4",
797
+ "quaternion",
798
+ "resource_data"
799
+ ],
800
+ "is_optional": "False"
801
+ },
802
+ {
803
+ "name": "options",
804
+ "doc": "optional property access options",
805
+ "types": ["go.property_options"],
806
+ "is_optional": "True"
807
+ }
808
+ ],
809
+ "examples": "Set a property \"speed\" of a script \"player\", the property must be declared in the player-script:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">property</span><span class=\"p\">(</span><span class=\"s2\">&quot;speed&quot;</span><span class=\"p\">,</span> <span class=\"mi\">50</span><span class=\"p\">)</span>\n</code></pre></div>\n\nThen in the calling script (assumed to belong to the same game object, but does not have to):\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"s2\">&quot;#player&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;speed&quot;</span><span class=\"p\">,</span> <span class=\"mi\">100</span><span class=\"p\">)</span>\n</code></pre></div>\n\nSet a vector4 in a material property array\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- set the first vector4 in the array: example[0] = v (the glsl indices are 0-based)</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"n\">url</span><span class=\"p\">,</span> <span class=\"s2\">&quot;example&quot;</span><span class=\"p\">,</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span><span class=\"mi\">1</span><span class=\"p\">,</span><span class=\"mi\">1</span><span class=\"p\">,</span><span class=\"mi\">1</span><span class=\"p\">),</span> <span class=\"p\">{</span><span class=\"n\">index</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">})</span>\n\n<span class=\"c1\">-- set the last vector4 in the array: example[15] = v (the glsl indices are 0-based)</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"n\">url</span><span class=\"p\">,</span> <span class=\"s2\">&quot;example&quot;</span><span class=\"p\">,</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">2</span><span class=\"p\">,</span><span class=\"mi\">2</span><span class=\"p\">,</span><span class=\"mi\">2</span><span class=\"p\">,</span><span class=\"mi\">2</span><span class=\"p\">),</span> <span class=\"p\">{</span><span class=\"n\">index</span><span class=\"o\">=</span><span class=\"mi\">16</span><span class=\"p\">})</span>\n\n<span class=\"c1\">-- set an element of a vector4 in the array: example[0].x = 7 (the glsl indices are 0-based)</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"n\">url</span><span class=\"p\">,</span> <span class=\"s2\">&quot;example.x&quot;</span><span class=\"p\">,</span> <span class=\"mi\">7</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">index</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">})</span>\n</code></pre></div>\n\nSet a material property array by a table of vector4\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- set the first two vector4&#39;s in the array</span>\n<span class=\"c1\">-- if the array has more than two elements in the array they will not be set</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"n\">url</span><span class=\"p\">,</span> <span class=\"s2\">&quot;example&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span><span class=\"mi\">1</span><span class=\"p\">,</span><span class=\"mi\">1</span><span class=\"p\">,</span><span class=\"mi\">1</span><span class=\"p\">),</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">2</span><span class=\"p\">,</span><span class=\"mi\">2</span><span class=\"p\">,</span><span class=\"mi\">2</span><span class=\"p\">,</span><span class=\"mi\">2</span><span class=\"p\">)</span> <span class=\"p\">})</span>\n</code></pre></div>\n\nSet a named property\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">property</span><span class=\"p\">(</span><span class=\"s2\">&quot;big_font&quot;</span><span class=\"p\">,</span> <span class=\"n\">resource</span><span class=\"p\">.</span><span class=\"n\">font</span><span class=\"p\">())</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"s2\">&quot;#gui&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;fonts&quot;</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">big_font</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">key</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;system_font_BIG&quot;</span><span class=\"p\">})</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\nSet a property on a sub-component, using the \"keys\" options table\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">property</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_material&quot;</span><span class=\"p\">,</span> <span class=\"n\">resource</span><span class=\"p\">.</span><span class=\"n\">material</span><span class=\"p\">)</span>\n<span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"s2\">&quot;#particlefx&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;material&quot;</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_material</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">keys</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"s2\">&quot;cone_emitter&quot;</span> <span class=\"p\">}</span> <span class=\"p\">})</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\nSet a property in a deeper sub-hierarchy (if the component supports it).\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- Note: There is currently no component that supports this, but a custom component could.</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"s2\">&quot;#my_component&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;some_property&quot;</span><span class=\"p\">,</span> <span class=\"n\">some_value</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">keys</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"s2\">&quot;root&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;child_node&quot;</span> <span class=\"p\">}</span> <span class=\"p\">})</span>\n</code></pre></div>",
810
+ "replaces": "",
811
+ "error": "",
812
+ "tparams": [],
813
+ "members": [],
814
+ "notes": [],
815
+ "language": ""
816
+ },
817
+ {
818
+ "type": "FUNCTION",
819
+ "name": "go.get_position",
820
+ "brief": "gets the position of a game object instance",
821
+ "description": "The position is relative the parent (if any). Use <a href=\"/ref/go#go.get_world_position\">go.get_world_position</a> to retrieve the global world position.",
822
+ "returnvalues": [
823
+ {
824
+ "name": "position",
825
+ "doc": "instance position",
826
+ "types": ["vector3"]
827
+ }
828
+ ],
829
+ "parameters": [
830
+ {
831
+ "name": "id",
832
+ "doc": "optional id of the game object instance to get the position for, by default the instance of the calling script",
833
+ "types": ["string", "hash", "url"],
834
+ "is_optional": "True"
835
+ }
836
+ ],
837
+ "examples": "Get the position of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">p</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_position</span><span class=\"p\">()</span>\n</code></pre></div>\n\nGet the position of another game object instance \"my_gameobject\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">pos</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_position</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_gameobject&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
838
+ "replaces": "request_transform transform_response",
839
+ "error": "",
840
+ "tparams": [],
841
+ "members": [],
842
+ "notes": [],
843
+ "language": ""
844
+ },
845
+ {
846
+ "type": "FUNCTION",
847
+ "name": "go.get_rotation",
848
+ "brief": "gets the rotation of the game object instance",
849
+ "description": "The rotation is relative to the parent (if any). Use <a href=\"/ref/go#go.get_world_rotation\">go.get_world_rotation</a> to retrieve the global world rotation.",
850
+ "returnvalues": [
851
+ {
852
+ "name": "rotation",
853
+ "doc": "instance rotation",
854
+ "types": ["quaternion"]
855
+ }
856
+ ],
857
+ "parameters": [
858
+ {
859
+ "name": "id",
860
+ "doc": "optional id of the game object instance to get the rotation for, by default the instance of the calling script",
861
+ "types": ["string", "hash", "url"],
862
+ "is_optional": "True"
863
+ }
864
+ ],
865
+ "examples": "Get the rotation of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">r</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_rotation</span><span class=\"p\">()</span>\n</code></pre></div>\n\nGet the rotation of another game object instance with id \"x\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">r</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_rotation</span><span class=\"p\">(</span><span class=\"s2\">&quot;x&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
866
+ "replaces": "",
867
+ "error": "",
868
+ "tparams": [],
869
+ "members": [],
870
+ "notes": [],
871
+ "language": ""
872
+ },
873
+ {
874
+ "type": "FUNCTION",
875
+ "name": "go.get_scale",
876
+ "brief": "gets the 3D scale factor of the game object instance",
877
+ "description": "The scale is relative the parent (if any). Use <a href=\"/ref/go#go.get_world_scale\">go.get_world_scale</a> to retrieve the global world 3D scale factor.",
878
+ "returnvalues": [
879
+ {
880
+ "name": "scale",
881
+ "doc": "instance scale factor",
882
+ "types": ["vector3"]
883
+ }
884
+ ],
885
+ "parameters": [
886
+ {
887
+ "name": "id",
888
+ "doc": "optional id of the game object instance to get the scale for, by default the instance of the calling script",
889
+ "types": ["string", "hash", "url"],
890
+ "is_optional": "True"
891
+ }
892
+ ],
893
+ "examples": "Get the scale of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_scale</span><span class=\"p\">()</span>\n</code></pre></div>\n\nGet the scale of another game object instance with id \"x\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_scale</span><span class=\"p\">(</span><span class=\"s2\">&quot;x&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
894
+ "replaces": "",
895
+ "error": "",
896
+ "tparams": [],
897
+ "members": [],
898
+ "notes": [],
899
+ "language": ""
900
+ },
901
+ {
902
+ "type": "FUNCTION",
903
+ "name": "go.get_scale_uniform",
904
+ "brief": "gets the uniform scale factor of the game object instance",
905
+ "description": "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.",
906
+ "returnvalues": [
907
+ {
908
+ "name": "scale",
909
+ "doc": "uniform instance scale factor",
910
+ "types": ["number"]
911
+ }
912
+ ],
913
+ "parameters": [
914
+ {
915
+ "name": "id",
916
+ "doc": "optional id of the game object instance to get the uniform scale for, by default the instance of the calling script",
917
+ "types": ["string", "hash", "url"],
918
+ "is_optional": "True"
919
+ }
920
+ ],
921
+ "examples": "Get the scale of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_scale_uniform</span><span class=\"p\">()</span>\n</code></pre></div>\n\nGet the uniform scale of another game object instance with id \"x\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_scale_uniform</span><span class=\"p\">(</span><span class=\"s2\">&quot;x&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
922
+ "replaces": "",
923
+ "error": "",
924
+ "tparams": [],
925
+ "members": [],
926
+ "notes": [],
927
+ "language": ""
928
+ },
929
+ {
930
+ "type": "FUNCTION",
931
+ "name": "go.set_position",
932
+ "brief": "sets the position of the game object instance",
933
+ "description": "The position is relative to the parent (if any). The global world position cannot be manually set.",
934
+ "returnvalues": [],
935
+ "parameters": [
936
+ {
937
+ "name": "position",
938
+ "doc": "position to set",
939
+ "types": ["vector3"],
940
+ "is_optional": "False"
941
+ },
942
+ {
943
+ "name": "id",
944
+ "doc": "optional id of the game object instance to set the position for, by default the instance of the calling script",
945
+ "types": ["string", "hash", "url"],
946
+ "is_optional": "True"
947
+ }
948
+ ],
949
+ "examples": "Set the position of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">p</span> <span class=\"o\">=</span> <span class=\"p\">...</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_position</span><span class=\"p\">(</span><span class=\"n\">p</span><span class=\"p\">)</span>\n</code></pre></div>\n\nSet the position of another game object instance with id \"x\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">p</span> <span class=\"o\">=</span> <span class=\"p\">...</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_position</span><span class=\"p\">(</span><span class=\"n\">p</span><span class=\"p\">,</span> <span class=\"s2\">&quot;x&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
950
+ "replaces": "",
951
+ "error": "",
952
+ "tparams": [],
953
+ "members": [],
954
+ "notes": [],
955
+ "language": ""
956
+ },
957
+ {
958
+ "type": "FUNCTION",
959
+ "name": "go.set_rotation",
960
+ "brief": "sets the rotation of the game object instance",
961
+ "description": "The rotation is relative to the parent (if any). The global world rotation cannot be manually set.",
962
+ "returnvalues": [],
963
+ "parameters": [
964
+ {
965
+ "name": "rotation",
966
+ "doc": "rotation to set",
967
+ "types": ["quaternion"],
968
+ "is_optional": "False"
969
+ },
970
+ {
971
+ "name": "id",
972
+ "doc": "optional id of the game object instance to get the rotation for, by default the instance of the calling script",
973
+ "types": ["string", "hash", "url"],
974
+ "is_optional": "True"
975
+ }
976
+ ],
977
+ "examples": "Set the rotation of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">r</span> <span class=\"o\">=</span> <span class=\"p\">...</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_rotation</span><span class=\"p\">(</span><span class=\"n\">r</span><span class=\"p\">)</span>\n</code></pre></div>\n\nSet the rotation of another game object instance with id \"x\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">r</span> <span class=\"o\">=</span> <span class=\"p\">...</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_rotation</span><span class=\"p\">(</span><span class=\"n\">r</span><span class=\"p\">,</span> <span class=\"s2\">&quot;x&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
978
+ "replaces": "",
979
+ "error": "",
980
+ "tparams": [],
981
+ "members": [],
982
+ "notes": [],
983
+ "language": ""
984
+ },
985
+ {
986
+ "type": "FUNCTION",
987
+ "name": "go.set_scale",
988
+ "brief": "sets the scale factor of the game object instance",
989
+ "description": "The scale factor is relative to the parent (if any). The global world scale factor cannot be manually set.\n<span class=\"icon-attention\"></span> See <a href=\"/manuals/project-settings/#allow-dynamic-transforms\">manual</a> to know how physics affected when setting scale from this function.",
990
+ "returnvalues": [],
991
+ "parameters": [
992
+ {
993
+ "name": "scale",
994
+ "doc": "vector or uniform scale factor, must be greater than 0",
995
+ "types": ["number", "vector3"],
996
+ "is_optional": "False"
997
+ },
998
+ {
999
+ "name": "id",
1000
+ "doc": "optional id of the game object instance to get the scale for, by default the instance of the calling script",
1001
+ "types": ["string", "hash", "url"],
1002
+ "is_optional": "True"
1003
+ }
1004
+ ],
1005
+ "examples": "Set the scale of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">(</span><span class=\"mf\">2.0</span><span class=\"p\">,</span> <span class=\"mf\">1.0</span><span class=\"p\">,</span> <span class=\"mf\">1.0</span><span class=\"p\">)</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_scale</span><span class=\"p\">(</span><span class=\"n\">s</span><span class=\"p\">)</span>\n</code></pre></div>\n\nSet the scale of another game object instance with id \"obj_id\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"mf\">1.2</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_scale</span><span class=\"p\">(</span><span class=\"n\">s</span><span class=\"p\">,</span> <span class=\"s2\">&quot;obj_id&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1006
+ "replaces": "",
1007
+ "error": "",
1008
+ "tparams": [],
1009
+ "members": [],
1010
+ "notes": [],
1011
+ "language": ""
1012
+ },
1013
+ {
1014
+ "type": "FUNCTION",
1015
+ "name": "go.set_scale_xy",
1016
+ "brief": "sets the scale factor only for width and height (x and y) of the game object instance",
1017
+ "description": "The scale factor is relative to the parent (if any). The global world scale factor cannot be manually set.\n<span class=\"icon-attention\"></span> See <a href=\"/manuals/project-settings/#allow-dynamic-transforms\">manual</a> to know how physics affected when setting scale from this function.",
1018
+ "returnvalues": [],
1019
+ "parameters": [
1020
+ {
1021
+ "name": "scale",
1022
+ "doc": "vector or uniform scale factor, must be greater than 0",
1023
+ "types": ["number", "vector3"],
1024
+ "is_optional": "False"
1025
+ },
1026
+ {
1027
+ "name": "id",
1028
+ "doc": "optional id of the game object instance to get the scale for, by default the instance of the calling script",
1029
+ "types": ["string", "hash", "url"],
1030
+ "is_optional": "True"
1031
+ }
1032
+ ],
1033
+ "examples": "Set the scale of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">(</span><span class=\"mf\">2.0</span><span class=\"p\">,</span> <span class=\"mf\">1.0</span><span class=\"p\">,</span> <span class=\"mf\">5.0</span><span class=\"p\">)</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_scale_xy</span><span class=\"p\">(</span><span class=\"n\">s</span><span class=\"p\">)</span> <span class=\"c1\">-- z will not be set here, only x and y</span>\n</code></pre></div>\n\nSet the scale of another game object instance with id \"obj_id\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"mf\">1.2</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_scale_xy</span><span class=\"p\">(</span><span class=\"n\">s</span><span class=\"p\">,</span> <span class=\"s2\">&quot;obj_id&quot;</span><span class=\"p\">)</span> <span class=\"c1\">-- z will not be set here, only x and y</span>\n</code></pre></div>",
1034
+ "replaces": "",
1035
+ "error": "",
1036
+ "tparams": [],
1037
+ "members": [],
1038
+ "notes": [],
1039
+ "language": ""
1040
+ },
1041
+ {
1042
+ "type": "FUNCTION",
1043
+ "name": "go.set_parent",
1044
+ "brief": "sets the parent for a specific game object instance",
1045
+ "description": "Sets the parent for a game object instance. This means that the instance will exist in the geometrical space of its parent,\nlike a basic transformation hierarchy or scene graph. If no parent is specified, the instance will be detached from any parent and exist in world\nspace.\nThis function will generate a <code>set_parent</code> message. It is not until the message has been processed that the change actually takes effect. This\ntypically 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\nengine.",
1046
+ "returnvalues": [],
1047
+ "parameters": [
1048
+ {
1049
+ "name": "id",
1050
+ "doc": "optional id of the game object instance to set parent for, defaults to the instance containing the calling script",
1051
+ "types": ["string", "hash", "url"],
1052
+ "is_optional": "True"
1053
+ },
1054
+ {
1055
+ "name": "parent_id",
1056
+ "doc": "optional id of the new parent game object, defaults to detaching game object from its parent",
1057
+ "types": ["string", "hash", "url"],
1058
+ "is_optional": "True"
1059
+ },
1060
+ {
1061
+ "name": "keep_world_transform",
1062
+ "doc": "optional boolean, set to true to maintain the world transform when changing spaces. Defaults to false.",
1063
+ "types": ["boolean"],
1064
+ "is_optional": "True"
1065
+ }
1066
+ ],
1067
+ "examples": "Attach myself to another instance \"my_parent\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_parent</span><span class=\"p\">(</span><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(),</span><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_parent&quot;</span><span class=\"p\">))</span>\n</code></pre></div>\n\nAttach an instance \"my_instance\" to another instance \"my_parent\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_parent</span><span class=\"p\">(</span><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_instance&quot;</span><span class=\"p\">),</span><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_parent&quot;</span><span class=\"p\">))</span>\n</code></pre></div>\n\nDetach an instance \"my_instance\" from its parent (if any):\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_parent</span><span class=\"p\">(</span><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_instance&quot;</span><span class=\"p\">))</span>\n</code></pre></div>",
1068
+ "replaces": "",
1069
+ "error": "",
1070
+ "tparams": [],
1071
+ "members": [],
1072
+ "notes": [],
1073
+ "language": ""
1074
+ },
1075
+ {
1076
+ "type": "FUNCTION",
1077
+ "name": "go.get_parent",
1078
+ "brief": "get the parent for a specific game object instance",
1079
+ "description": "Get the parent for a game object instance.",
1080
+ "returnvalues": [
1081
+ {
1082
+ "name": "parent_id",
1083
+ "doc": "parent instance or <code>nil</code>",
1084
+ "types": ["hash", "nil"]
1085
+ }
1086
+ ],
1087
+ "parameters": [
1088
+ {
1089
+ "name": "id",
1090
+ "doc": "optional id of the game object instance to get parent for, defaults to the instance containing the calling script",
1091
+ "types": ["string", "hash", "url"],
1092
+ "is_optional": "True"
1093
+ }
1094
+ ],
1095
+ "examples": "Get parent of the instance containing the calling script:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">parent_id</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_parent</span><span class=\"p\">()</span>\n</code></pre></div>\n\nGet parent of the instance with id \"x\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">parent_id</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_parent</span><span class=\"p\">(</span><span class=\"s2\">&quot;x&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1096
+ "replaces": "",
1097
+ "error": "",
1098
+ "tparams": [],
1099
+ "members": [],
1100
+ "notes": [],
1101
+ "language": ""
1102
+ },
1103
+ {
1104
+ "type": "FUNCTION",
1105
+ "name": "go.get_world_position",
1106
+ "brief": "gets the game object instance world position",
1107
+ "description": "The function will return the world position calculated at the end of the previous frame.\nTo recalculate it within the current frame, use <a href=\"/ref/go#go.update_world_transform\">go.update_world_transform</a> on the instance before calling this.\nUse <a href=\"/ref/go#go.get_position\">go.get_position</a> to retrieve the position relative to the parent.",
1108
+ "returnvalues": [
1109
+ {
1110
+ "name": "position",
1111
+ "doc": "instance world position",
1112
+ "types": ["vector3"]
1113
+ }
1114
+ ],
1115
+ "parameters": [
1116
+ {
1117
+ "name": "id",
1118
+ "doc": "optional id of the game object instance to get the world position for, by default the instance of the calling script",
1119
+ "types": ["string", "hash", "url"],
1120
+ "is_optional": "True"
1121
+ }
1122
+ ],
1123
+ "examples": "Get the world position of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">p</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_position</span><span class=\"p\">()</span>\n</code></pre></div>\n\nGet the world position of another game object instance with id \"x\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">p</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_position</span><span class=\"p\">(</span><span class=\"s2\">&quot;x&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1124
+ "replaces": "",
1125
+ "error": "",
1126
+ "tparams": [],
1127
+ "members": [],
1128
+ "notes": [],
1129
+ "language": ""
1130
+ },
1131
+ {
1132
+ "type": "FUNCTION",
1133
+ "name": "go.get_world_rotation",
1134
+ "brief": "gets the game object instance world rotation",
1135
+ "description": "The function will return the world rotation calculated at the end of the previous frame.\nTo recalculate it within the current frame, use <a href=\"/ref/go#go.update_world_transform\">go.update_world_transform</a> on the instance before calling this.\nUse <a href=\"/ref/go#go.get_rotation\">go.get_rotation</a> to retrieve the rotation relative to the parent.",
1136
+ "returnvalues": [
1137
+ {
1138
+ "name": "rotation",
1139
+ "doc": "instance world rotation",
1140
+ "types": ["quaternion"]
1141
+ }
1142
+ ],
1143
+ "parameters": [
1144
+ {
1145
+ "name": "id",
1146
+ "doc": "optional id of the game object instance to get the world rotation for, by default the instance of the calling script",
1147
+ "types": ["string", "hash", "url"],
1148
+ "is_optional": "True"
1149
+ }
1150
+ ],
1151
+ "examples": "Get the world rotation of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">r</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_rotation</span><span class=\"p\">()</span>\n</code></pre></div>\n\nGet the world rotation of another game object instance with id \"x\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">r</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_rotation</span><span class=\"p\">(</span><span class=\"s2\">&quot;x&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1152
+ "replaces": "",
1153
+ "error": "",
1154
+ "tparams": [],
1155
+ "members": [],
1156
+ "notes": [],
1157
+ "language": ""
1158
+ },
1159
+ {
1160
+ "type": "FUNCTION",
1161
+ "name": "go.get_world_scale",
1162
+ "brief": "gets the game object instance world 3D scale factor",
1163
+ "description": "The function will return the world 3D scale factor calculated at the end of the previous frame.\nTo recalculate it within the current frame, use <a href=\"/ref/go#go.update_world_transform\">go.update_world_transform</a> on the instance before calling this.\nUse <a href=\"/ref/go#go.get_scale\">go.get_scale</a> to retrieve the 3D scale factor relative to the parent.\nThis vector is derived by decomposing the transformation matrix and should be used with care.\nFor most cases it should be fine to use <a href=\"/ref/go#go.get_world_scale_uniform\">go.get_world_scale_uniform</a> instead.",
1164
+ "returnvalues": [
1165
+ {
1166
+ "name": "scale",
1167
+ "doc": "instance world 3D scale factor",
1168
+ "types": ["vector3"]
1169
+ }
1170
+ ],
1171
+ "parameters": [
1172
+ {
1173
+ "name": "id",
1174
+ "doc": "optional id of the game object instance to get the world scale for, by default the instance of the calling script",
1175
+ "types": ["string", "hash", "url"],
1176
+ "is_optional": "True"
1177
+ }
1178
+ ],
1179
+ "examples": "Get the world 3D scale of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_scale</span><span class=\"p\">()</span>\n</code></pre></div>\n\nGet the world scale of another game object instance \"x\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_scale</span><span class=\"p\">(</span><span class=\"s2\">&quot;x&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1180
+ "replaces": "",
1181
+ "error": "",
1182
+ "tparams": [],
1183
+ "members": [],
1184
+ "notes": [],
1185
+ "language": ""
1186
+ },
1187
+ {
1188
+ "type": "FUNCTION",
1189
+ "name": "go.get_world_scale_uniform",
1190
+ "brief": "gets the uniform game object instance world scale factor",
1191
+ "description": "The function will return the world scale factor calculated at the end of the previous frame.\nTo recalculate it within the current frame, use <a href=\"/ref/go#go.update_world_transform\">go.update_world_transform</a> on the instance before calling this.\nUse <a href=\"/ref/go#go.get_scale_uniform\">go.get_scale_uniform</a> to retrieve the scale factor relative to the parent.",
1192
+ "returnvalues": [
1193
+ {
1194
+ "name": "scale",
1195
+ "doc": "instance world scale factor",
1196
+ "types": ["number"]
1197
+ }
1198
+ ],
1199
+ "parameters": [
1200
+ {
1201
+ "name": "id",
1202
+ "doc": "optional id of the game object instance to get the world scale for, by default the instance of the calling script",
1203
+ "types": ["string", "hash", "url"],
1204
+ "is_optional": "True"
1205
+ }
1206
+ ],
1207
+ "examples": "Get the world scale of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_scale_uniform</span><span class=\"p\">()</span>\n</code></pre></div>\n\nGet the world scale of another game object instance with id \"x\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_scale_uniform</span><span class=\"p\">(</span><span class=\"s2\">&quot;x&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1208
+ "replaces": "",
1209
+ "error": "",
1210
+ "tparams": [],
1211
+ "members": [],
1212
+ "notes": [],
1213
+ "language": ""
1214
+ },
1215
+ {
1216
+ "type": "FUNCTION",
1217
+ "name": "go.get_world_transform",
1218
+ "brief": "gets the game object instance world transform matrix",
1219
+ "description": "The function will return the world transform matrix calculated at the end of the previous frame.\nTo recalculate it within the current frame, use <a href=\"/ref/go#go.update_world_transform\">go.update_world_transform</a> on the instance before calling this.",
1220
+ "returnvalues": [
1221
+ {
1222
+ "name": "transform",
1223
+ "doc": "instance world transform",
1224
+ "types": ["matrix4"]
1225
+ }
1226
+ ],
1227
+ "parameters": [
1228
+ {
1229
+ "name": "id",
1230
+ "doc": "optional id of the game object instance to get the world transform for, by default the instance of the calling script",
1231
+ "types": ["string", "hash", "url"],
1232
+ "is_optional": "True"
1233
+ }
1234
+ ],
1235
+ "examples": "Get the world transform of the game object instance the script is attached to:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">m</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_transform</span><span class=\"p\">()</span>\n</code></pre></div>\n\nGet the world transform of another game object instance with id \"x\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">m</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_transform</span><span class=\"p\">(</span><span class=\"s2\">&quot;x&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1236
+ "replaces": "",
1237
+ "error": "",
1238
+ "tparams": [],
1239
+ "members": [],
1240
+ "notes": [],
1241
+ "language": ""
1242
+ },
1243
+ {
1244
+ "type": "FUNCTION",
1245
+ "name": "go.update_world_transform",
1246
+ "brief": "updates the world transform for a game object instance",
1247
+ "description": "Recalculates and updates the cached world transform immediately for the target instance\nand its ancestors (parent chain up to the collection root). Descendants (children) are\nnot updated by this function.\nIf no id is provided, the instance of the calling script is used.\n<span class=\"icon-attention\"></span> Use this after changing local transform mid-frame when you need the\nnew world transform right away (e.g. before end-of-frame updates). Note that child\ninstances will still have last-frame world transforms until the regular update.",
1248
+ "returnvalues": [],
1249
+ "parameters": [
1250
+ {
1251
+ "name": "id",
1252
+ "doc": "optional id of the game object instance to update",
1253
+ "types": ["string", "hash", "url"],
1254
+ "is_optional": "True"
1255
+ }
1256
+ ],
1257
+ "examples": "Update this game object's world transform:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">update_world_transform</span><span class=\"p\">()</span>\n</code></pre></div>\n\nUpdate another game object's world transform:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">update_world_transform</span><span class=\"p\">(</span><span class=\"s2\">&quot;/other&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1258
+ "replaces": "",
1259
+ "error": "",
1260
+ "tparams": [],
1261
+ "members": [],
1262
+ "notes": [],
1263
+ "language": ""
1264
+ },
1265
+ {
1266
+ "type": "FUNCTION",
1267
+ "name": "go.get_id",
1268
+ "brief": "gets the id of an instance",
1269
+ "description": "Returns or constructs an instance identifier. The instance id is a hash\nof the absolute path to the instance.\n<ul>\n<li>If <code>path</code> is specified, it can either be absolute or relative to the instance of the calling script.</li>\n<li>If <code>path</code> is not specified, the id of the game object instance the script is attached to will be returned.</li>\n</ul>",
1270
+ "returnvalues": [
1271
+ {
1272
+ "name": "id",
1273
+ "doc": "instance id",
1274
+ "types": ["hash"]
1275
+ }
1276
+ ],
1277
+ "parameters": [
1278
+ {
1279
+ "name": "path",
1280
+ "doc": "path of the instance for which to return the id",
1281
+ "types": ["string"],
1282
+ "is_optional": "True"
1283
+ }
1284
+ ],
1285
+ "examples": "For the instance with path <code>/my_sub_collection/my_instance</code>, the following calls are equivalent:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">id</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">()</span> <span class=\"c1\">-- no path, defaults to the instance containing the calling script</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">id</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; hash: [/my_sub_collection/my_instance]</span>\n\n<span class=\"kd\">local</span> <span class=\"n\">id</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(</span><span class=\"s2\">&quot;/my_sub_collection/my_instance&quot;</span><span class=\"p\">)</span> <span class=\"c1\">-- absolute path</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">id</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; hash: [/my_sub_collection/my_instance]</span>\n\n<span class=\"kd\">local</span> <span class=\"n\">id</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_instance&quot;</span><span class=\"p\">)</span> <span class=\"c1\">-- relative path</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">id</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; hash: [/my_sub_collection/my_instance]</span>\n</code></pre></div>",
1286
+ "replaces": "",
1287
+ "error": "",
1288
+ "tparams": [],
1289
+ "members": [],
1290
+ "notes": [],
1291
+ "language": ""
1292
+ },
1293
+ {
1294
+ "type": "FUNCTION",
1295
+ "name": "go.animate",
1296
+ "brief": "animates a named property of the specified game object or component",
1297
+ "description": "This is only supported for numerical properties. If the node property is already being\nanimated, that animation will be canceled and replaced by the new one.\nIf a <code>complete_function</code> (lua function) is specified, that function will be called when the animation has completed.\nBy starting a new animation in that function, several animations can be sequenced together. See the examples for more information.\n<span class=\"icon-attention\"></span> If you call <code>go.animate()</code> from a game object's <code>final()</code> function,\nany passed <code>complete_function</code> will be ignored and never called upon animation completion.\nSee the <a href=\"/manuals/properties\">properties guide</a> for which properties can be animated and the <a href=\"/manuals/animation\">animation guide</a> for how\nthem.",
1298
+ "returnvalues": [],
1299
+ "parameters": [
1300
+ {
1301
+ "name": "url",
1302
+ "doc": "url of the game object or component having the property",
1303
+ "types": ["string", "hash", "url"],
1304
+ "is_optional": "False"
1305
+ },
1306
+ {
1307
+ "name": "property",
1308
+ "doc": "id of the property to animate",
1309
+ "types": ["string", "hash"],
1310
+ "is_optional": "False"
1311
+ },
1312
+ {
1313
+ "name": "playback",
1314
+ "doc": "playback mode of the animation\n<ul>\n<li><code>go.PLAYBACK_ONCE_FORWARD</code></li>\n<li><code>go.PLAYBACK_ONCE_BACKWARD</code></li>\n<li><code>go.PLAYBACK_ONCE_PINGPONG</code></li>\n<li><code>go.PLAYBACK_LOOP_FORWARD</code></li>\n<li><code>go.PLAYBACK_LOOP_BACKWARD</code></li>\n<li><code>go.PLAYBACK_LOOP_PINGPONG</code></li>\n</ul>",
1315
+ "types": ["go.PLAYBACK"],
1316
+ "is_optional": "False"
1317
+ },
1318
+ {
1319
+ "name": "to",
1320
+ "doc": "target property value",
1321
+ "types": ["number", "vector3", "vector4", "quaternion"],
1322
+ "is_optional": "False"
1323
+ },
1324
+ {
1325
+ "name": "easing",
1326
+ "doc": "easing to use during animation. Either specify a constant, see the <a href=\"/manuals/animation#_easing\">animation guide</a> for a complete list, or a vmath.vector with a curve",
1327
+ "types": ["vector", "go.EASING"],
1328
+ "is_optional": "False"
1329
+ },
1330
+ {
1331
+ "name": "duration",
1332
+ "doc": "duration of the animation in seconds",
1333
+ "types": ["number"],
1334
+ "is_optional": "False"
1335
+ },
1336
+ {
1337
+ "name": "delay",
1338
+ "doc": "delay before the animation starts in seconds",
1339
+ "types": ["number"],
1340
+ "is_optional": "True"
1341
+ },
1342
+ {
1343
+ "name": "complete_function",
1344
+ "doc": "optional function to call when the animation has completed\n<dl>\n<dt><code>self</code></dt>\n<dd>\n<span class=\"type\">script_instance</span> The current script instance.\n</dd>\n<dt><code>url</code></dt>\n<dd>\n<span class=\"type\">url</span> The game object or component instance for which the property is animated.\n</dd>\n<dt><code>property</code></dt>\n<dd>\n<span class=\"type\">hash</span> The id of the animated property.\n</dd>\n</dl>",
1345
+ "types": ["fun(self:script_instance, url:url, property:hash)"],
1346
+ "is_optional": "True"
1347
+ }
1348
+ ],
1349
+ "examples": "Animate the position of a game object to x = 10 during 1 second, then y = 20 during 1 second:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"kr\">function</span> <span class=\"nf\">x_done</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">url</span><span class=\"p\">,</span> <span class=\"n\">property</span><span class=\"p\">)</span>\n <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">animate</span><span class=\"p\">(</span><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(),</span> <span class=\"s2\">&quot;position.y&quot;</span><span class=\"p\">,</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">PLAYBACK_ONCE_FORWARD</span><span class=\"p\">,</span> <span class=\"mi\">20</span><span class=\"p\">,</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">EASING_LINEAR</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">animate</span><span class=\"p\">(</span><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(),</span> <span class=\"s2\">&quot;position.x&quot;</span><span class=\"p\">,</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">PLAYBACK_ONCE_FORWARD</span><span class=\"p\">,</span> <span class=\"mi\">10</span><span class=\"p\">,</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">EASING_LINEAR</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">x_done</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\nAnimate the y position of a game object using a crazy custom easing curve:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">values</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span>\n <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span>\n <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span>\n <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span>\n <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span>\n <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span>\n <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span>\n <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span> <span class=\"p\">}</span>\n<span class=\"kd\">local</span> <span class=\"n\">vec</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector</span><span class=\"p\">(</span><span class=\"n\">values</span><span class=\"p\">)</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">animate</span><span class=\"p\">(</span><span class=\"s2\">&quot;go&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;position.y&quot;</span><span class=\"p\">,</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">PLAYBACK_LOOP_PINGPONG</span><span class=\"p\">,</span> <span class=\"mi\">100</span><span class=\"p\">,</span> <span class=\"n\">vec</span><span class=\"p\">,</span> <span class=\"mf\">2.0</span><span class=\"p\">)</span>\n</code></pre></div>",
1350
+ "replaces": "",
1351
+ "error": "",
1352
+ "tparams": [],
1353
+ "members": [],
1354
+ "notes": [],
1355
+ "language": ""
1356
+ },
1357
+ {
1358
+ "type": "FUNCTION",
1359
+ "name": "go.cancel_animations",
1360
+ "brief": "cancels all or specified property animations of the game object or component",
1361
+ "description": "By calling this function, all or specified stored property animations of the game object or component will be canceled.\nSee the <a href=\"/manuals/properties\">properties guide</a> for which properties can be animated and the <a href=\"/manuals/animation\">animation guide</a> for how to animate them.",
1362
+ "returnvalues": [],
1363
+ "parameters": [
1364
+ {
1365
+ "name": "url",
1366
+ "doc": "url of the game object or component",
1367
+ "types": ["string", "hash", "url"],
1368
+ "is_optional": "False"
1369
+ },
1370
+ {
1371
+ "name": "property",
1372
+ "doc": "optional id of the property to cancel",
1373
+ "types": ["string", "hash"],
1374
+ "is_optional": "True"
1375
+ }
1376
+ ],
1377
+ "examples": "Cancel the animation of the position of a game object:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">cancel_animations</span><span class=\"p\">(</span><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(),</span> <span class=\"s2\">&quot;position&quot;</span><span class=\"p\">)</span>\n</code></pre></div>\n\nCancel all property animations of the current game object:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">cancel_animations</span><span class=\"p\">(</span><span class=\"s2\">&quot;.&quot;</span><span class=\"p\">)</span>\n</code></pre></div>\n\nCancel all property animations of the sprite component of the current game object:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">cancel_animations</span><span class=\"p\">(</span><span class=\"s2\">&quot;#sprite&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1378
+ "replaces": "",
1379
+ "error": "",
1380
+ "tparams": [],
1381
+ "members": [],
1382
+ "notes": [],
1383
+ "language": ""
1384
+ },
1385
+ {
1386
+ "type": "FUNCTION",
1387
+ "name": "go.delete",
1388
+ "brief": "delete one or more game object instances",
1389
+ "description": "Delete one or more game objects identified by id. Deletion is asynchronous meaning that\nthe game object(s) are scheduled for deletion which will happen at the end of the current\nframe. Note that game objects scheduled for deletion will be counted against\n<code>max_instances</code> in \"game.project\" until they are actually removed.\n<span class=\"icon-attention\"></span> 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 <code>particlefx.stop()</code>.\n<span class=\"icon-attention\"></span> 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 <code>sound.stop()</code>.",
1390
+ "returnvalues": [],
1391
+ "parameters": [
1392
+ {
1393
+ "name": "id",
1394
+ "doc": "optional id or table of id's of the instance(s) to delete, the instance of the calling script is deleted by default",
1395
+ "types": ["string", "hash", "url", "(string|hash|url)[]"],
1396
+ "is_optional": "True"
1397
+ },
1398
+ {
1399
+ "name": "recursive",
1400
+ "doc": "optional boolean, set to true to recursively delete child hiearchy in child to parent order",
1401
+ "types": ["boolean"],
1402
+ "is_optional": "True"
1403
+ }
1404
+ ],
1405
+ "examples": "This example demonstrates how to delete game objects\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- Delete the script game object</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">delete</span><span class=\"p\">()</span>\n<span class=\"c1\">-- Delete a game object with the id &quot;my_game_object&quot;.</span>\n<span class=\"kd\">local</span> <span class=\"n\">id</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_game_object&quot;</span><span class=\"p\">)</span> <span class=\"c1\">-- retrieve the id of the game object to be deleted</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">delete</span><span class=\"p\">(</span><span class=\"n\">id</span><span class=\"p\">)</span>\n<span class=\"c1\">-- Delete a list of game objects.</span>\n<span class=\"kd\">local</span> <span class=\"n\">ids</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;/my_object_1&quot;</span><span class=\"p\">),</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;/my_object_2&quot;</span><span class=\"p\">),</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;/my_object_3&quot;</span><span class=\"p\">)</span> <span class=\"p\">}</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">delete</span><span class=\"p\">(</span><span class=\"n\">ids</span><span class=\"p\">)</span>\n</code></pre></div>\n\nThis example demonstrates how to delete a game objects and their children (child to parent order)\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- Delete the script game object and it&#39;s children</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">delete</span><span class=\"p\">(</span><span class=\"kc\">true</span><span class=\"p\">)</span>\n<span class=\"c1\">-- Delete a game object with the id &quot;my_game_object&quot; and it&#39;s children.</span>\n<span class=\"kd\">local</span> <span class=\"n\">id</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_game_object&quot;</span><span class=\"p\">)</span> <span class=\"c1\">-- retrieve the id of the game object to be deleted</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">delete</span><span class=\"p\">(</span><span class=\"n\">id</span><span class=\"p\">,</span> <span class=\"kc\">true</span><span class=\"p\">)</span>\n<span class=\"c1\">-- Delete a list of game objects and their children.</span>\n<span class=\"kd\">local</span> <span class=\"n\">ids</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;/my_object_1&quot;</span><span class=\"p\">),</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;/my_object_2&quot;</span><span class=\"p\">),</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;/my_object_3&quot;</span><span class=\"p\">)</span> <span class=\"p\">}</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">delete</span><span class=\"p\">(</span><span class=\"n\">ids</span><span class=\"p\">,</span> <span class=\"kc\">true</span><span class=\"p\">)</span>\n</code></pre></div>",
1406
+ "replaces": "",
1407
+ "error": "",
1408
+ "tparams": [],
1409
+ "members": [],
1410
+ "notes": [],
1411
+ "language": ""
1412
+ },
1413
+ {
1414
+ "type": "FUNCTION",
1415
+ "name": "go.property",
1416
+ "brief": "define a property for the script",
1417
+ "description": "This function defines a property which can then be used in the script through the self-reference.\nThe properties defined this way are automatically exposed in the editor in game objects and collections which use the script.\nNote that you can only use this function outside any callback-functions like init and update.",
1418
+ "returnvalues": [],
1419
+ "parameters": [
1420
+ {
1421
+ "name": "name",
1422
+ "doc": "the id of the property",
1423
+ "types": ["string"],
1424
+ "is_optional": "False"
1425
+ },
1426
+ {
1427
+ "name": "value",
1428
+ "doc": "default value of the property. In the case of a url, only the empty constructor msg.url() is allowed. In the case of a resource one of the resource constructors (eg resource.atlas(), resource.font() etc) is expected.",
1429
+ "types": [
1430
+ "number",
1431
+ "hash",
1432
+ "string",
1433
+ "url",
1434
+ "vector3",
1435
+ "vector4",
1436
+ "quaternion",
1437
+ "resource_data",
1438
+ "boolean"
1439
+ ],
1440
+ "is_optional": "False"
1441
+ }
1442
+ ],
1443
+ "examples": "This example demonstrates how to define a property called \"health\" in a script.\nThe health is decreased whenever someone sends a message called \"take_damage\" to the script.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">property</span><span class=\"p\">(</span><span class=\"s2\">&quot;health&quot;</span><span class=\"p\">,</span> <span class=\"mi\">100</span><span class=\"p\">)</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- prints 100 to the output</span>\n <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">health</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">on_message</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">message_id</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">,</span> <span class=\"n\">sender</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">message_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;take_damage&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">health</span> <span class=\"o\">=</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">health</span> <span class=\"o\">-</span> <span class=\"n\">message</span><span class=\"p\">.</span><span class=\"n\">damage</span>\n <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;Ouch! My health is now: &quot;</span> <span class=\"o\">..</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">health</span><span class=\"p\">)</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\nText properties can contain UTF-8 and newline characters:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">property</span><span class=\"p\">(</span><span class=\"s2\">&quot;player_name&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;Player One&quot;</span><span class=\"p\">)</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">property</span><span class=\"p\">(</span><span class=\"s2\">&quot;dialogue&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;First line</span><span class=\"se\">\\n</span><span class=\"s2\">Second line&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1444
+ "replaces": "",
1445
+ "error": "",
1446
+ "tparams": [],
1447
+ "members": [],
1448
+ "notes": [],
1449
+ "language": ""
1450
+ },
1451
+ {
1452
+ "type": "FUNCTION",
1453
+ "name": "go.exists",
1454
+ "brief": "check if the specified game object exists",
1455
+ "description": "This function can check for game objects in any collection by specifying\nthe collection name in the URL.",
1456
+ "returnvalues": [
1457
+ {
1458
+ "name": "exists",
1459
+ "doc": "true if the game object exists",
1460
+ "types": ["boolean"]
1461
+ }
1462
+ ],
1463
+ "parameters": [
1464
+ {
1465
+ "name": "url",
1466
+ "doc": "url of the game object to check",
1467
+ "types": ["string", "hash", "url"],
1468
+ "is_optional": "False"
1469
+ }
1470
+ ],
1471
+ "examples": "Check if game object \"my_game_object\" exists in the current collection\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">exists</span><span class=\"p\">(</span><span class=\"s2\">&quot;/my_game_object&quot;</span><span class=\"p\">)</span>\n</code></pre></div>\n\nCheck if game object exists in another collection\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">exists</span><span class=\"p\">(</span><span class=\"s2\">&quot;other_collection:/my_game_object&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1472
+ "replaces": "",
1473
+ "error": "",
1474
+ "tparams": [],
1475
+ "members": [],
1476
+ "notes": [],
1477
+ "language": ""
1478
+ },
1479
+ {
1480
+ "type": "FUNCTION",
1481
+ "name": "go.world_to_local_position",
1482
+ "brief": "convert position to game object's coordinate space",
1483
+ "description": "<span class=\"icon-attention\"></span> The function uses world transformation calculated at the end of previous frame.",
1484
+ "returnvalues": [
1485
+ {
1486
+ "name": "converted_postion",
1487
+ "doc": "converted position",
1488
+ "types": ["vector3"]
1489
+ }
1490
+ ],
1491
+ "parameters": [
1492
+ {
1493
+ "name": "position",
1494
+ "doc": "position which need to be converted",
1495
+ "types": ["vector3"],
1496
+ "is_optional": "False"
1497
+ },
1498
+ {
1499
+ "name": "url",
1500
+ "doc": "url of the game object which coordinate system convert to",
1501
+ "types": ["string", "hash", "url"],
1502
+ "is_optional": "False"
1503
+ }
1504
+ ],
1505
+ "examples": "Convert position of \"test\" game object into coordinate space of \"child\" object.\n<div class=\"codehilite\"><pre><span></span><code> <span class=\"kd\">local</span> <span class=\"n\">test_pos</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_position</span><span class=\"p\">(</span><span class=\"s2\">&quot;/test&quot;</span><span class=\"p\">)</span>\n <span class=\"kd\">local</span> <span class=\"n\">child_pos</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_position</span><span class=\"p\">(</span><span class=\"s2\">&quot;/child&quot;</span><span class=\"p\">)</span>\n <span class=\"kd\">local</span> <span class=\"n\">new_position</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">world_to_local_position</span><span class=\"p\">(</span><span class=\"n\">test_pos</span><span class=\"p\">,</span> <span class=\"s2\">&quot;/child&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1506
+ "replaces": "",
1507
+ "error": "",
1508
+ "tparams": [],
1509
+ "members": [],
1510
+ "notes": [],
1511
+ "language": ""
1512
+ },
1513
+ {
1514
+ "type": "FUNCTION",
1515
+ "name": "go.world_to_local_transform",
1516
+ "brief": "convert transformation matrix to game object's coordinate space",
1517
+ "description": "<span class=\"icon-attention\"></span> The function uses world transformation calculated at the end of previous frame.",
1518
+ "returnvalues": [
1519
+ {
1520
+ "name": "converted_transform",
1521
+ "doc": "converted transformation",
1522
+ "types": ["matrix4"]
1523
+ }
1524
+ ],
1525
+ "parameters": [
1526
+ {
1527
+ "name": "transformation",
1528
+ "doc": "transformation which need to be converted",
1529
+ "types": ["matrix4"],
1530
+ "is_optional": "False"
1531
+ },
1532
+ {
1533
+ "name": "url",
1534
+ "doc": "url of the game object which coordinate system convert to",
1535
+ "types": ["string", "hash", "url"],
1536
+ "is_optional": "False"
1537
+ }
1538
+ ],
1539
+ "examples": "Convert transformation of \"test\" game object into coordinate space of \"child\" object.\n<div class=\"codehilite\"><pre><span></span><code> <span class=\"kd\">local</span> <span class=\"n\">test_transform</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_transform</span><span class=\"p\">(</span><span class=\"s2\">&quot;/test&quot;</span><span class=\"p\">)</span>\n <span class=\"kd\">local</span> <span class=\"n\">child_transform</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_transform</span><span class=\"p\">(</span><span class=\"s2\">&quot;/child&quot;</span><span class=\"p\">)</span>\n <span class=\"kd\">local</span> <span class=\"n\">result_transform</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">world_to_local_transform</span><span class=\"p\">(</span><span class=\"n\">test_transform</span><span class=\"p\">,</span> <span class=\"s2\">&quot;/child&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
1540
+ "replaces": "",
1541
+ "error": "",
1542
+ "tparams": [],
1543
+ "members": [],
1544
+ "notes": [],
1545
+ "language": ""
1546
+ },
1547
+ {
1548
+ "type": "FUNCTION",
1549
+ "name": "init",
1550
+ "brief": "called when a script component is initialized",
1551
+ "description": "This is a callback-function, which is called by the engine when a script component is initialized. It can be used\nto set the initial state of the script.",
1552
+ "returnvalues": [],
1553
+ "parameters": [
1554
+ {
1555
+ "name": "self",
1556
+ "doc": "script instance used for storing state",
1557
+ "types": ["script_instance"],
1558
+ "is_optional": "False"
1559
+ }
1560
+ ],
1561
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- set up useful data</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_value</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1562
+ "replaces": "",
1563
+ "error": "",
1564
+ "tparams": [],
1565
+ "members": [],
1566
+ "notes": [],
1567
+ "language": ""
1568
+ },
1569
+ {
1570
+ "type": "FUNCTION",
1571
+ "name": "final",
1572
+ "brief": "called when a script component is finalized",
1573
+ "description": "This is a callback-function, which is called by the engine when a script component is finalized (destroyed). It can\nbe used to e.g. take some last action, report the finalization to other game object instances, delete spawned objects\nor release user input focus (see <a href=\"#release_input_focus\">release_input_focus</a>).",
1574
+ "returnvalues": [],
1575
+ "parameters": [
1576
+ {
1577
+ "name": "self",
1578
+ "doc": "script instance used for storing state",
1579
+ "types": ["script_instance"],
1580
+ "is_optional": "False"
1581
+ }
1582
+ ],
1583
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">final</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- report finalization</span>\n <span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_friend_instance&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;im_dead&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">my_stats</span> <span class=\"o\">=</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">some_value</span><span class=\"p\">})</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1584
+ "replaces": "",
1585
+ "error": "",
1586
+ "tparams": [],
1587
+ "members": [],
1588
+ "notes": [],
1589
+ "language": ""
1590
+ },
1591
+ {
1592
+ "type": "FUNCTION",
1593
+ "name": "update",
1594
+ "brief": "called every frame to update the script component",
1595
+ "description": "This is a callback-function, which is called by the engine every frame to update the state of a script component.\nIt can be used to perform any kind of game related tasks, e.g. moving the game object instance.",
1596
+ "returnvalues": [],
1597
+ "parameters": [
1598
+ {
1599
+ "name": "self",
1600
+ "doc": "script instance used for storing state",
1601
+ "types": ["script_instance"],
1602
+ "is_optional": "False"
1603
+ },
1604
+ {
1605
+ "name": "dt",
1606
+ "doc": "the time-step of the frame update",
1607
+ "types": ["number"],
1608
+ "is_optional": "False"
1609
+ }
1610
+ ],
1611
+ "examples": "This example demonstrates how to move a game object instance through the script component:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- set initial velocity to be 1 along world x-axis</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_velocity</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- move the game object instance</span>\n <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_position</span><span class=\"p\">(</span><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_position</span><span class=\"p\">()</span> <span class=\"o\">+</span> <span class=\"n\">dt</span> <span class=\"o\">*</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_velocity</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1612
+ "replaces": "",
1613
+ "error": "",
1614
+ "tparams": [],
1615
+ "members": [],
1616
+ "notes": [],
1617
+ "language": ""
1618
+ },
1619
+ {
1620
+ "type": "FUNCTION",
1621
+ "name": "fixed_update",
1622
+ "brief": "called at fixed intervals to update the script component",
1623
+ "description": "This is a callback-function, which is called by the engine at fixed intervals to update the state of a script\ncomponent. The function will be called if 'Fixed Update Frequency' is enabled in the Engine section of game.project.\nIt can for instance be used to update game logic with the physics simulation if using a fixed timestep for the\nphysics (enabled by ticking 'Use Fixed Timestep' in the Physics section of game.project).",
1624
+ "returnvalues": [],
1625
+ "parameters": [
1626
+ {
1627
+ "name": "self",
1628
+ "doc": "script instance used for storing state",
1629
+ "types": ["script_instance"],
1630
+ "is_optional": "False"
1631
+ },
1632
+ {
1633
+ "name": "dt",
1634
+ "doc": "the time-step of the frame update",
1635
+ "types": ["number"],
1636
+ "is_optional": "False"
1637
+ }
1638
+ ],
1639
+ "examples": "",
1640
+ "replaces": "",
1641
+ "error": "",
1642
+ "tparams": [],
1643
+ "members": [],
1644
+ "notes": [],
1645
+ "language": ""
1646
+ },
1647
+ {
1648
+ "type": "FUNCTION",
1649
+ "name": "late_update",
1650
+ "brief": "called at the end of the frame for a final update of the script component",
1651
+ "description": "This is a callback-function, which is called by the engine at the end of the frame to update the state of a script\ncomponent. Use it to make final adjustments to the game object instance.",
1652
+ "returnvalues": [],
1653
+ "parameters": [
1654
+ {
1655
+ "name": "self",
1656
+ "doc": "script instance used for storing state",
1657
+ "types": ["script_instance"],
1658
+ "is_optional": "False"
1659
+ },
1660
+ {
1661
+ "name": "dt",
1662
+ "doc": "the time-step of the frame update",
1663
+ "types": ["number"],
1664
+ "is_optional": "False"
1665
+ }
1666
+ ],
1667
+ "examples": "",
1668
+ "replaces": "",
1669
+ "error": "",
1670
+ "tparams": [],
1671
+ "members": [],
1672
+ "notes": [],
1673
+ "language": ""
1674
+ },
1675
+ {
1676
+ "type": "FUNCTION",
1677
+ "name": "on_message",
1678
+ "brief": "called when a message has been sent to the script component",
1679
+ "description": "This is a callback-function, which is called by the engine whenever a message has been sent to the script component.\nIt can be used to take action on the message, e.g. send a response back to the sender of the message.\nThe <code>message</code> parameter is a table containing the message data. If the message is sent from the engine, the\ndocumentation of the message specifies which data is supplied.",
1680
+ "returnvalues": [],
1681
+ "parameters": [
1682
+ {
1683
+ "name": "self",
1684
+ "doc": "script instance used for storing state",
1685
+ "types": ["script_instance"],
1686
+ "is_optional": "False"
1687
+ },
1688
+ {
1689
+ "name": "message_id",
1690
+ "doc": "id of the received message",
1691
+ "types": ["hash"],
1692
+ "is_optional": "False"
1693
+ },
1694
+ {
1695
+ "name": "message",
1696
+ "doc": "a table containing the message data",
1697
+ "types": ["table<any, any>"],
1698
+ "is_optional": "False"
1699
+ },
1700
+ {
1701
+ "name": "sender",
1702
+ "doc": "address of the sender",
1703
+ "types": ["url"],
1704
+ "is_optional": "False"
1705
+ }
1706
+ ],
1707
+ "examples": "This example demonstrates how a game object instance, called \"a\", can communicate with another instance, called \"b\". It\nis assumed that both script components of the instances has id \"script\".\nScript of instance \"a\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- let b know about some important data</span>\n <span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;b#script&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;my_data&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">important_value</span> <span class=\"o\">=</span> <span class=\"mi\">1</span><span class=\"p\">})</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\nScript of instance \"b\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- store the url of instance &quot;a&quot; for later use, by specifying nil as socket we</span>\n <span class=\"c1\">-- automatically use our own socket</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">a_url</span> <span class=\"o\">=</span> <span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">url</span><span class=\"p\">(</span><span class=\"kc\">nil</span><span class=\"p\">,</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_id</span><span class=\"p\">(</span><span class=\"s2\">&quot;a&quot;</span><span class=\"p\">),</span> <span class=\"s2\">&quot;script&quot;</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">on_message</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">message_id</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">,</span> <span class=\"n\">sender</span><span class=\"p\">)</span>\n <span class=\"c1\">-- check message and sender</span>\n <span class=\"kr\">if</span> <span class=\"n\">message_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_data&quot;</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"n\">sender</span> <span class=\"o\">==</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">a_url</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- use the data in some way</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">important_value</span> <span class=\"o\">=</span> <span class=\"n\">message</span><span class=\"p\">.</span><span class=\"n\">important_value</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1708
+ "replaces": "",
1709
+ "error": "",
1710
+ "tparams": [],
1711
+ "members": [],
1712
+ "notes": [],
1713
+ "language": ""
1714
+ },
1715
+ {
1716
+ "type": "FUNCTION",
1717
+ "name": "on_input",
1718
+ "brief": "called when user input is received",
1719
+ "description": "This is a callback-function, which is called by the engine when user input is sent to the game object instance of the script.\nIt can be used to take action on the input, e.g. move the instance according to the input.\nFor an instance to obtain user input, it must first acquire input focus\nthrough the message <code>acquire_input_focus</code>.\nAny instance that has obtained input will be put on top of an\ninput stack. Input is sent to all listeners on the stack until the\nend of stack is reached, or a listener returns <code>true</code>\nto signal that it wants input to be consumed.\nSee the documentation of <a href=\"#acquire_input_focus\">acquire_input_focus</a> for more\ninformation.",
1720
+ "returnvalues": [
1721
+ {
1722
+ "name": "consume",
1723
+ "doc": "optional boolean to signal if the input should be consumed (not passed on to others) or not, default is false",
1724
+ "types": ["boolean", "nil"]
1725
+ }
1726
+ ],
1727
+ "parameters": [
1728
+ {
1729
+ "name": "self",
1730
+ "doc": "script instance used for storing state",
1731
+ "types": ["script_instance"],
1732
+ "is_optional": "False"
1733
+ },
1734
+ {
1735
+ "name": "action_id",
1736
+ "doc": "id of the received input action, as mapped in the input_binding-file, or <code>nil</code> for mouse movement",
1737
+ "types": ["hash", "nil"],
1738
+ "is_optional": "False"
1739
+ },
1740
+ {
1741
+ "name": "action",
1742
+ "doc": "input data for the action",
1743
+ "types": ["on_input.action"],
1744
+ "is_optional": "False"
1745
+ }
1746
+ ],
1747
+ "examples": "This example demonstrates how a game object instance can be moved as a response to user input.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- acquire input focus</span>\n <span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;.&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;acquire_input_focus&quot;</span><span class=\"p\">)</span>\n <span class=\"c1\">-- maximum speed the instance can be moved</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">max_speed</span> <span class=\"o\">=</span> <span class=\"mi\">2</span>\n <span class=\"c1\">-- velocity of the instance, initially zero</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">velocity</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">()</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- move the instance</span>\n <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_position</span><span class=\"p\">(</span><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_position</span><span class=\"p\">()</span> <span class=\"o\">+</span> <span class=\"n\">dt</span> <span class=\"o\">*</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">velocity</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">on_input</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">action_id</span><span class=\"p\">,</span> <span class=\"n\">action</span><span class=\"p\">)</span>\n <span class=\"c1\">-- check for movement input</span>\n <span class=\"kr\">if</span> <span class=\"n\">action_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;right&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"kr\">if</span> <span class=\"n\">action</span><span class=\"p\">.</span><span class=\"n\">released</span> <span class=\"kr\">then</span> <span class=\"c1\">-- reset velocity if input was released</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">velocity</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">()</span>\n <span class=\"kr\">else</span> <span class=\"c1\">-- update velocity</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">velocity</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">(</span><span class=\"n\">action</span><span class=\"p\">.</span><span class=\"n\">value</span> <span class=\"o\">*</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">max_speed</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">)</span>\n <span class=\"kr\">end</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1748
+ "replaces": "",
1749
+ "error": "",
1750
+ "tparams": [],
1751
+ "members": [],
1752
+ "notes": [],
1753
+ "language": ""
1754
+ },
1755
+ {
1756
+ "type": "FUNCTION",
1757
+ "name": "on_reload",
1758
+ "brief": "called when the script component is reloaded",
1759
+ "description": "This is a callback-function, which is called by the engine when the script component is reloaded, e.g. from the editor.\nIt can be used for live development, e.g. to tweak constants or set up the state properly for the instance.",
1760
+ "returnvalues": [],
1761
+ "parameters": [
1762
+ {
1763
+ "name": "self",
1764
+ "doc": "script instance used for storing state",
1765
+ "types": ["script_instance"],
1766
+ "is_optional": "False"
1767
+ }
1768
+ ],
1769
+ "examples": "This example demonstrates how to tweak the speed of a game object instance that is moved on user input.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- acquire input focus</span>\n <span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;.&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;acquire_input_focus&quot;</span><span class=\"p\">)</span>\n <span class=\"c1\">-- maximum speed the instance can be moved, this value is tweaked in the on_reload function below</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">max_speed</span> <span class=\"o\">=</span> <span class=\"mi\">2</span>\n <span class=\"c1\">-- velocity of the instance, initially zero</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">velocity</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">()</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- move the instance</span>\n <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set_position</span><span class=\"p\">(</span><span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_position</span><span class=\"p\">()</span> <span class=\"o\">+</span> <span class=\"n\">dt</span> <span class=\"o\">*</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">velocity</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">on_input</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">action_id</span><span class=\"p\">,</span> <span class=\"n\">action</span><span class=\"p\">)</span>\n <span class=\"c1\">-- check for movement input</span>\n <span class=\"kr\">if</span> <span class=\"n\">action_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;right&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"kr\">if</span> <span class=\"n\">action</span><span class=\"p\">.</span><span class=\"n\">released</span> <span class=\"kr\">then</span> <span class=\"c1\">-- reset velocity if input was released</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">velocity</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">()</span>\n <span class=\"kr\">else</span> <span class=\"c1\">-- update velocity</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">velocity</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">(</span><span class=\"n\">action</span><span class=\"p\">.</span><span class=\"n\">value</span> <span class=\"o\">*</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">max_speed</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">)</span>\n <span class=\"kr\">end</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">on_reload</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- edit this value and reload the script component</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">max_speed</span> <span class=\"o\">=</span> <span class=\"mi\">100</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1770
+ "replaces": "",
1771
+ "error": "",
1772
+ "tparams": [],
1773
+ "members": [],
1774
+ "notes": [],
1775
+ "language": ""
1776
+ }
1777
+ ],
1778
+ "info": {
1779
+ "namespace": "go",
1780
+ "name": "Game object",
1781
+ "brief": "Game object API documentation",
1782
+ "description": "Game object API documentation",
1783
+ "path": "engine/gameobject/proto/gameobject/gameobject_ddf.proto",
1784
+ "file": "",
1785
+ "notes": [],
1786
+ "language": "Lua"
1787
+ },
1788
+ "format_version": 2
1789
+ }