@defold-typescript/types 0.52.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 (521) hide show
  1. package/api-signatures.json +2074 -1964
  2. package/dist/cli-runtime.js +8966 -0
  3. package/dist/identity-vocabulary.json +660 -0
  4. package/dist/src/index.d.ts +18 -0
  5. package/examples/translations.json +15 -15
  6. package/fixtures/defold-1.12.4/b2d_body_doc.json +1327 -0
  7. package/fixtures/defold-1.12.4/b2d_doc.json +107 -0
  8. package/fixtures/defold-1.12.4/base_doc.json +758 -0
  9. package/fixtures/defold-1.12.4/bit_doc.json +404 -0
  10. package/fixtures/defold-1.12.4/buffer_doc.json +422 -0
  11. package/fixtures/defold-1.12.4/camera_doc.json +664 -0
  12. package/fixtures/defold-1.12.4/collectionfactory_doc.json +219 -0
  13. package/fixtures/defold-1.12.4/collectionproxy_doc.json +289 -0
  14. package/fixtures/defold-1.12.4/coroutine_doc.json +151 -0
  15. package/fixtures/defold-1.12.4/crash_doc.json +497 -0
  16. package/fixtures/defold-1.12.4/debug_doc.json +410 -0
  17. package/fixtures/defold-1.12.4/factory_doc.json +219 -0
  18. package/fixtures/defold-1.12.4/font_doc.json +141 -0
  19. package/fixtures/defold-1.12.4/globals_doc.json +42 -0
  20. package/fixtures/defold-1.12.4/go-instance-functions.json +111 -0
  21. package/fixtures/defold-1.12.4/go_doc.json +1901 -0
  22. package/fixtures/defold-1.12.4/graphics_doc.json +1634 -0
  23. package/fixtures/defold-1.12.4/gui_doc.json +5249 -0
  24. package/fixtures/defold-1.12.4/html5_doc.json +64 -0
  25. package/fixtures/defold-1.12.4/http_doc.json +66 -0
  26. package/fixtures/defold-1.12.4/image_doc.json +170 -0
  27. package/fixtures/defold-1.12.4/io_doc.json +399 -0
  28. package/fixtures/defold-1.12.4/json_doc.json +97 -0
  29. package/fixtures/defold-1.12.4/label_doc.json +220 -0
  30. package/fixtures/defold-1.12.4/liveupdate_doc.json +308 -0
  31. package/fixtures/defold-1.12.4/math_doc.json +702 -0
  32. package/fixtures/defold-1.12.4/messages_doc.json +579 -0
  33. package/fixtures/defold-1.12.4/model_doc.json +315 -0
  34. package/fixtures/defold-1.12.4/msg_doc.json +137 -0
  35. package/fixtures/defold-1.12.4/os_doc.json +266 -0
  36. package/fixtures/defold-1.12.4/package_doc.json +139 -0
  37. package/fixtures/defold-1.12.4/particlefx_doc.json +249 -0
  38. package/fixtures/defold-1.12.4/physics_doc.json +1120 -0
  39. package/fixtures/defold-1.12.4/profiler_doc.json +375 -0
  40. package/fixtures/defold-1.12.4/render_doc.json +1167 -0
  41. package/fixtures/defold-1.12.4/resource_doc.json +762 -0
  42. package/fixtures/defold-1.12.4/socket_doc.json +2194 -0
  43. package/fixtures/defold-1.12.4/sound_doc.json +582 -0
  44. package/fixtures/defold-1.12.4/sprite_doc.json +245 -0
  45. package/fixtures/defold-1.12.4/string_doc.json +412 -0
  46. package/fixtures/defold-1.12.4/sys_doc.json +853 -0
  47. package/fixtures/defold-1.12.4/table_doc.json +166 -0
  48. package/fixtures/defold-1.12.4/tilemap_doc.json +374 -0
  49. package/fixtures/defold-1.12.4/timer_doc.json +153 -0
  50. package/fixtures/defold-1.12.4/types_doc.json +212 -0
  51. package/fixtures/defold-1.12.4/vmath_doc.json +1814 -0
  52. package/fixtures/defold-1.12.4/window_doc.json +388 -0
  53. package/fixtures/defold-1.12.4/zlib_doc.json +70 -0
  54. package/fixtures/defold-1.13.0/b2d_body_doc.json +2428 -0
  55. package/fixtures/defold-1.13.0/b2d_chain_doc.json +394 -0
  56. package/fixtures/defold-1.13.0/b2d_doc.json +128 -0
  57. package/fixtures/defold-1.13.0/b2d_fixture_doc.json +594 -0
  58. package/fixtures/defold-1.13.0/b2d_joint_doc.json +3315 -0
  59. package/fixtures/defold-1.13.0/b2d_shape_doc.json +802 -0
  60. package/fixtures/defold-1.13.0/b2d_world_doc.json +1314 -0
  61. package/fixtures/defold-1.13.0/base_doc.json +758 -0
  62. package/fixtures/defold-1.13.0/bit_doc.json +404 -0
  63. package/fixtures/defold-1.13.0/buffer_doc.json +422 -0
  64. package/fixtures/defold-1.13.0/camera_doc.json +900 -0
  65. package/fixtures/defold-1.13.0/collectionfactory_doc.json +219 -0
  66. package/fixtures/defold-1.13.0/collectionproxy_doc.json +289 -0
  67. package/fixtures/defold-1.13.0/compute_doc.json +182 -0
  68. package/fixtures/defold-1.13.0/coroutine_doc.json +151 -0
  69. package/fixtures/defold-1.13.0/crash_doc.json +497 -0
  70. package/fixtures/defold-1.13.0/debug_doc.json +410 -0
  71. package/fixtures/defold-1.13.0/editor_doc.json +3665 -0
  72. package/fixtures/defold-1.13.0/editor_http_doc.json +273 -0
  73. package/fixtures/defold-1.13.0/editor_json_doc.json +59 -0
  74. package/fixtures/defold-1.13.0/editor_localization_doc.json +138 -0
  75. package/fixtures/defold-1.13.0/editor_pprint_doc.json +36 -0
  76. package/fixtures/defold-1.13.0/editor_tilemap_tiles_doc.json +235 -0
  77. package/fixtures/defold-1.13.0/editor_zip_doc.json +163 -0
  78. package/fixtures/defold-1.13.0/editor_zlib_doc.json +48 -0
  79. package/fixtures/defold-1.13.0/factory_doc.json +219 -0
  80. package/fixtures/defold-1.13.0/font_doc.json +141 -0
  81. package/fixtures/defold-1.13.0/globals_doc.json +42 -0
  82. package/fixtures/defold-1.13.0/go-instance-functions.json +101 -0
  83. package/fixtures/defold-1.13.0/go_doc.json +1989 -0
  84. package/fixtures/defold-1.13.0/graphics_doc.json +1886 -0
  85. package/fixtures/defold-1.13.0/gui_doc.json +5277 -0
  86. package/fixtures/defold-1.13.0/html5_doc.json +64 -0
  87. package/fixtures/defold-1.13.0/http_doc.json +66 -0
  88. package/fixtures/defold-1.13.0/image_doc.json +170 -0
  89. package/fixtures/defold-1.13.0/import-manifest.json +10558 -0
  90. package/fixtures/defold-1.13.0/io_doc.json +399 -0
  91. package/fixtures/defold-1.13.0/json_doc.json +97 -0
  92. package/fixtures/defold-1.13.0/label_doc.json +220 -0
  93. package/fixtures/defold-1.13.0/liveupdate_doc.json +330 -0
  94. package/fixtures/defold-1.13.0/material_doc.json +238 -0
  95. package/fixtures/defold-1.13.0/math_doc.json +702 -0
  96. package/fixtures/defold-1.13.0/model_doc.json +412 -0
  97. package/fixtures/defold-1.13.0/msg_doc.json +137 -0
  98. package/fixtures/defold-1.13.0/os_doc.json +266 -0
  99. package/fixtures/defold-1.13.0/package_doc.json +139 -0
  100. package/fixtures/defold-1.13.0/particlefx_doc.json +249 -0
  101. package/fixtures/defold-1.13.0/physics_doc.json +1492 -0
  102. package/fixtures/defold-1.13.0/profiler_doc.json +375 -0
  103. package/fixtures/defold-1.13.0/render_doc.json +1381 -0
  104. package/fixtures/defold-1.13.0/resource_doc.json +762 -0
  105. package/fixtures/defold-1.13.0/socket_doc.json +2194 -0
  106. package/fixtures/defold-1.13.0/sound_doc.json +582 -0
  107. package/fixtures/defold-1.13.0/sprite_doc.json +335 -0
  108. package/fixtures/defold-1.13.0/string_doc.json +412 -0
  109. package/fixtures/defold-1.13.0/sys_doc.json +1142 -0
  110. package/fixtures/defold-1.13.0/table_doc.json +166 -0
  111. package/fixtures/defold-1.13.0/tilemap_doc.json +402 -0
  112. package/fixtures/defold-1.13.0/timer_doc.json +153 -0
  113. package/fixtures/defold-1.13.0/types_doc.json +212 -0
  114. package/fixtures/defold-1.13.0/vmath_doc.json +1814 -0
  115. package/fixtures/defold-1.13.0/window_doc.json +388 -0
  116. package/fixtures/defold-1.13.0/zlib_doc.json +70 -0
  117. package/fixtures/defold-1.13.1/b2d_body_doc.json +2428 -0
  118. package/fixtures/defold-1.13.1/b2d_chain_doc.json +394 -0
  119. package/fixtures/defold-1.13.1/b2d_doc.json +128 -0
  120. package/fixtures/defold-1.13.1/b2d_fixture_doc.json +594 -0
  121. package/fixtures/defold-1.13.1/b2d_joint_doc.json +3315 -0
  122. package/fixtures/defold-1.13.1/b2d_shape_doc.json +802 -0
  123. package/fixtures/defold-1.13.1/b2d_world_doc.json +1314 -0
  124. package/fixtures/defold-1.13.1/base_doc.json +758 -0
  125. package/fixtures/defold-1.13.1/bit_doc.json +404 -0
  126. package/fixtures/defold-1.13.1/buffer_doc.json +422 -0
  127. package/fixtures/defold-1.13.1/camera_doc.json +900 -0
  128. package/fixtures/defold-1.13.1/collectionfactory_doc.json +219 -0
  129. package/fixtures/defold-1.13.1/collectionproxy_doc.json +323 -0
  130. package/fixtures/defold-1.13.1/compute_doc.json +182 -0
  131. package/fixtures/defold-1.13.1/coroutine_doc.json +151 -0
  132. package/fixtures/defold-1.13.1/crash_doc.json +497 -0
  133. package/fixtures/defold-1.13.1/debug_doc.json +410 -0
  134. package/fixtures/defold-1.13.1/editor_doc.json +3880 -0
  135. package/fixtures/defold-1.13.1/editor_http_doc.json +273 -0
  136. package/fixtures/defold-1.13.1/editor_image_doc.json +128 -0
  137. package/fixtures/defold-1.13.1/editor_json_doc.json +59 -0
  138. package/fixtures/defold-1.13.1/editor_localization_doc.json +138 -0
  139. package/fixtures/defold-1.13.1/editor_pprint_doc.json +36 -0
  140. package/fixtures/defold-1.13.1/editor_tilemap_tiles_doc.json +235 -0
  141. package/fixtures/defold-1.13.1/editor_zip_doc.json +163 -0
  142. package/fixtures/defold-1.13.1/editor_zlib_doc.json +48 -0
  143. package/fixtures/defold-1.13.1/factory_doc.json +219 -0
  144. package/fixtures/defold-1.13.1/font_doc.json +141 -0
  145. package/fixtures/defold-1.13.1/globals_doc.json +42 -0
  146. package/fixtures/defold-1.13.1/go-instance-functions.json +102 -0
  147. package/fixtures/defold-1.13.1/go_doc.json +1989 -0
  148. package/fixtures/defold-1.13.1/graphics_doc.json +1886 -0
  149. package/fixtures/defold-1.13.1/gui_doc.json +5277 -0
  150. package/fixtures/defold-1.13.1/html5_doc.json +64 -0
  151. package/fixtures/defold-1.13.1/http_doc.json +66 -0
  152. package/fixtures/defold-1.13.1/image_doc.json +170 -0
  153. package/fixtures/defold-1.13.1/import-manifest.json +10091 -0
  154. package/fixtures/defold-1.13.1/io_doc.json +399 -0
  155. package/fixtures/defold-1.13.1/json_doc.json +97 -0
  156. package/fixtures/defold-1.13.1/label_doc.json +220 -0
  157. package/fixtures/defold-1.13.1/liveupdate_doc.json +330 -0
  158. package/fixtures/defold-1.13.1/material_doc.json +238 -0
  159. package/fixtures/defold-1.13.1/math_doc.json +702 -0
  160. package/fixtures/defold-1.13.1/model_doc.json +412 -0
  161. package/fixtures/defold-1.13.1/msg_doc.json +137 -0
  162. package/fixtures/defold-1.13.1/os_doc.json +266 -0
  163. package/fixtures/defold-1.13.1/package_doc.json +139 -0
  164. package/fixtures/defold-1.13.1/particlefx_doc.json +249 -0
  165. package/fixtures/defold-1.13.1/physics_doc.json +1492 -0
  166. package/fixtures/defold-1.13.1/profiler_doc.json +375 -0
  167. package/fixtures/defold-1.13.1/render_doc.json +1381 -0
  168. package/fixtures/defold-1.13.1/resource_doc.json +762 -0
  169. package/fixtures/defold-1.13.1/socket_doc.json +2194 -0
  170. package/fixtures/defold-1.13.1/sound_doc.json +582 -0
  171. package/fixtures/defold-1.13.1/sprite_doc.json +335 -0
  172. package/fixtures/defold-1.13.1/string_doc.json +412 -0
  173. package/fixtures/defold-1.13.1/sys_doc.json +1142 -0
  174. package/fixtures/defold-1.13.1/table_doc.json +166 -0
  175. package/fixtures/defold-1.13.1/tilemap_doc.json +402 -0
  176. package/fixtures/defold-1.13.1/timer_doc.json +153 -0
  177. package/fixtures/defold-1.13.1/types_doc.json +212 -0
  178. package/fixtures/defold-1.13.1/vmath_doc.json +1814 -0
  179. package/fixtures/defold-1.13.1/window_doc.json +388 -0
  180. package/fixtures/defold-1.13.1/zlib_doc.json +70 -0
  181. package/fixtures/defold-1.13.2/b2d_body_doc.json +2359 -0
  182. package/fixtures/defold-1.13.2/b2d_chain_doc.json +395 -0
  183. package/fixtures/defold-1.13.2/b2d_doc.json +1945 -0
  184. package/fixtures/defold-1.13.2/b2d_fixture_doc.json +595 -0
  185. package/fixtures/defold-1.13.2/b2d_joint_doc.json +3178 -0
  186. package/fixtures/defold-1.13.2/b2d_shape_doc.json +767 -0
  187. package/fixtures/defold-1.13.2/b2d_world_doc.json +1315 -0
  188. package/fixtures/defold-1.13.2/base_doc.json +759 -0
  189. package/fixtures/defold-1.13.2/bit_doc.json +405 -0
  190. package/fixtures/defold-1.13.2/buffer_doc.json +393 -0
  191. package/fixtures/defold-1.13.2/bullet3d_collision_object_doc.json +1206 -0
  192. package/fixtures/defold-1.13.2/bullet3d_constraint_doc.json +2455 -0
  193. package/fixtures/defold-1.13.2/bullet3d_doc.json +215 -0
  194. package/fixtures/defold-1.13.2/bullet3d_rigid_body_doc.json +1376 -0
  195. package/fixtures/defold-1.13.2/bullet3d_shape_doc.json +430 -0
  196. package/fixtures/defold-1.13.2/bullet3d_world_doc.json +855 -0
  197. package/fixtures/defold-1.13.2/camera_doc.json +887 -0
  198. package/fixtures/defold-1.13.2/collectionfactory_doc.json +206 -0
  199. package/fixtures/defold-1.13.2/collectionproxy_doc.json +397 -0
  200. package/fixtures/defold-1.13.2/compute_doc.json +183 -0
  201. package/fixtures/defold-1.13.2/coroutine_doc.json +152 -0
  202. package/fixtures/defold-1.13.2/crash_doc.json +483 -0
  203. package/fixtures/defold-1.13.2/debug_doc.json +411 -0
  204. package/fixtures/defold-1.13.2/editor_doc.json +6320 -0
  205. package/fixtures/defold-1.13.2/editor_http_doc.json +476 -0
  206. package/fixtures/defold-1.13.2/editor_image_doc.json +129 -0
  207. package/fixtures/defold-1.13.2/editor_json_doc.json +81 -0
  208. package/fixtures/defold-1.13.2/editor_localization_doc.json +139 -0
  209. package/fixtures/defold-1.13.2/editor_pprint_doc.json +37 -0
  210. package/fixtures/defold-1.13.2/editor_tilemap_tiles_doc.json +292 -0
  211. package/fixtures/defold-1.13.2/editor_zip_doc.json +237 -0
  212. package/fixtures/defold-1.13.2/editor_zlib_doc.json +49 -0
  213. package/fixtures/defold-1.13.2/factory_doc.json +206 -0
  214. package/fixtures/defold-1.13.2/font_doc.json +230 -0
  215. package/fixtures/defold-1.13.2/globals_doc.json +64 -0
  216. package/fixtures/defold-1.13.2/go-instance-functions.json +106 -0
  217. package/fixtures/defold-1.13.2/go_doc.json +1789 -0
  218. package/fixtures/defold-1.13.2/graphics_doc.json +1211 -0
  219. package/fixtures/defold-1.13.2/gui_doc.json +4735 -0
  220. package/fixtures/defold-1.13.2/html5_doc.json +65 -0
  221. package/fixtures/defold-1.13.2/http_doc.json +174 -0
  222. package/fixtures/defold-1.13.2/image_doc.json +298 -0
  223. package/fixtures/defold-1.13.2/import-manifest.json +10902 -0
  224. package/fixtures/defold-1.13.2/io_doc.json +400 -0
  225. package/fixtures/defold-1.13.2/json_doc.json +140 -0
  226. package/fixtures/defold-1.13.2/label_doc.json +427 -0
  227. package/fixtures/defold-1.13.2/liveupdate_doc.json +221 -0
  228. package/fixtures/defold-1.13.2/material_doc.json +773 -0
  229. package/fixtures/defold-1.13.2/math_doc.json +703 -0
  230. package/fixtures/defold-1.13.2/model_doc.json +472 -0
  231. package/fixtures/defold-1.13.2/msg_doc.json +169 -0
  232. package/fixtures/defold-1.13.2/os_doc.json +269 -0
  233. package/fixtures/defold-1.13.2/package_doc.json +140 -0
  234. package/fixtures/defold-1.13.2/particlefx_doc.json +249 -0
  235. package/fixtures/defold-1.13.2/physics_doc.json +1624 -0
  236. package/fixtures/defold-1.13.2/profiler_doc.json +348 -0
  237. package/fixtures/defold-1.13.2/render_doc.json +1623 -0
  238. package/fixtures/defold-1.13.2/resource_doc.json +1539 -0
  239. package/fixtures/defold-1.13.2/socket_doc.json +2335 -0
  240. package/fixtures/defold-1.13.2/sound_doc.json +673 -0
  241. package/fixtures/defold-1.13.2/sprite_doc.json +364 -0
  242. package/fixtures/defold-1.13.2/string_doc.json +413 -0
  243. package/fixtures/defold-1.13.2/sys_doc.json +1347 -0
  244. package/fixtures/defold-1.13.2/table_doc.json +167 -0
  245. package/fixtures/defold-1.13.2/tilemap_doc.json +369 -0
  246. package/fixtures/defold-1.13.2/timer_doc.json +214 -0
  247. package/fixtures/defold-1.13.2/types_doc.json +213 -0
  248. package/fixtures/defold-1.13.2/vmath_doc.json +2056 -0
  249. package/fixtures/defold-1.13.2/window_doc.json +426 -0
  250. package/fixtures/defold-1.13.2/zlib_doc.json +71 -0
  251. package/fixtures/defold-1.14.0/b2d_body_doc.json +2359 -0
  252. package/fixtures/defold-1.14.0/b2d_chain_doc.json +395 -0
  253. package/fixtures/defold-1.14.0/b2d_doc.json +1973 -0
  254. package/fixtures/defold-1.14.0/b2d_fixture_doc.json +595 -0
  255. package/fixtures/defold-1.14.0/b2d_joint_doc.json +3178 -0
  256. package/fixtures/defold-1.14.0/b2d_shape_doc.json +767 -0
  257. package/fixtures/defold-1.14.0/b2d_world_doc.json +1315 -0
  258. package/fixtures/defold-1.14.0/base_doc.json +759 -0
  259. package/fixtures/defold-1.14.0/bit_doc.json +405 -0
  260. package/fixtures/defold-1.14.0/buffer_doc.json +393 -0
  261. package/fixtures/defold-1.14.0/bullet3d_collision_object_doc.json +1206 -0
  262. package/fixtures/defold-1.14.0/bullet3d_constraint_doc.json +2455 -0
  263. package/fixtures/defold-1.14.0/bullet3d_doc.json +243 -0
  264. package/fixtures/defold-1.14.0/bullet3d_rigid_body_doc.json +1376 -0
  265. package/fixtures/defold-1.14.0/bullet3d_shape_doc.json +430 -0
  266. package/fixtures/defold-1.14.0/bullet3d_world_doc.json +855 -0
  267. package/fixtures/defold-1.14.0/camera_doc.json +887 -0
  268. package/fixtures/defold-1.14.0/collectionfactory_doc.json +206 -0
  269. package/fixtures/defold-1.14.0/collectionproxy_doc.json +397 -0
  270. package/fixtures/defold-1.14.0/compute_doc.json +183 -0
  271. package/fixtures/defold-1.14.0/coroutine_doc.json +152 -0
  272. package/fixtures/defold-1.14.0/crash_doc.json +483 -0
  273. package/fixtures/defold-1.14.0/debug_doc.json +411 -0
  274. package/fixtures/defold-1.14.0/editor_doc.json +6320 -0
  275. package/fixtures/defold-1.14.0/editor_http_doc.json +476 -0
  276. package/fixtures/defold-1.14.0/editor_image_doc.json +129 -0
  277. package/fixtures/defold-1.14.0/editor_json_doc.json +81 -0
  278. package/fixtures/defold-1.14.0/editor_localization_doc.json +139 -0
  279. package/fixtures/defold-1.14.0/editor_pprint_doc.json +37 -0
  280. package/fixtures/defold-1.14.0/editor_tilemap_tiles_doc.json +292 -0
  281. package/fixtures/defold-1.14.0/editor_zip_doc.json +237 -0
  282. package/fixtures/defold-1.14.0/editor_zlib_doc.json +49 -0
  283. package/fixtures/defold-1.14.0/factory_doc.json +206 -0
  284. package/fixtures/defold-1.14.0/font_doc.json +230 -0
  285. package/fixtures/defold-1.14.0/globals_doc.json +64 -0
  286. package/fixtures/defold-1.14.0/go-instance-functions.json +106 -0
  287. package/fixtures/defold-1.14.0/go_doc.json +1789 -0
  288. package/fixtures/defold-1.14.0/graphics_doc.json +1257 -0
  289. package/fixtures/defold-1.14.0/gui_doc.json +4735 -0
  290. package/fixtures/defold-1.14.0/html5_doc.json +65 -0
  291. package/fixtures/defold-1.14.0/http_doc.json +174 -0
  292. package/fixtures/defold-1.14.0/image_doc.json +298 -0
  293. package/fixtures/defold-1.14.0/import-manifest.json +10260 -0
  294. package/fixtures/defold-1.14.0/io_doc.json +400 -0
  295. package/fixtures/defold-1.14.0/json_doc.json +140 -0
  296. package/fixtures/defold-1.14.0/label_doc.json +427 -0
  297. package/fixtures/defold-1.14.0/liveupdate_doc.json +221 -0
  298. package/fixtures/defold-1.14.0/material_doc.json +773 -0
  299. package/fixtures/defold-1.14.0/math_doc.json +703 -0
  300. package/fixtures/defold-1.14.0/model_doc.json +472 -0
  301. package/fixtures/defold-1.14.0/msg_doc.json +169 -0
  302. package/fixtures/defold-1.14.0/os_doc.json +269 -0
  303. package/fixtures/defold-1.14.0/package_doc.json +140 -0
  304. package/fixtures/defold-1.14.0/particlefx_doc.json +249 -0
  305. package/fixtures/defold-1.14.0/physics_doc.json +1624 -0
  306. package/fixtures/defold-1.14.0/profiler_doc.json +348 -0
  307. package/fixtures/defold-1.14.0/render_doc.json +1628 -0
  308. package/fixtures/defold-1.14.0/resource_doc.json +1539 -0
  309. package/fixtures/defold-1.14.0/socket_doc.json +2335 -0
  310. package/fixtures/defold-1.14.0/sound_doc.json +673 -0
  311. package/fixtures/defold-1.14.0/sprite_doc.json +364 -0
  312. package/fixtures/defold-1.14.0/string_doc.json +413 -0
  313. package/fixtures/defold-1.14.0/sys_doc.json +1347 -0
  314. package/fixtures/defold-1.14.0/table_doc.json +167 -0
  315. package/fixtures/defold-1.14.0/tilemap_doc.json +369 -0
  316. package/fixtures/defold-1.14.0/timer_doc.json +214 -0
  317. package/fixtures/defold-1.14.0/types_doc.json +213 -0
  318. package/fixtures/defold-1.14.0/vmath_doc.json +2056 -0
  319. package/fixtures/defold-1.14.0/window_doc.json +426 -0
  320. package/fixtures/defold-1.14.0/zlib_doc.json +71 -0
  321. package/generated/b2d.d.ts +39 -39
  322. package/generated/b2d_body.d.ts +11 -11
  323. package/generated/b2d_chain.d.ts +3 -3
  324. package/generated/b2d_fixture.d.ts +5 -5
  325. package/generated/b2d_joint.d.ts +29 -29
  326. package/generated/b2d_shape.d.ts +13 -13
  327. package/generated/b2d_world.d.ts +15 -15
  328. package/generated/buffer.d.ts +5 -6
  329. package/generated/bullet3d.d.ts +6 -6
  330. package/generated/bullet3d_collision_object.d.ts +9 -9
  331. package/generated/bullet3d_constraint.d.ts +78 -78
  332. package/generated/bullet3d_rigid_body.d.ts +3 -3
  333. package/generated/bullet3d_shape.d.ts +11 -11
  334. package/generated/bullet3d_world.d.ts +20 -20
  335. package/generated/camera.d.ts +4 -4
  336. package/generated/collectionfactory.d.ts +2 -3
  337. package/generated/collectionproxy.d.ts +5 -5
  338. package/generated/compute.d.ts +5 -5
  339. package/generated/crash.d.ts +7 -7
  340. package/generated/editor-vm/http.d.ts +13 -13
  341. package/generated/editor-vm/image.d.ts +4 -4
  342. package/generated/editor-vm/json.d.ts +1 -1
  343. package/generated/editor-vm/tilemap_tiles.d.ts +9 -9
  344. package/generated/editor-vm/zip.d.ts +4 -4
  345. package/generated/editor.d.ts +183 -183
  346. package/generated/factory.d.ts +2 -3
  347. package/generated/font.d.ts +4 -4
  348. package/generated/go.d.ts +10 -12
  349. package/generated/graphics.d.ts +23 -26
  350. package/generated/gui.d.ts +44 -58
  351. package/generated/http.d.ts +2 -2
  352. package/generated/image.d.ts +12 -12
  353. package/generated/json.d.ts +4 -4
  354. package/generated/label.d.ts +5 -5
  355. package/generated/liveupdate.d.ts +3 -3
  356. package/generated/material.d.ts +48 -48
  357. package/generated/model.d.ts +46 -14
  358. package/generated/particlefx.d.ts +5 -5
  359. package/generated/physics.d.ts +19 -19
  360. package/generated/profiler.d.ts +3 -5
  361. package/generated/render-script-modules/b2d.d.ts +39 -39
  362. package/generated/render-script-modules/bullet3d.d.ts +5 -5
  363. package/generated/render-script-modules/collectionfactory.d.ts +1 -2
  364. package/generated/render-script-modules/collectionproxy.d.ts +3 -3
  365. package/generated/render-script-modules/factory.d.ts +1 -2
  366. package/generated/render-script-modules/go.d.ts +8 -10
  367. package/generated/render-script-modules/label.d.ts +2 -2
  368. package/generated/render-script-modules/model.d.ts +43 -11
  369. package/generated/render-script-modules/particlefx.d.ts +3 -3
  370. package/generated/render-script-modules/physics.d.ts +12 -12
  371. package/generated/render-script-modules/resource.d.ts +52 -53
  372. package/generated/render-script-modules/sound.d.ts +4 -4
  373. package/generated/render-script-modules/sprite.d.ts +2 -2
  374. package/generated/render-script-modules/tilemap.d.ts +2 -2
  375. package/generated/render.d.ts +44 -45
  376. package/generated/resource.d.ts +58 -59
  377. package/generated/socket.d.ts +18 -23
  378. package/generated/sound.d.ts +6 -6
  379. package/generated/sprite.d.ts +3 -3
  380. package/generated/sys.d.ts +20 -21
  381. package/generated/tilemap.d.ts +3 -3
  382. package/generated/timer.d.ts +3 -3
  383. package/generated/versions/defold-1.12.4/b2d.d.ts +2 -2
  384. package/generated/versions/defold-1.12.4/b2d_body.d.ts +2 -2
  385. package/generated/versions/defold-1.12.4/go.d.ts +2 -2
  386. package/generated/versions/defold-1.12.4/graphics.d.ts +1 -1
  387. package/generated/versions/defold-1.12.4/gui.d.ts +18 -19
  388. package/generated/versions/defold-1.12.4/label.d.ts +1 -1
  389. package/generated/versions/defold-1.12.4/model.d.ts +42 -10
  390. package/generated/versions/defold-1.12.4/particlefx.d.ts +1 -1
  391. package/generated/versions/defold-1.12.4/physics.d.ts +1 -1
  392. package/generated/versions/defold-1.12.4/render.d.ts +5 -5
  393. package/generated/versions/defold-1.12.4/resource.d.ts +8 -8
  394. package/generated/versions/defold-1.12.4/socket.d.ts +12 -12
  395. package/generated/versions/defold-1.12.4/sound.d.ts +1 -1
  396. package/generated/versions/defold-1.12.4/sprite.d.ts +1 -1
  397. package/generated/versions/defold-1.12.4/sys.d.ts +2 -2
  398. package/generated/versions/defold-1.12.4/tilemap.d.ts +1 -1
  399. package/generated/versions/defold-1.12.4/window.d.ts +3 -4
  400. package/generated/versions/defold-1.13.0/b2d.d.ts +2 -2
  401. package/generated/versions/defold-1.13.0/b2d_body.d.ts +2 -2
  402. package/generated/versions/defold-1.13.0/b2d_chain.d.ts +1 -1
  403. package/generated/versions/defold-1.13.0/b2d_joint.d.ts +1 -1
  404. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +1 -1
  405. package/generated/versions/defold-1.13.0/camera.d.ts +1 -1
  406. package/generated/versions/defold-1.13.0/go.d.ts +2 -2
  407. package/generated/versions/defold-1.13.0/graphics.d.ts +1 -1
  408. package/generated/versions/defold-1.13.0/gui.d.ts +18 -19
  409. package/generated/versions/defold-1.13.0/label.d.ts +1 -1
  410. package/generated/versions/defold-1.13.0/model.d.ts +42 -10
  411. package/generated/versions/defold-1.13.0/particlefx.d.ts +1 -1
  412. package/generated/versions/defold-1.13.0/physics.d.ts +1 -1
  413. package/generated/versions/defold-1.13.0/render.d.ts +5 -5
  414. package/generated/versions/defold-1.13.0/resource.d.ts +8 -8
  415. package/generated/versions/defold-1.13.0/socket.d.ts +12 -12
  416. package/generated/versions/defold-1.13.0/sound.d.ts +1 -1
  417. package/generated/versions/defold-1.13.0/sprite.d.ts +1 -1
  418. package/generated/versions/defold-1.13.0/sys.d.ts +2 -2
  419. package/generated/versions/defold-1.13.0/tilemap.d.ts +1 -1
  420. package/generated/versions/defold-1.13.0/window.d.ts +3 -4
  421. package/generated/versions/defold-1.13.1/b2d.d.ts +2 -2
  422. package/generated/versions/defold-1.13.1/b2d_body.d.ts +2 -2
  423. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +1 -1
  424. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +1 -1
  425. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +1 -1
  426. package/generated/versions/defold-1.13.1/camera.d.ts +1 -1
  427. package/generated/versions/defold-1.13.1/go.d.ts +2 -2
  428. package/generated/versions/defold-1.13.1/graphics.d.ts +1 -1
  429. package/generated/versions/defold-1.13.1/gui.d.ts +18 -19
  430. package/generated/versions/defold-1.13.1/label.d.ts +1 -1
  431. package/generated/versions/defold-1.13.1/model.d.ts +42 -10
  432. package/generated/versions/defold-1.13.1/particlefx.d.ts +1 -1
  433. package/generated/versions/defold-1.13.1/physics.d.ts +1 -1
  434. package/generated/versions/defold-1.13.1/render.d.ts +5 -5
  435. package/generated/versions/defold-1.13.1/resource.d.ts +8 -8
  436. package/generated/versions/defold-1.13.1/socket.d.ts +12 -12
  437. package/generated/versions/defold-1.13.1/sound.d.ts +1 -1
  438. package/generated/versions/defold-1.13.1/sprite.d.ts +1 -1
  439. package/generated/versions/defold-1.13.1/sys.d.ts +2 -2
  440. package/generated/versions/defold-1.13.1/tilemap.d.ts +1 -1
  441. package/generated/versions/defold-1.13.1/window.d.ts +3 -4
  442. package/generated/versions/defold-1.13.2/b2d.d.ts +39 -39
  443. package/generated/versions/defold-1.13.2/b2d_body.d.ts +11 -11
  444. package/generated/versions/defold-1.13.2/b2d_chain.d.ts +3 -3
  445. package/generated/versions/defold-1.13.2/b2d_fixture.d.ts +5 -5
  446. package/generated/versions/defold-1.13.2/b2d_joint.d.ts +29 -29
  447. package/generated/versions/defold-1.13.2/b2d_shape.d.ts +13 -13
  448. package/generated/versions/defold-1.13.2/b2d_world.d.ts +15 -15
  449. package/generated/versions/defold-1.13.2/buffer.d.ts +5 -6
  450. package/generated/versions/defold-1.13.2/bullet3d.d.ts +6 -6
  451. package/generated/versions/defold-1.13.2/bullet3d_collision_object.d.ts +9 -9
  452. package/generated/versions/defold-1.13.2/bullet3d_constraint.d.ts +78 -78
  453. package/generated/versions/defold-1.13.2/bullet3d_rigid_body.d.ts +3 -3
  454. package/generated/versions/defold-1.13.2/bullet3d_shape.d.ts +11 -11
  455. package/generated/versions/defold-1.13.2/bullet3d_world.d.ts +20 -20
  456. package/generated/versions/defold-1.13.2/camera.d.ts +4 -4
  457. package/generated/versions/defold-1.13.2/collectionfactory.d.ts +2 -3
  458. package/generated/versions/defold-1.13.2/collectionproxy.d.ts +5 -5
  459. package/generated/versions/defold-1.13.2/compute.d.ts +5 -5
  460. package/generated/versions/defold-1.13.2/crash.d.ts +7 -7
  461. package/generated/versions/defold-1.13.2/editor-vm/http.d.ts +13 -13
  462. package/generated/versions/defold-1.13.2/editor-vm/image.d.ts +4 -4
  463. package/generated/versions/defold-1.13.2/editor-vm/json.d.ts +1 -1
  464. package/generated/versions/defold-1.13.2/editor-vm/tilemap_tiles.d.ts +9 -9
  465. package/generated/versions/defold-1.13.2/editor-vm/zip.d.ts +4 -4
  466. package/generated/versions/defold-1.13.2/editor.d.ts +183 -183
  467. package/generated/versions/defold-1.13.2/factory.d.ts +2 -3
  468. package/generated/versions/defold-1.13.2/font.d.ts +4 -4
  469. package/generated/versions/defold-1.13.2/go.d.ts +10 -12
  470. package/generated/versions/defold-1.13.2/graphics.d.ts +22 -25
  471. package/generated/versions/defold-1.13.2/gui.d.ts +44 -58
  472. package/generated/versions/defold-1.13.2/http.d.ts +2 -2
  473. package/generated/versions/defold-1.13.2/image.d.ts +12 -12
  474. package/generated/versions/defold-1.13.2/json.d.ts +4 -4
  475. package/generated/versions/defold-1.13.2/label.d.ts +5 -5
  476. package/generated/versions/defold-1.13.2/liveupdate.d.ts +3 -3
  477. package/generated/versions/defold-1.13.2/material.d.ts +48 -48
  478. package/generated/versions/defold-1.13.2/model.d.ts +46 -14
  479. package/generated/versions/defold-1.13.2/particlefx.d.ts +5 -5
  480. package/generated/versions/defold-1.13.2/physics.d.ts +19 -19
  481. package/generated/versions/defold-1.13.2/profiler.d.ts +3 -5
  482. package/generated/versions/defold-1.13.2/render.d.ts +43 -44
  483. package/generated/versions/defold-1.13.2/resource.d.ts +58 -59
  484. package/generated/versions/defold-1.13.2/socket.d.ts +18 -23
  485. package/generated/versions/defold-1.13.2/sound.d.ts +6 -6
  486. package/generated/versions/defold-1.13.2/sprite.d.ts +3 -3
  487. package/generated/versions/defold-1.13.2/sys.d.ts +20 -21
  488. package/generated/versions/defold-1.13.2/tilemap.d.ts +3 -3
  489. package/generated/versions/defold-1.13.2/timer.d.ts +3 -3
  490. package/generated/versions/defold-1.13.2/vmath.d.ts +0 -1
  491. package/generated/versions/defold-1.13.2/window.d.ts +8 -10
  492. package/generated/vmath.d.ts +0 -1
  493. package/generated/window.d.ts +8 -10
  494. package/identity-vocabulary.json +41 -34
  495. package/package.json +13 -5
  496. package/scripts/cli-runtime.ts +18 -0
  497. package/scripts/example-store-io.ts +2 -2
  498. package/scripts/extension-goldens.ts +9 -5
  499. package/scripts/generate-api-availability.ts +10 -4
  500. package/scripts/generate-api-signatures.ts +1 -1
  501. package/scripts/import-defold-release.ts +1 -1
  502. package/scripts/regen.ts +35 -9
  503. package/scripts/shared-handle-methods.ts +3 -2
  504. package/scripts/signature-store-fs.ts +37 -17
  505. package/scripts/sync-api-docs.ts +127 -20
  506. package/src/api-doc.ts +19 -4
  507. package/src/api-identity.ts +32 -1
  508. package/src/component-properties.d.ts +8 -8
  509. package/src/core-types.ts +29 -13
  510. package/src/doc-corrections.ts +9 -0
  511. package/src/emit-dts.ts +770 -214
  512. package/src/engine-type-name.ts +33 -0
  513. package/src/go-overloads.d.ts +10 -10
  514. package/src/gui-overloads.d.ts +11 -11
  515. package/src/index-slot-classifications.ts +75 -9
  516. package/src/index.ts +4 -1
  517. package/src/lifecycle.ts +2 -2
  518. package/src/publish-dts.ts +16 -0
  519. package/src/script-api.ts +36 -38
  520. package/src/socket-types.d.ts +3 -3
  521. package/src/library-index-slot-classifications.ts +0 -332
@@ -0,0 +1,853 @@
1
+ {
2
+ "elements": [
3
+ {
4
+ "type": "FUNCTION",
5
+ "name": "sys.save",
6
+ "brief": "saves a lua table to a file stored on disk",
7
+ "description": "The table can later be loaded by <code>sys.load</code>.\nUse <code>sys.get_save_file</code> to obtain a valid location for the file.\nInternally, this function uses a workspace buffer sized output file sized 512kb.\nThis size reflects the output file size which must not exceed this limit.\nAdditionally, the total number of rows that any one table may contain is limited to 65536\n(i.e. a 16 bit range). When tables are used to represent arrays, the values of\nkeys are permitted to fall within a 32 bit range, supporting sparse arrays, however\nthe limit on the total number of rows remains in effect.\nThis function will raise a Lua error if an error occurs while saving the table.",
8
+ "returnvalues": [],
9
+ "parameters": [
10
+ {
11
+ "name": "filename",
12
+ "doc": "file to write to",
13
+ "types": ["string"],
14
+ "is_optional": "False"
15
+ },
16
+ { "name": "table", "doc": "lua table to save", "types": ["table"], "is_optional": "False" }
17
+ ],
18
+ "examples": "Save data:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">my_table</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n<span class=\"nb\">table.insert</span><span class=\"p\">(</span><span class=\"n\">my_table</span><span class=\"p\">,</span> <span class=\"s2\">&quot;my_value&quot;</span><span class=\"p\">)</span>\n<span class=\"kd\">local</span> <span class=\"n\">my_file_path</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_save_file</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_game&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;my_file&quot;</span><span class=\"p\">)</span>\n<span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">save</span><span class=\"p\">(</span><span class=\"n\">my_file_path</span><span class=\"p\">,</span> <span class=\"n\">my_table</span><span class=\"p\">)</span>\n</code></pre></div>",
19
+ "replaces": "",
20
+ "error": "",
21
+ "tparams": [],
22
+ "members": [],
23
+ "notes": [],
24
+ "language": ""
25
+ },
26
+ {
27
+ "type": "FUNCTION",
28
+ "name": "sys.load",
29
+ "brief": "loads a lua table from a file on disk",
30
+ "description": "If the file exists, it must have been created by <code>sys.save</code> to be loaded.\nThis function will raise a Lua error if an error occurs while loading the file.",
31
+ "returnvalues": [
32
+ {
33
+ "name": "loaded",
34
+ "doc": "lua table, which is empty if the file could not be found",
35
+ "types": ["table"]
36
+ }
37
+ ],
38
+ "parameters": [
39
+ {
40
+ "name": "filename",
41
+ "doc": "file to read from",
42
+ "types": ["string"],
43
+ "is_optional": "False"
44
+ }
45
+ ],
46
+ "examples": "Load data that was previously saved, e.g. an earlier game session:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">my_file_path</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_save_file</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_game&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;my_file&quot;</span><span class=\"p\">)</span>\n<span class=\"kd\">local</span> <span class=\"n\">my_table</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">load</span><span class=\"p\">(</span><span class=\"n\">my_file_path</span><span class=\"p\">)</span>\n<span class=\"kr\">if</span> <span class=\"ow\">not</span> <span class=\"nb\">next</span><span class=\"p\">(</span><span class=\"n\">my_table</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- empty table</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
47
+ "replaces": "",
48
+ "error": "",
49
+ "tparams": [],
50
+ "members": [],
51
+ "notes": [],
52
+ "language": ""
53
+ },
54
+ {
55
+ "type": "FUNCTION",
56
+ "name": "sys.exists",
57
+ "brief": "check if a path exists",
58
+ "description": "Check if a path exists\nGood for checking if a file exists before loading a large file",
59
+ "returnvalues": [
60
+ {
61
+ "name": "result",
62
+ "doc": "<code>true</code> if the path exists, <code>false</code> otherwise",
63
+ "types": ["boolean"]
64
+ }
65
+ ],
66
+ "parameters": [
67
+ { "name": "path", "doc": "path to check", "types": ["string"], "is_optional": "False" }
68
+ ],
69
+ "examples": "Load data but return nil if path didn't exist\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">if</span> <span class=\"ow\">not</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">exists</span><span class=\"p\">(</span><span class=\"n\">path</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"kr\">return</span> <span class=\"kc\">nil</span>\n<span class=\"kr\">end</span>\n<span class=\"kr\">return</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">load</span><span class=\"p\">(</span><span class=\"n\">path</span><span class=\"p\">)</span> <span class=\"c1\">-- returns {} if it failed</span>\n</code></pre></div>",
70
+ "replaces": "",
71
+ "error": "",
72
+ "tparams": [],
73
+ "members": [],
74
+ "notes": [],
75
+ "language": ""
76
+ },
77
+ {
78
+ "type": "FUNCTION",
79
+ "name": "sys.get_host_path",
80
+ "brief": "create a path to the host device for unit testing",
81
+ "description": "Create a path to the host device for unit testing\nUseful for saving logs etc during development",
82
+ "returnvalues": [
83
+ {
84
+ "name": "host_path",
85
+ "doc": "the path prefixed with the proper host mount",
86
+ "types": ["string"]
87
+ }
88
+ ],
89
+ "parameters": [
90
+ {
91
+ "name": "filename",
92
+ "doc": "file to read from",
93
+ "types": ["string"],
94
+ "is_optional": "False"
95
+ }
96
+ ],
97
+ "examples": "Save data on the host\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">host_path</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_host_path</span><span class=\"p\">(</span><span class=\"s2\">&quot;logs/test.txt&quot;</span><span class=\"p\">)</span>\n<span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">save</span><span class=\"p\">(</span><span class=\"n\">host_path</span><span class=\"p\">,</span> <span class=\"n\">mytable</span><span class=\"p\">)</span>\n</code></pre></div>\n\nLoad data from the host\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">host_path</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_host_path</span><span class=\"p\">(</span><span class=\"s2\">&quot;logs/test.txt&quot;</span><span class=\"p\">)</span>\n<span class=\"kd\">local</span> <span class=\"n\">table</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">load</span><span class=\"p\">(</span><span class=\"n\">host_path</span><span class=\"p\">)</span>\n</code></pre></div>",
98
+ "replaces": "",
99
+ "error": "",
100
+ "tparams": [],
101
+ "members": [],
102
+ "notes": ["Only enabled in debug builds. In release builds returns the string unchanged"],
103
+ "language": ""
104
+ },
105
+ {
106
+ "type": "FUNCTION",
107
+ "name": "sys.get_save_file",
108
+ "brief": "gets the save-file path",
109
+ "description": "The save-file path is operating system specific and is typically located under the user's home directory.\nThis function will raise a Lua error if unable to get the save file path.",
110
+ "returnvalues": [{ "name": "path", "doc": "path to save-file", "types": ["string"] }],
111
+ "parameters": [
112
+ {
113
+ "name": "application_id",
114
+ "doc": "user defined id of the application, which helps define the location of the save-file",
115
+ "types": ["string"],
116
+ "is_optional": "False"
117
+ },
118
+ {
119
+ "name": "file_name",
120
+ "doc": "file-name to get path for",
121
+ "types": ["string"],
122
+ "is_optional": "False"
123
+ }
124
+ ],
125
+ "examples": "Find a path where we can store data:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">my_file_path</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_save_file</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_game&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;my_file&quot;</span><span class=\"p\">)</span>\n<span class=\"c1\">-- macOS: /Users/foobar/Library/Application Support/my_game/my_file</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">my_file_path</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; /Users/foobar/Library/Application Support/my_game/my_file</span>\n\n<span class=\"c1\">-- Windows: C:\\Users\\foobar\\AppData\\Roaming\\my_game\\my_file</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">my_file_path</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; C:\\Users\\foobar\\AppData\\Roaming\\my_game\\my_file</span>\n\n<span class=\"c1\">-- Linux: $XDG_DATA_HOME/my_game/my_file or /home/foobar/.my_game/my_file</span>\n<span class=\"c1\">-- Linux: Defaults to /home/foobar/.local/share/my_game/my_file if neither exist.</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">my_file_path</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; /home/foobar/.local/share/my_game/my_file</span>\n\n<span class=\"c1\">-- Android package name: com.foobar.packagename</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">my_file_path</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; /data/data/0/com.foobar.packagename/files/my_file</span>\n\n<span class=\"c1\">-- iOS: my_game.app</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">my_file_path</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; /var/mobile/Containers/Data/Application/123456AB-78CD-90DE-12345678ABCD/my_game/my_file</span>\n\n<span class=\"c1\">-- HTML5 path inside the IndexedDB: /data/.my_game/my_file or /.my_game/my_file</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">my_file_path</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; /data/.my_game/my_file</span>\n</code></pre></div>",
126
+ "replaces": "",
127
+ "error": "",
128
+ "tparams": [],
129
+ "members": [],
130
+ "notes": [
131
+ "Setting the environment variable `DM_SAVE_HOME` overrides the default application support path."
132
+ ],
133
+ "language": ""
134
+ },
135
+ {
136
+ "type": "FUNCTION",
137
+ "name": "sys.get_application_path",
138
+ "brief": "gets the application path",
139
+ "description": "The path from which the application is run.\nThis function will raise a Lua error if unable to get the application support path.",
140
+ "returnvalues": [
141
+ { "name": "path", "doc": "path to application executable", "types": ["string"] }
142
+ ],
143
+ "parameters": [],
144
+ "examples": "Find a path where we can store data (the example path is on the macOS platform):\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- macOS: /Applications/my_game.app</span>\n<span class=\"kd\">local</span> <span class=\"n\">application_path</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_application_path</span><span class=\"p\">()</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">application_path</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; /Applications/my_game.app</span>\n\n<span class=\"c1\">-- Windows: C:\\Program Files\\my_game\\my_game.exe</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">application_path</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; C:\\Program Files\\my_game</span>\n\n<span class=\"c1\">-- Linux: /home/foobar/my_game/my_game</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">application_path</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; /home/foobar/my_game</span>\n\n<span class=\"c1\">-- Android package name: com.foobar.my_game</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">application_path</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; /data/user/0/com.foobar.my_game</span>\n\n<span class=\"c1\">-- iOS: my_game.app</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">application_path</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; /var/containers/Bundle/Applications/123456AB-78CD-90DE-12345678ABCD/my_game.app</span>\n\n<span class=\"c1\">-- HTML5: http://www.foobar.com/my_game/</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">application_path</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; http://www.foobar.com/my_game</span>\n</code></pre></div>",
145
+ "replaces": "",
146
+ "error": "",
147
+ "tparams": [],
148
+ "members": [],
149
+ "notes": [],
150
+ "language": ""
151
+ },
152
+ {
153
+ "type": "FUNCTION",
154
+ "name": "sys.get_config_string",
155
+ "brief": "get string config value with optional default value",
156
+ "description": "Get string config value from the game.project configuration file with optional default value",
157
+ "returnvalues": [
158
+ {
159
+ "name": "value",
160
+ "doc": "config value as a string. default_value if the config key does not exist. nil if no default value was supplied.",
161
+ "types": ["string"]
162
+ }
163
+ ],
164
+ "parameters": [
165
+ {
166
+ "name": "key",
167
+ "doc": "key to get value for. The syntax is SECTION.KEY",
168
+ "types": ["string"],
169
+ "is_optional": "False"
170
+ },
171
+ {
172
+ "name": "default_value",
173
+ "doc": "(optional) default value to return if the value does not exist",
174
+ "types": ["string"],
175
+ "is_optional": "True"
176
+ }
177
+ ],
178
+ "examples": "Get user config value\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">text</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_config_string</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_game.text&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;default text&quot;</span><span class=\"p\">))</span>\n</code></pre></div>\n\nStart the engine with a bootstrap config override and add a custom config value\n<div class=\"codehilite\"><pre><span></span><code>$ dmengine --config<span class=\"o\">=</span>bootstrap.main_collection<span class=\"o\">=</span>/mytest.collectionc --config<span class=\"o\">=</span>mygame.testmode<span class=\"o\">=</span><span class=\"m\">1</span>\n</code></pre></div>\n\nRead the custom config value from the command line\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">testmode</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_config_int</span><span class=\"p\">(</span><span class=\"s2\">&quot;mygame.testmode&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
179
+ "replaces": "",
180
+ "error": "",
181
+ "tparams": [],
182
+ "members": [],
183
+ "notes": [],
184
+ "language": ""
185
+ },
186
+ {
187
+ "type": "FUNCTION",
188
+ "name": "sys.get_config_int",
189
+ "brief": "get integer config value with optional default value",
190
+ "description": "Get integer config value from the game.project configuration file with optional default value",
191
+ "returnvalues": [
192
+ {
193
+ "name": "value",
194
+ "doc": "config value as an integer. default_value if the config key does not exist. 0 if no default value was supplied.",
195
+ "types": ["number"]
196
+ }
197
+ ],
198
+ "parameters": [
199
+ {
200
+ "name": "key",
201
+ "doc": "key to get value for. The syntax is SECTION.KEY",
202
+ "types": ["string"],
203
+ "is_optional": "False"
204
+ },
205
+ {
206
+ "name": "default_value",
207
+ "doc": "(optional) default value to return if the value does not exist",
208
+ "types": ["number"],
209
+ "is_optional": "True"
210
+ }
211
+ ],
212
+ "examples": "Get user config value\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\">sys</span><span class=\"p\">.</span><span class=\"n\">get_config_int</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_game.speed&quot;</span><span class=\"p\">,</span> <span class=\"mi\">20</span><span class=\"p\">)</span> <span class=\"c1\">-- with default value</span>\n</code></pre></div>\n\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">testmode</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_config_int</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_game.testmode&quot;</span><span class=\"p\">)</span> <span class=\"c1\">-- without default value</span>\n<span class=\"kr\">if</span> <span class=\"n\">testmode</span> <span class=\"o\">~=</span> <span class=\"kc\">nil</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- do stuff</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
213
+ "replaces": "",
214
+ "error": "",
215
+ "tparams": [],
216
+ "members": [],
217
+ "notes": [],
218
+ "language": ""
219
+ },
220
+ {
221
+ "type": "FUNCTION",
222
+ "name": "sys.get_config_number",
223
+ "brief": "get number config value with optional default value",
224
+ "description": "Get number config value from the game.project configuration file with optional default value",
225
+ "returnvalues": [
226
+ {
227
+ "name": "value",
228
+ "doc": "config value as an number. default_value if the config key does not exist. 0 if no default value was supplied.",
229
+ "types": ["number"]
230
+ }
231
+ ],
232
+ "parameters": [
233
+ {
234
+ "name": "key",
235
+ "doc": "key to get value for. The syntax is SECTION.KEY",
236
+ "types": ["string"],
237
+ "is_optional": "False"
238
+ },
239
+ {
240
+ "name": "default_value",
241
+ "doc": "(optional) default value to return if the value does not exist",
242
+ "types": ["number"],
243
+ "is_optional": "True"
244
+ }
245
+ ],
246
+ "examples": "Get user config value\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\">sys</span><span class=\"p\">.</span><span class=\"n\">get_config_number</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_game.speed&quot;</span><span class=\"p\">,</span> <span class=\"mf\">20.0</span><span class=\"p\">)</span>\n</code></pre></div>",
247
+ "replaces": "",
248
+ "error": "",
249
+ "tparams": [],
250
+ "members": [],
251
+ "notes": [],
252
+ "language": ""
253
+ },
254
+ {
255
+ "type": "FUNCTION",
256
+ "name": "sys.get_config_boolean",
257
+ "brief": "get boolean config value with optional default value",
258
+ "description": "Get boolean config value from the game.project configuration file with optional default value",
259
+ "returnvalues": [
260
+ {
261
+ "name": "value",
262
+ "doc": "config value as a boolean. default_value if the config key does not exist. false if no default value was supplied.",
263
+ "types": ["boolean"]
264
+ }
265
+ ],
266
+ "parameters": [
267
+ {
268
+ "name": "key",
269
+ "doc": "key to get value for. The syntax is SECTION.KEY",
270
+ "types": ["string"],
271
+ "is_optional": "False"
272
+ },
273
+ {
274
+ "name": "default_value",
275
+ "doc": "(optional) default value to return if the value does not exist",
276
+ "types": ["boolean"],
277
+ "is_optional": "True"
278
+ }
279
+ ],
280
+ "examples": "Get user config value\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">vsync</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_config_boolean</span><span class=\"p\">(</span><span class=\"s2\">&quot;display.vsync&quot;</span><span class=\"p\">,</span> <span class=\"kc\">false</span><span class=\"p\">)</span>\n</code></pre></div>",
281
+ "replaces": "",
282
+ "error": "",
283
+ "tparams": [],
284
+ "members": [],
285
+ "notes": [],
286
+ "language": ""
287
+ },
288
+ {
289
+ "type": "FUNCTION",
290
+ "name": "sys.open_url",
291
+ "brief": "open url in default application",
292
+ "description": "Open URL in default application, typically a browser",
293
+ "returnvalues": [
294
+ {
295
+ "name": "success",
296
+ "doc": "a boolean indicating if the url could be opened or not",
297
+ "types": ["boolean"]
298
+ }
299
+ ],
300
+ "parameters": [
301
+ { "name": "url", "doc": "url to open", "types": ["string"], "is_optional": "False" },
302
+ {
303
+ "name": "attributes",
304
+ "doc": "table with attributes\n<code>target</code>\n- <span class=\"type\">string</span> <span class=\"icon-html5\"></span>: Optional. Specifies the target attribute or the name of the window. The following values are supported:\n- <code>_self</code> - (default value) URL replaces the current page.\n- <code>_blank</code> - URL is loaded into a new window, or tab.\n- <code>_parent</code> - URL is loaded into the parent frame.\n- <code>_top</code> - URL replaces any framesets that may be loaded.\n- <code>name</code> - The name of the window (Note: the name does not specify the title of the new window).",
305
+ "types": ["table"],
306
+ "is_optional": "True"
307
+ }
308
+ ],
309
+ "examples": "Open an URL:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">success</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">open_url</span><span class=\"p\">(</span><span class=\"s2\">&quot;http://www.defold.com&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">target</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_blank&quot;</span><span class=\"p\">})</span>\n<span class=\"kr\">if</span> <span class=\"ow\">not</span> <span class=\"n\">success</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- could not open the url...</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
310
+ "replaces": "",
311
+ "error": "",
312
+ "tparams": [],
313
+ "members": [],
314
+ "notes": [],
315
+ "language": ""
316
+ },
317
+ {
318
+ "type": "FUNCTION",
319
+ "name": "sys.load_resource",
320
+ "brief": "loads resource from game data",
321
+ "description": "Loads a custom resource. Specify the full filename of the resource that you want\nto load. When loaded, the file data is returned as a string.\nIf loading fails, the function returns <code>nil</code> plus the error message.\nIn order for the engine to include custom resources in the build process, you need\nto specify them in the \"custom_resources\" key in your \"game.project\" settings file.\nYou can specify single resource files or directories. If a directory is included\nin the resource list, all files and directories in that directory is recursively\nincluded:\nFor example \"main/data/,assets/level_data.json\".",
322
+ "returnvalues": [
323
+ {
324
+ "name": "data",
325
+ "doc": "loaded data, or <code>nil</code> if the resource could not be loaded",
326
+ "types": ["string", "nil"]
327
+ },
328
+ {
329
+ "name": "error",
330
+ "doc": "the error message, or <code>nil</code> if no error occurred",
331
+ "types": ["string", "nil"]
332
+ }
333
+ ],
334
+ "parameters": [
335
+ {
336
+ "name": "filename",
337
+ "doc": "resource to load, full path",
338
+ "types": ["string"],
339
+ "is_optional": "False"
340
+ }
341
+ ],
342
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- Load level data into a string</span>\n<span class=\"kd\">local</span> <span class=\"n\">data</span><span class=\"p\">,</span> <span class=\"nb\">error</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">load_resource</span><span class=\"p\">(</span><span class=\"s2\">&quot;/assets/level_data.json&quot;</span><span class=\"p\">)</span>\n<span class=\"c1\">-- Decode json string to a Lua table</span>\n<span class=\"kr\">if</span> <span class=\"n\">data</span> <span class=\"kr\">then</span>\n <span class=\"kd\">local</span> <span class=\"n\">data_table</span> <span class=\"o\">=</span> <span class=\"n\">json</span><span class=\"p\">.</span><span class=\"n\">decode</span><span class=\"p\">(</span><span class=\"n\">data</span><span class=\"p\">)</span>\n <span class=\"n\">pprint</span><span class=\"p\">(</span><span class=\"n\">data_table</span><span class=\"p\">)</span>\n<span class=\"kr\">else</span>\n <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"nb\">error</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
343
+ "replaces": "",
344
+ "error": "",
345
+ "tparams": [],
346
+ "members": [],
347
+ "notes": [],
348
+ "language": ""
349
+ },
350
+ {
351
+ "type": "FUNCTION",
352
+ "name": "sys.get_sys_info",
353
+ "brief": "get system information",
354
+ "description": "Returns a table with system information.",
355
+ "returnvalues": [
356
+ {
357
+ "name": "sys_info",
358
+ "doc": "table with system information in the following fields:\n<dl>\n<dt><code>device_model</code></dt>\n<dd><span class=\"type\">string</span> <span class=\"icon-ios\"></span><span class=\"icon-android\"></span> Only available on iOS and Android.</dd>\n<dt><code>manufacturer</code></dt>\n<dd><span class=\"type\">string</span> <span class=\"icon-ios\"></span><span class=\"icon-android\"></span> Only available on iOS and Android.</dd>\n<dt><code>system_name</code></dt>\n<dd><span class=\"type\">string</span> The system name: \"Darwin\", \"Linux\", \"Windows\", \"HTML5\", \"Android\" or \"iPhone OS\"</dd>\n<dt><code>system_version</code></dt>\n<dd><span class=\"type\">string</span> The system OS version.</dd>\n<dt><code>api_version</code></dt>\n<dd><span class=\"type\">string</span> The API version on the system.</dd>\n<dt><code>language</code></dt>\n<dd><span class=\"type\">string</span> Two character ISO-639 format, i.e. \"en\".</dd>\n<dt><code>device_language</code></dt>\n<dd><span class=\"type\">string</span> Two character ISO-639 format (i.e. \"sr\") and, if applicable, followed by a dash (-) and an ISO 15924 script code (i.e. \"sr-Cyrl\" or \"sr-Latn\"). Reflects the device preferred language.</dd>\n<dt><code>territory</code></dt>\n<dd><span class=\"type\">string</span> Two character ISO-3166 format, i.e. \"US\".</dd>\n<dt><code>gmt_offset</code></dt>\n<dd><span class=\"type\">number</span> The current offset from GMT (Greenwich Mean Time), in minutes.</dd>\n<dt><code>device_ident</code></dt>\n<dd><span class=\"type\">string</span> This value secured by OS. <span class=\"icon-ios\"></span> \"identifierForVendor\" on iOS. <span class=\"icon-android\"></span> \"android_id\" on Android. On Android, you need to add <code>READ_PHONE_STATE</code> permission to be able to get this data. We don't use this permission in Defold.</dd>\n<dt><code>user_agent</code></dt>\n<dd><span class=\"type\">string</span> <span class=\"icon-html5\"></span> The HTTP user agent, i.e. \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/602.4.8 (KHTML, like Gecko) Version/10.0.3 Safari/602.4.8\"</dd>\n</dl>",
359
+ "types": ["table"]
360
+ }
361
+ ],
362
+ "parameters": [
363
+ {
364
+ "name": "options",
365
+ "doc": "optional options table\n- ignore_secure <span class=\"type\">boolean</span> this flag ignores values might be secured by OS e.g. <code>device_ident</code>",
366
+ "types": ["table"],
367
+ "is_optional": "True"
368
+ }
369
+ ],
370
+ "examples": "How to get system information:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">info</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_sys_info</span><span class=\"p\">()</span>\n<span class=\"kr\">if</span> <span class=\"n\">info</span><span class=\"p\">.</span><span class=\"n\">system_name</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;HTML5&quot;</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- We are running in a browser.</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
371
+ "replaces": "",
372
+ "error": "",
373
+ "tparams": [],
374
+ "members": [],
375
+ "notes": [],
376
+ "language": ""
377
+ },
378
+ {
379
+ "type": "FUNCTION",
380
+ "name": "sys.get_engine_info",
381
+ "brief": "get engine information",
382
+ "description": "Returns a table with engine information.",
383
+ "returnvalues": [
384
+ {
385
+ "name": "engine_info",
386
+ "doc": "table with engine information in the following fields:\n<dl>\n<dt><code>version</code></dt>\n<dd><span class=\"type\">string</span> The current Defold engine version, i.e. \"1.2.96\"</dd>\n<dt><code>version_sha1</code></dt>\n<dd><span class=\"type\">string</span> The SHA1 for the current engine build, i.e. \"0060183cce2e29dbd09c85ece83cbb72068ee050\"</dd>\n<dt><code>is_debug</code></dt>\n<dd><span class=\"type\">boolean</span> If the engine is a debug or release version</dd>\n</dl>",
387
+ "types": ["table"]
388
+ }
389
+ ],
390
+ "parameters": [],
391
+ "examples": "How to retrieve engine information:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- Update version text label so our testers know what version we&#39;re running</span>\n<span class=\"kd\">local</span> <span class=\"n\">engine_info</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_engine_info</span><span class=\"p\">()</span>\n<span class=\"kd\">local</span> <span class=\"n\">version_str</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;Defold &quot;</span> <span class=\"o\">..</span> <span class=\"n\">engine_info</span><span class=\"p\">.</span><span class=\"n\">version</span> <span class=\"o\">..</span> <span class=\"s2\">&quot;</span><span class=\"se\">\\n</span><span class=\"s2\">&quot;</span> <span class=\"o\">..</span> <span class=\"n\">engine_info</span><span class=\"p\">.</span><span class=\"n\">version_sha1</span>\n<span class=\"n\">gui</span><span class=\"p\">.</span><span class=\"n\">set_text</span><span class=\"p\">(</span><span class=\"n\">gui</span><span class=\"p\">.</span><span class=\"n\">get_node</span><span class=\"p\">(</span><span class=\"s2\">&quot;version&quot;</span><span class=\"p\">),</span> <span class=\"n\">version_str</span><span class=\"p\">)</span>\n</code></pre></div>",
392
+ "replaces": "",
393
+ "error": "",
394
+ "tparams": [],
395
+ "members": [],
396
+ "notes": [],
397
+ "language": ""
398
+ },
399
+ {
400
+ "type": "FUNCTION",
401
+ "name": "sys.get_application_info",
402
+ "brief": "get application information",
403
+ "description": "Returns a table with application information for the requested app.\n<span class=\"icon-ios\"></span> On iOS, the <code>app_string</code> is an url scheme for the app that is queried. Your\ngame needs to list the schemes that are queried in an <code>LSApplicationQueriesSchemes</code> array\nin a custom \"Info.plist\".\n<span class=\"icon-android\"></span> On Android, the <code>app_string</code> is the package identifier for the app.",
404
+ "returnvalues": [
405
+ {
406
+ "name": "app_info",
407
+ "doc": "table with application information in the following fields:\n<dl>\n<dt><code>installed</code></dt>\n<dd><span class=\"type\">boolean</span> <code>true</code> if the application is installed, <code>false</code> otherwise.</dd>\n</dl>",
408
+ "types": ["table"]
409
+ }
410
+ ],
411
+ "parameters": [
412
+ {
413
+ "name": "app_string",
414
+ "doc": "platform specific string with application package or query, see above for details.",
415
+ "types": ["string"],
416
+ "is_optional": "False"
417
+ }
418
+ ],
419
+ "examples": "Check if twitter is installed:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">sysinfo</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_sys_info</span><span class=\"p\">()</span>\n<span class=\"n\">twitter</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n\n<span class=\"kr\">if</span> <span class=\"n\">sysinfo</span><span class=\"p\">.</span><span class=\"n\">system_name</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;Android&quot;</span> <span class=\"kr\">then</span>\n <span class=\"n\">twitter</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_application_info</span><span class=\"p\">(</span><span class=\"s2\">&quot;com.twitter.android&quot;</span><span class=\"p\">)</span>\n<span class=\"kr\">elseif</span> <span class=\"n\">sysinfo</span><span class=\"p\">.</span><span class=\"n\">system_name</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;iPhone OS&quot;</span> <span class=\"kr\">then</span>\n <span class=\"n\">twitter</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_application_info</span><span class=\"p\">(</span><span class=\"s2\">&quot;twitter:&quot;</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">if</span> <span class=\"n\">twitter</span><span class=\"p\">.</span><span class=\"n\">installed</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- twitter is installed!</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\n<span class=\"icon-ios\"></span> Info.plist for the iOS app needs to list the schemes that are queried:\n<div class=\"codehilite\"><pre><span></span><code>...\n<span class=\"nt\">&lt;key&gt;</span>LSApplicationQueriesSchemes<span class=\"nt\">&lt;/key&gt;</span>\n <span class=\"nt\">&lt;array&gt;</span>\n <span class=\"nt\">&lt;string&gt;</span>twitter<span class=\"nt\">&lt;/string&gt;</span>\n <span class=\"nt\">&lt;/array&gt;</span>\n...\n</code></pre></div>",
420
+ "replaces": "",
421
+ "error": "",
422
+ "tparams": [],
423
+ "members": [],
424
+ "notes": [],
425
+ "language": ""
426
+ },
427
+ {
428
+ "type": "FUNCTION",
429
+ "name": "sys.get_ifaddrs",
430
+ "brief": "enumerate network interfaces",
431
+ "description": "Returns an array of tables with information on network interfaces.",
432
+ "returnvalues": [
433
+ {
434
+ "name": "ifaddrs",
435
+ "doc": "an array of tables. Each table entry contain the following fields:\n<dl>\n<dt><code>name</code></dt>\n<dd><span class=\"type\">string</span> Interface name</dd>\n<dt><code>address</code></dt>\n<dd><span class=\"type\">string</span> IP address. <span class=\"icon-attention\"></span> might be <code>nil</code> if not available.</dd>\n<dt><code>mac</code></dt>\n<dd><span class=\"type\">string</span> Hardware MAC address. <span class=\"icon-attention\"></span> might be nil if not available.</dd>\n<dt><code>up</code></dt>\n<dd><span class=\"type\">boolean</span> <code>true</code> if the interface is up (available to transmit and receive data), <code>false</code> otherwise.</dd>\n<dt><code>running</code></dt>\n<dd><span class=\"type\">boolean</span> <code>true</code> if the interface is running, <code>false</code> otherwise.</dd>\n</dl>",
436
+ "types": ["table"]
437
+ }
438
+ ],
439
+ "parameters": [],
440
+ "examples": "How to get the IP address of interface \"en0\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">ifaddrs</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_ifaddrs</span><span class=\"p\">()</span>\n<span class=\"kr\">for</span> <span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">interface</span> <span class=\"kr\">in</span> <span class=\"nb\">ipairs</span><span class=\"p\">(</span><span class=\"n\">ifaddrs</span><span class=\"p\">)</span> <span class=\"kr\">do</span>\n <span class=\"kr\">if</span> <span class=\"n\">interface</span><span class=\"p\">.</span><span class=\"n\">name</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;en0&quot;</span> <span class=\"kr\">then</span>\n <span class=\"kd\">local</span> <span class=\"n\">ip</span> <span class=\"o\">=</span> <span class=\"n\">interface</span><span class=\"p\">.</span><span class=\"n\">address</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
441
+ "replaces": "",
442
+ "error": "",
443
+ "tparams": [],
444
+ "members": [],
445
+ "notes": [],
446
+ "language": ""
447
+ },
448
+ {
449
+ "type": "FUNCTION",
450
+ "name": "sys.set_error_handler",
451
+ "brief": "set the error handler",
452
+ "description": "Set the Lua error handler function.\nThe error handler is a function which is called whenever a lua runtime error occurs.",
453
+ "returnvalues": [],
454
+ "parameters": [
455
+ {
456
+ "name": "error_handler",
457
+ "doc": "the function to be called on error\n<dl>\n<dt><code>source</code></dt>\n<dd><span class=\"type\">string</span> The runtime context of the error. Currently, this is always <code>\"lua\"</code>.</dd>\n<dt><code>message</code></dt>\n<dd><span class=\"type\">string</span> The source file, line number and error message.</dd>\n<dt><code>traceback</code></dt>\n<dd><span class=\"type\">string</span> The stack traceback.</dd>\n</dl>",
458
+ "types": ["function(source, message, traceback)"],
459
+ "is_optional": "False"
460
+ }
461
+ ],
462
+ "examples": "Install error handler that just prints the errors\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"kr\">function</span> <span class=\"nf\">my_error_handler</span><span class=\"p\">(</span><span class=\"n\">source</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">,</span> <span class=\"n\">traceback</span><span class=\"p\">)</span>\n <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">source</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; lua</span>\n <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; main/my.script:10: attempt to perform arithmetic on a string value</span>\n <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">traceback</span><span class=\"p\">)</span> <span class=\"c1\">--&gt; stack traceback:</span>\n <span class=\"c1\">--&gt; main/test.script:10: in function &#39;boom&#39;</span>\n <span class=\"c1\">--&gt; main/test.script:15: in function &lt;main/my.script:13&gt;</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kd\">local</span> <span class=\"kr\">function</span> <span class=\"nf\">boom</span><span class=\"p\">()</span>\n <span class=\"kr\">return</span> <span class=\"mi\">10</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;string&quot;</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\">sys</span><span class=\"p\">.</span><span class=\"n\">set_error_handler</span><span class=\"p\">(</span><span class=\"n\">my_error_handler</span><span class=\"p\">)</span>\n <span class=\"n\">boom</span><span class=\"p\">()</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
463
+ "replaces": "",
464
+ "error": "",
465
+ "tparams": [],
466
+ "members": [],
467
+ "notes": [],
468
+ "language": ""
469
+ },
470
+ {
471
+ "type": "FUNCTION",
472
+ "name": "sys.set_connectivity_host",
473
+ "brief": "set host to check for network connectivity against",
474
+ "description": "Sets the host that is used to check for network connectivity against.",
475
+ "returnvalues": [],
476
+ "parameters": [
477
+ {
478
+ "name": "host",
479
+ "doc": "hostname to check against",
480
+ "types": ["string"],
481
+ "is_optional": "False"
482
+ }
483
+ ],
484
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">set_connectivity_host</span><span class=\"p\">(</span><span class=\"s2\">&quot;www.google.com&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
485
+ "replaces": "",
486
+ "error": "",
487
+ "tparams": [],
488
+ "members": [],
489
+ "notes": [],
490
+ "language": ""
491
+ },
492
+ {
493
+ "type": "FUNCTION",
494
+ "name": "sys.get_connectivity",
495
+ "brief": "get current network connectivity status",
496
+ "description": "<span class=\"icon-ios\"></span> <span class=\"icon-android\"></span> Returns the current network connectivity status\non mobile platforms.\nOn desktop, this function always return <code>sys.NETWORK_CONNECTED</code>.",
497
+ "returnvalues": [
498
+ {
499
+ "name": "status",
500
+ "doc": "network connectivity status:\n<ul>\n<li><code>sys.NETWORK_DISCONNECTED</code> (no network connection is found)</li>\n<li><code>sys.NETWORK_CONNECTED_CELLULAR</code> (connected through mobile cellular)</li>\n<li><code>sys.NETWORK_CONNECTED</code> (otherwise, Wifi)</li>\n</ul>",
501
+ "types": ["constant"]
502
+ }
503
+ ],
504
+ "parameters": [],
505
+ "examples": "Check if we are connected through a cellular connection\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">if</span> <span class=\"p\">(</span><span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">NETWORK_CONNECTED_CELLULAR</span> <span class=\"o\">==</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">get_connectivity</span><span class=\"p\">())</span> <span class=\"kr\">then</span>\n <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;Connected via cellular, avoid downloading big files!&quot;</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
506
+ "replaces": "",
507
+ "error": "",
508
+ "tparams": [],
509
+ "members": [],
510
+ "notes": [],
511
+ "language": ""
512
+ },
513
+ {
514
+ "type": "FUNCTION",
515
+ "name": "sys.exit",
516
+ "brief": "exits application",
517
+ "description": "Terminates the game application and reports the specified <code>code</code> to the OS.",
518
+ "returnvalues": [],
519
+ "parameters": [
520
+ {
521
+ "name": "code",
522
+ "doc": "exit code to report to the OS, 0 means clean exit",
523
+ "types": ["number"],
524
+ "is_optional": "False"
525
+ }
526
+ ],
527
+ "examples": "This examples demonstrates how to exit the application when some kind of quit messages is received (maybe from gui or similar):\n<div class=\"codehilite\"><pre><span></span><code><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;quit&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">exit</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</code></pre></div>",
528
+ "replaces": "",
529
+ "error": "",
530
+ "tparams": [],
531
+ "members": [],
532
+ "notes": [],
533
+ "language": ""
534
+ },
535
+ {
536
+ "type": "FUNCTION",
537
+ "name": "sys.reboot",
538
+ "brief": "reboot engine with arguments",
539
+ "description": "Reboots the game engine with a specified set of arguments.\nArguments will be translated into command line arguments. Calling reboot\nfunction is equivalent to starting the engine with the same arguments.\nOn startup the engine reads configuration from \"game.project\" in the\nproject root.",
540
+ "returnvalues": [],
541
+ "parameters": [
542
+ { "name": "arg1", "doc": "argument 1", "types": ["string"], "is_optional": "True" },
543
+ { "name": "arg2", "doc": "argument 2", "types": ["string"], "is_optional": "True" },
544
+ { "name": "arg3", "doc": "argument 3", "types": ["string"], "is_optional": "True" },
545
+ { "name": "arg4", "doc": "argument 4", "types": ["string"], "is_optional": "True" },
546
+ { "name": "arg5", "doc": "argument 5", "types": ["string"], "is_optional": "True" },
547
+ { "name": "arg6", "doc": "argument 6", "types": ["string"], "is_optional": "True" }
548
+ ],
549
+ "examples": "How to reboot engine with a specific bootstrap collection.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">arg1</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;--config=bootstrap.main_collection=/my.collectionc&#39;</span>\n<span class=\"kd\">local</span> <span class=\"n\">arg2</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;build/game.projectc&#39;</span>\n<span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">reboot</span><span class=\"p\">(</span><span class=\"n\">arg1</span><span class=\"p\">,</span> <span class=\"n\">arg2</span><span class=\"p\">)</span>\n</code></pre></div>",
550
+ "replaces": "",
551
+ "error": "",
552
+ "tparams": [],
553
+ "members": [],
554
+ "notes": [],
555
+ "language": ""
556
+ },
557
+ {
558
+ "type": "FUNCTION",
559
+ "name": "sys.set_vsync_swap_interval",
560
+ "brief": "set vsync swap interval",
561
+ "description": "Set the vsync swap interval. The interval with which to swap the front and back buffers\nin sync with vertical blanks (v-blank), the hardware event where the screen image is updated\nwith data from the front buffer. A value of 1 swaps the buffers at every v-blank, a value of\n2 swaps the buffers every other v-blank and so on. A value of 0 disables waiting for v-blank\nbefore swapping the buffers. Default value is 1.\nWhen setting the swap interval to 0 and having <code>vsync</code> disabled in\n\"game.project\", the engine will try to respect the set frame cap value from\n\"game.project\" in software instead.\nThis setting may be overridden by driver settings.",
562
+ "returnvalues": [],
563
+ "parameters": [
564
+ {
565
+ "name": "swap_interval",
566
+ "doc": "target swap interval.",
567
+ "types": ["number"],
568
+ "is_optional": "False"
569
+ }
570
+ ],
571
+ "examples": "Setting the swap intervall to swap every v-blank\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">set_vsync_swap_interval</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">)</span>\n</code></pre></div>",
572
+ "replaces": "",
573
+ "error": "",
574
+ "tparams": [],
575
+ "members": [],
576
+ "notes": [],
577
+ "language": ""
578
+ },
579
+ {
580
+ "type": "FUNCTION",
581
+ "name": "sys.set_update_frequency",
582
+ "brief": "set update frequency",
583
+ "description": "Set game update-frequency (frame cap). This option is equivalent to <code>display.update_frequency</code> in\nthe \"game.project\" settings but set in run-time. If <code>Vsync</code> checked in \"game.project\", the rate will\nbe clamped to a swap interval that matches any detected main monitor refresh rate. If <code>Vsync</code> is\nunchecked the engine will try to respect the rate in software using timers. There is no\nguarantee that the frame cap will be achieved depending on platform specifics and hardware settings.",
584
+ "returnvalues": [],
585
+ "parameters": [
586
+ {
587
+ "name": "frequency",
588
+ "doc": "target frequency. 60 for 60 fps",
589
+ "types": ["number"],
590
+ "is_optional": "False"
591
+ }
592
+ ],
593
+ "examples": "Setting the update frequency to 60 frames per second\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">set_update_frequency</span><span class=\"p\">(</span><span class=\"mi\">60</span><span class=\"p\">)</span>\n</code></pre></div>",
594
+ "replaces": "",
595
+ "error": "",
596
+ "tparams": [],
597
+ "members": [],
598
+ "notes": [],
599
+ "language": ""
600
+ },
601
+ {
602
+ "type": "FUNCTION",
603
+ "name": "sys.serialize",
604
+ "brief": "serializes a lua table to a buffer and returns it",
605
+ "description": "The buffer can later deserialized by <code>sys.deserialize</code>.\nThis function has all the same limitations as <code>sys.save</code>.\nThis function will raise a Lua error if an error occurs while serializing the table.",
606
+ "returnvalues": [{ "name": "buffer", "doc": "serialized data buffer", "types": ["string"] }],
607
+ "parameters": [
608
+ {
609
+ "name": "table",
610
+ "doc": "lua table to serialize",
611
+ "types": ["table"],
612
+ "is_optional": "False"
613
+ }
614
+ ],
615
+ "examples": "Serialize table:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">my_table</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n<span class=\"nb\">table.insert</span><span class=\"p\">(</span><span class=\"n\">my_table</span><span class=\"p\">,</span> <span class=\"s2\">&quot;my_value&quot;</span><span class=\"p\">)</span>\n<span class=\"kd\">local</span> <span class=\"n\">buffer</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">serialize</span><span class=\"p\">(</span><span class=\"n\">my_table</span><span class=\"p\">)</span>\n</code></pre></div>",
616
+ "replaces": "",
617
+ "error": "",
618
+ "tparams": [],
619
+ "members": [],
620
+ "notes": [],
621
+ "language": ""
622
+ },
623
+ {
624
+ "type": "FUNCTION",
625
+ "name": "sys.deserialize",
626
+ "brief": "deserializes buffer into a lua table",
627
+ "description": "This function will raise a Lua error if an error occurs while deserializing the buffer.",
628
+ "returnvalues": [
629
+ { "name": "table", "doc": "lua table with deserialized data", "types": ["table"] }
630
+ ],
631
+ "parameters": [
632
+ {
633
+ "name": "buffer",
634
+ "doc": "buffer to deserialize from",
635
+ "types": ["string"],
636
+ "is_optional": "False"
637
+ }
638
+ ],
639
+ "examples": "Deserialize a lua table that was previously serialized:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">buffer</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">serialize</span><span class=\"p\">(</span><span class=\"n\">my_table</span><span class=\"p\">)</span>\n<span class=\"kd\">local</span> <span class=\"n\">table</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">deserialize</span><span class=\"p\">(</span><span class=\"n\">buffer</span><span class=\"p\">)</span>\n</code></pre></div>",
640
+ "replaces": "",
641
+ "error": "",
642
+ "tparams": [],
643
+ "members": [],
644
+ "notes": [],
645
+ "language": ""
646
+ },
647
+ {
648
+ "type": "CONSTANT",
649
+ "name": "sys.NETWORK_DISCONNECTED",
650
+ "brief": "no network connection found",
651
+ "description": "no network connection found",
652
+ "returnvalues": [],
653
+ "parameters": [],
654
+ "examples": "",
655
+ "replaces": "",
656
+ "error": "",
657
+ "tparams": [],
658
+ "members": [],
659
+ "notes": [],
660
+ "language": ""
661
+ },
662
+ {
663
+ "type": "CONSTANT",
664
+ "name": "sys.NETWORK_CONNECTED_CELLULAR",
665
+ "brief": "network connected through mobile cellular",
666
+ "description": "network connected through mobile cellular",
667
+ "returnvalues": [],
668
+ "parameters": [],
669
+ "examples": "",
670
+ "replaces": "",
671
+ "error": "",
672
+ "tparams": [],
673
+ "members": [],
674
+ "notes": [],
675
+ "language": ""
676
+ },
677
+ {
678
+ "type": "CONSTANT",
679
+ "name": "sys.NETWORK_CONNECTED",
680
+ "brief": "network connected through other, non cellular, connection",
681
+ "description": "network connected through other, non cellular, connection",
682
+ "returnvalues": [],
683
+ "parameters": [],
684
+ "examples": "",
685
+ "replaces": "",
686
+ "error": "",
687
+ "tparams": [],
688
+ "members": [],
689
+ "notes": [],
690
+ "language": ""
691
+ },
692
+ {
693
+ "type": "FUNCTION",
694
+ "name": "sys.load_buffer",
695
+ "brief": "loads a buffer from a resource or disk path",
696
+ "description": "The sys.load_buffer function will first try to load the resource\nfrom any of the mounted resource locations and return the data if\nany matching entries found. If not, the path will be tried\nas is from the primary disk on the device.\nIn order for the engine to include custom resources in the build process, you need\nto specify them in the \"custom_resources\" key in your \"game.project\" settings file.\nYou can specify single resource files or directories. If a directory is included\nin the resource list, all files and directories in that directory is recursively\nincluded:\nFor example \"main/data/,assets/level_data.json\".",
697
+ "returnvalues": [{ "name": "buffer", "doc": "the buffer with data", "types": ["buffer"] }],
698
+ "parameters": [
699
+ {
700
+ "name": "path",
701
+ "doc": "the path to load the buffer from",
702
+ "types": ["string"],
703
+ "is_optional": "False"
704
+ }
705
+ ],
706
+ "examples": "Load binary data from a custom project resource:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">my_buffer</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">load_buffer</span><span class=\"p\">(</span><span class=\"s2\">&quot;/assets/my_level_data.bin&quot;</span><span class=\"p\">)</span>\n<span class=\"kd\">local</span> <span class=\"n\">data_str</span> <span class=\"o\">=</span> <span class=\"n\">buffer</span><span class=\"p\">.</span><span class=\"n\">get_bytes</span><span class=\"p\">(</span><span class=\"n\">my_buffer</span><span class=\"p\">,</span> <span class=\"s2\">&quot;data&quot;</span><span class=\"p\">)</span>\n<span class=\"kd\">local</span> <span class=\"n\">has_my_header</span> <span class=\"o\">=</span> <span class=\"nb\">string.sub</span><span class=\"p\">(</span><span class=\"n\">data_str</span><span class=\"p\">,</span><span class=\"mi\">1</span><span class=\"p\">,</span><span class=\"mi\">6</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;D3F0LD&quot;</span>\n</code></pre></div>\n\nLoad binary data from non-custom resource files on disk:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">asset_1</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">load_buffer</span><span class=\"p\">(</span><span class=\"s2\">&quot;folder_next_to_binary/my_level_asset.txt&quot;</span><span class=\"p\">)</span>\n<span class=\"kd\">local</span> <span class=\"n\">asset_2</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">load_buffer</span><span class=\"p\">(</span><span class=\"s2\">&quot;/my/absolute/path&quot;</span><span class=\"p\">)</span>\n</code></pre></div>",
707
+ "replaces": "",
708
+ "error": "",
709
+ "tparams": [],
710
+ "members": [],
711
+ "notes": [],
712
+ "language": ""
713
+ },
714
+ {
715
+ "type": "FUNCTION",
716
+ "name": "sys.load_buffer_async",
717
+ "brief": "loads a buffer from a resource or disk path asynchronously",
718
+ "description": "The sys.load_buffer function will first try to load the resource\nfrom any of the mounted resource locations and return the data if\nany matching entries found. If not, the path will be tried\nas is from the primary disk on the device.\nIn order for the engine to include custom resources in the build process, you need\nto specify them in the \"custom_resources\" key in your \"game.project\" settings file.\nYou can specify single resource files or directories. If a directory is included\nin the resource list, all files and directories in that directory is recursively\nincluded:\nFor example \"main/data/,assets/level_data.json\".\nNote that issuing multiple requests of the same resource will yield\nindividual buffers per request. There is no implic caching of the buffers\nbased on request path.",
719
+ "returnvalues": [{ "name": "handle", "doc": "a handle to the request", "types": ["number"] }],
720
+ "parameters": [
721
+ {
722
+ "name": "path",
723
+ "doc": "the path to load the buffer from",
724
+ "types": ["string"],
725
+ "is_optional": "False"
726
+ },
727
+ {
728
+ "name": "status_callback",
729
+ "doc": "A status callback that will be invoked when a request has been handled, or an error occured. The result is a table containing:\n<dl>\n<dt><code>status</code></dt>\n<dd><span class=\"type\">number</span> The status of the request, supported values are:</dd>\n</dl>\n<ul>\n<li><code>resource.REQUEST_STATUS_FINISHED</code></li>\n<li><code>resource.REQUEST_STATUS_ERROR_IO_ERROR</code></li>\n<li><code>resource.REQUEST_STATUS_ERROR_NOT_FOUND</code></li>\n</ul>\n<dl>\n<dt><code>buffer</code></dt>\n<dd><span class=\"type\">buffer</span> If the request was successfull, this will contain the request payload in a buffer object, and nil otherwise. Make sure to check the status before doing anything with the buffer value!</dd>\n</dl>",
730
+ "types": ["function(self, request_id, result)"],
731
+ "is_optional": "False"
732
+ }
733
+ ],
734
+ "examples": "Load binary data from a custom project resource and update a texture resource:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">my_callback</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">request_id</span><span class=\"p\">,</span> <span class=\"n\">result</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">result</span><span class=\"p\">.</span><span class=\"n\">status</span> <span class=\"o\">==</span> <span class=\"n\">resource</span><span class=\"p\">.</span><span class=\"n\">REQUEST_STATUS_FINISHED</span> <span class=\"kr\">then</span>\n <span class=\"n\">resource</span><span class=\"p\">.</span><span class=\"n\">set_texture</span><span class=\"p\">(</span><span class=\"s2\">&quot;/my_texture&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"p\">...</span> <span class=\"p\">},</span> <span class=\"n\">result</span><span class=\"p\">.</span><span class=\"n\">buf</span><span class=\"p\">)</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kd\">local</span> <span class=\"n\">my_request</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">load_buffer_async</span><span class=\"p\">(</span><span class=\"s2\">&quot;/assets/my_level_data.bin&quot;</span><span class=\"p\">,</span> <span class=\"n\">my_callback</span><span class=\"p\">)</span>\n</code></pre></div>\n\nLoad binary data from non-custom resource files on disk:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">my_callback</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">request_id</span><span class=\"p\">,</span> <span class=\"n\">result</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">result</span><span class=\"p\">.</span><span class=\"n\">status</span> <span class=\"o\">~=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">REQUEST_STATUS_FINISHED</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- uh oh! File could not be found, do something graceful</span>\n <span class=\"kr\">elseif</span> <span class=\"n\">request_id</span> <span class=\"o\">==</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">first_asset</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- result.buffer contains data from my_level_asset.bin</span>\n <span class=\"n\">elif</span> <span class=\"n\">request_id</span> <span class=\"o\">==</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">second_asset</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- result.buffer contains data from &#39;my_level.bin&#39;</span>\n <span class=\"kr\">end</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\">self</span><span class=\"p\">.</span><span class=\"n\">first_asset</span> <span class=\"o\">=</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;folder_next_to_binary/my_level_asset.bin&quot;</span><span class=\"p\">)</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">second_asset</span> <span class=\"o\">=</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;/some_absolute_path/my_level.bin&quot;</span><span class=\"p\">)</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">first_request</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">load_buffer_async</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">first_asset</span><span class=\"p\">,</span> <span class=\"n\">my_callback</span><span class=\"p\">)</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">second_request</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">load_buffer_async</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">second_asset</span><span class=\"p\">,</span> <span class=\"n\">my_callback</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
735
+ "replaces": "",
736
+ "error": "",
737
+ "tparams": [],
738
+ "members": [],
739
+ "notes": [],
740
+ "language": ""
741
+ },
742
+ {
743
+ "type": "CONSTANT",
744
+ "name": "sys.REQUEST_STATUS_FINISHED",
745
+ "brief": "an asyncronous request has finished successfully",
746
+ "description": "an asyncronous request has finished successfully",
747
+ "returnvalues": [],
748
+ "parameters": [],
749
+ "examples": "",
750
+ "replaces": "",
751
+ "error": "",
752
+ "tparams": [],
753
+ "members": [],
754
+ "notes": [],
755
+ "language": ""
756
+ },
757
+ {
758
+ "type": "CONSTANT",
759
+ "name": "sys.REQUEST_STATUS_ERROR_IO_ERROR",
760
+ "brief": "an asyncronous request is unable to read the resource",
761
+ "description": "an asyncronous request is unable to read the resource",
762
+ "returnvalues": [],
763
+ "parameters": [],
764
+ "examples": "",
765
+ "replaces": "",
766
+ "error": "",
767
+ "tparams": [],
768
+ "members": [],
769
+ "notes": [],
770
+ "language": ""
771
+ },
772
+ {
773
+ "type": "CONSTANT",
774
+ "name": "sys.REQUEST_STATUS_ERROR_NOT_FOUND",
775
+ "brief": "an asyncronous request is unable to locate the resource",
776
+ "description": "an asyncronous request is unable to locate the resource",
777
+ "returnvalues": [],
778
+ "parameters": [],
779
+ "examples": "",
780
+ "replaces": "",
781
+ "error": "",
782
+ "tparams": [],
783
+ "members": [],
784
+ "notes": [],
785
+ "language": ""
786
+ },
787
+ {
788
+ "type": "FUNCTION",
789
+ "name": "sys.set_engine_throttle",
790
+ "brief": "Enables engine throttling.",
791
+ "description": "Enables engine throttling.",
792
+ "returnvalues": [],
793
+ "parameters": [
794
+ {
795
+ "name": "enable",
796
+ "doc": "true if throttling should be enabled",
797
+ "types": ["boolean"],
798
+ "is_optional": "False"
799
+ },
800
+ {
801
+ "name": "cooldown",
802
+ "doc": "the time period to do update + render for (seconds)",
803
+ "types": ["number"],
804
+ "is_optional": "False"
805
+ }
806
+ ],
807
+ "examples": "Disable throttling\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">set_engine_throttle</span><span class=\"p\">(</span><span class=\"kc\">false</span><span class=\"p\">)</span>\n</code></pre></div>\n\nEnable throttling\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">set_engine_throttle</span><span class=\"p\">(</span><span class=\"kc\">true</span><span class=\"p\">,</span> <span class=\"mf\">1.5</span><span class=\"p\">)</span>\n</code></pre></div>",
808
+ "replaces": "",
809
+ "error": "",
810
+ "tparams": [],
811
+ "members": [],
812
+ "notes": [
813
+ "It will automatically wake up on input events",
814
+ "It will automatically throttle again after the cooldown period",
815
+ "It skips entire update+render loop on the main thread. E.g loading of assets, callbacks from threads (http)",
816
+ "On threaded systems, Sound will continue to play any started non-streaming sounds. (e.g. looping background music)"
817
+ ],
818
+ "language": ""
819
+ },
820
+ {
821
+ "type": "FUNCTION",
822
+ "name": "sys.set_render_enable",
823
+ "brief": "Disables rendering",
824
+ "description": "Disables rendering",
825
+ "returnvalues": [],
826
+ "parameters": [
827
+ {
828
+ "name": "enable",
829
+ "doc": "true if throttling should be enabled",
830
+ "types": ["boolean"],
831
+ "is_optional": "False"
832
+ }
833
+ ],
834
+ "examples": "Disable rendering\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">set_render_enable</span><span class=\"p\">(</span><span class=\"kc\">false</span><span class=\"p\">)</span>\n</code></pre></div>",
835
+ "replaces": "",
836
+ "error": "",
837
+ "tparams": [],
838
+ "members": [],
839
+ "notes": ["It will will leave the back buffer as-is"],
840
+ "language": ""
841
+ }
842
+ ],
843
+ "info": {
844
+ "namespace": "sys",
845
+ "name": "System",
846
+ "brief": "System API documentation",
847
+ "description": "Functions and messages for using system resources, controlling the engine,\nerror handling and debugging.",
848
+ "path": "engine/script/src/script_sys.cpp",
849
+ "file": "",
850
+ "notes": [],
851
+ "language": "Lua"
852
+ }
853
+ }