@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.
- package/api-signatures.json +2074 -1964
- package/dist/cli-runtime.js +8966 -0
- package/dist/identity-vocabulary.json +660 -0
- package/dist/src/index.d.ts +18 -0
- package/examples/translations.json +15 -15
- package/fixtures/defold-1.12.4/b2d_body_doc.json +1327 -0
- package/fixtures/defold-1.12.4/b2d_doc.json +107 -0
- package/fixtures/defold-1.12.4/base_doc.json +758 -0
- package/fixtures/defold-1.12.4/bit_doc.json +404 -0
- package/fixtures/defold-1.12.4/buffer_doc.json +422 -0
- package/fixtures/defold-1.12.4/camera_doc.json +664 -0
- package/fixtures/defold-1.12.4/collectionfactory_doc.json +219 -0
- package/fixtures/defold-1.12.4/collectionproxy_doc.json +289 -0
- package/fixtures/defold-1.12.4/coroutine_doc.json +151 -0
- package/fixtures/defold-1.12.4/crash_doc.json +497 -0
- package/fixtures/defold-1.12.4/debug_doc.json +410 -0
- package/fixtures/defold-1.12.4/factory_doc.json +219 -0
- package/fixtures/defold-1.12.4/font_doc.json +141 -0
- package/fixtures/defold-1.12.4/globals_doc.json +42 -0
- package/fixtures/defold-1.12.4/go-instance-functions.json +111 -0
- package/fixtures/defold-1.12.4/go_doc.json +1901 -0
- package/fixtures/defold-1.12.4/graphics_doc.json +1634 -0
- package/fixtures/defold-1.12.4/gui_doc.json +5249 -0
- package/fixtures/defold-1.12.4/html5_doc.json +64 -0
- package/fixtures/defold-1.12.4/http_doc.json +66 -0
- package/fixtures/defold-1.12.4/image_doc.json +170 -0
- package/fixtures/defold-1.12.4/io_doc.json +399 -0
- package/fixtures/defold-1.12.4/json_doc.json +97 -0
- package/fixtures/defold-1.12.4/label_doc.json +220 -0
- package/fixtures/defold-1.12.4/liveupdate_doc.json +308 -0
- package/fixtures/defold-1.12.4/math_doc.json +702 -0
- package/fixtures/defold-1.12.4/messages_doc.json +579 -0
- package/fixtures/defold-1.12.4/model_doc.json +315 -0
- package/fixtures/defold-1.12.4/msg_doc.json +137 -0
- package/fixtures/defold-1.12.4/os_doc.json +266 -0
- package/fixtures/defold-1.12.4/package_doc.json +139 -0
- package/fixtures/defold-1.12.4/particlefx_doc.json +249 -0
- package/fixtures/defold-1.12.4/physics_doc.json +1120 -0
- package/fixtures/defold-1.12.4/profiler_doc.json +375 -0
- package/fixtures/defold-1.12.4/render_doc.json +1167 -0
- package/fixtures/defold-1.12.4/resource_doc.json +762 -0
- package/fixtures/defold-1.12.4/socket_doc.json +2194 -0
- package/fixtures/defold-1.12.4/sound_doc.json +582 -0
- package/fixtures/defold-1.12.4/sprite_doc.json +245 -0
- package/fixtures/defold-1.12.4/string_doc.json +412 -0
- package/fixtures/defold-1.12.4/sys_doc.json +853 -0
- package/fixtures/defold-1.12.4/table_doc.json +166 -0
- package/fixtures/defold-1.12.4/tilemap_doc.json +374 -0
- package/fixtures/defold-1.12.4/timer_doc.json +153 -0
- package/fixtures/defold-1.12.4/types_doc.json +212 -0
- package/fixtures/defold-1.12.4/vmath_doc.json +1814 -0
- package/fixtures/defold-1.12.4/window_doc.json +388 -0
- package/fixtures/defold-1.12.4/zlib_doc.json +70 -0
- package/fixtures/defold-1.13.0/b2d_body_doc.json +2428 -0
- package/fixtures/defold-1.13.0/b2d_chain_doc.json +394 -0
- package/fixtures/defold-1.13.0/b2d_doc.json +128 -0
- package/fixtures/defold-1.13.0/b2d_fixture_doc.json +594 -0
- package/fixtures/defold-1.13.0/b2d_joint_doc.json +3315 -0
- package/fixtures/defold-1.13.0/b2d_shape_doc.json +802 -0
- package/fixtures/defold-1.13.0/b2d_world_doc.json +1314 -0
- package/fixtures/defold-1.13.0/base_doc.json +758 -0
- package/fixtures/defold-1.13.0/bit_doc.json +404 -0
- package/fixtures/defold-1.13.0/buffer_doc.json +422 -0
- package/fixtures/defold-1.13.0/camera_doc.json +900 -0
- package/fixtures/defold-1.13.0/collectionfactory_doc.json +219 -0
- package/fixtures/defold-1.13.0/collectionproxy_doc.json +289 -0
- package/fixtures/defold-1.13.0/compute_doc.json +182 -0
- package/fixtures/defold-1.13.0/coroutine_doc.json +151 -0
- package/fixtures/defold-1.13.0/crash_doc.json +497 -0
- package/fixtures/defold-1.13.0/debug_doc.json +410 -0
- package/fixtures/defold-1.13.0/editor_doc.json +3665 -0
- package/fixtures/defold-1.13.0/editor_http_doc.json +273 -0
- package/fixtures/defold-1.13.0/editor_json_doc.json +59 -0
- package/fixtures/defold-1.13.0/editor_localization_doc.json +138 -0
- package/fixtures/defold-1.13.0/editor_pprint_doc.json +36 -0
- package/fixtures/defold-1.13.0/editor_tilemap_tiles_doc.json +235 -0
- package/fixtures/defold-1.13.0/editor_zip_doc.json +163 -0
- package/fixtures/defold-1.13.0/editor_zlib_doc.json +48 -0
- package/fixtures/defold-1.13.0/factory_doc.json +219 -0
- package/fixtures/defold-1.13.0/font_doc.json +141 -0
- package/fixtures/defold-1.13.0/globals_doc.json +42 -0
- package/fixtures/defold-1.13.0/go-instance-functions.json +101 -0
- package/fixtures/defold-1.13.0/go_doc.json +1989 -0
- package/fixtures/defold-1.13.0/graphics_doc.json +1886 -0
- package/fixtures/defold-1.13.0/gui_doc.json +5277 -0
- package/fixtures/defold-1.13.0/html5_doc.json +64 -0
- package/fixtures/defold-1.13.0/http_doc.json +66 -0
- package/fixtures/defold-1.13.0/image_doc.json +170 -0
- package/fixtures/defold-1.13.0/import-manifest.json +10558 -0
- package/fixtures/defold-1.13.0/io_doc.json +399 -0
- package/fixtures/defold-1.13.0/json_doc.json +97 -0
- package/fixtures/defold-1.13.0/label_doc.json +220 -0
- package/fixtures/defold-1.13.0/liveupdate_doc.json +330 -0
- package/fixtures/defold-1.13.0/material_doc.json +238 -0
- package/fixtures/defold-1.13.0/math_doc.json +702 -0
- package/fixtures/defold-1.13.0/model_doc.json +412 -0
- package/fixtures/defold-1.13.0/msg_doc.json +137 -0
- package/fixtures/defold-1.13.0/os_doc.json +266 -0
- package/fixtures/defold-1.13.0/package_doc.json +139 -0
- package/fixtures/defold-1.13.0/particlefx_doc.json +249 -0
- package/fixtures/defold-1.13.0/physics_doc.json +1492 -0
- package/fixtures/defold-1.13.0/profiler_doc.json +375 -0
- package/fixtures/defold-1.13.0/render_doc.json +1381 -0
- package/fixtures/defold-1.13.0/resource_doc.json +762 -0
- package/fixtures/defold-1.13.0/socket_doc.json +2194 -0
- package/fixtures/defold-1.13.0/sound_doc.json +582 -0
- package/fixtures/defold-1.13.0/sprite_doc.json +335 -0
- package/fixtures/defold-1.13.0/string_doc.json +412 -0
- package/fixtures/defold-1.13.0/sys_doc.json +1142 -0
- package/fixtures/defold-1.13.0/table_doc.json +166 -0
- package/fixtures/defold-1.13.0/tilemap_doc.json +402 -0
- package/fixtures/defold-1.13.0/timer_doc.json +153 -0
- package/fixtures/defold-1.13.0/types_doc.json +212 -0
- package/fixtures/defold-1.13.0/vmath_doc.json +1814 -0
- package/fixtures/defold-1.13.0/window_doc.json +388 -0
- package/fixtures/defold-1.13.0/zlib_doc.json +70 -0
- package/fixtures/defold-1.13.1/b2d_body_doc.json +2428 -0
- package/fixtures/defold-1.13.1/b2d_chain_doc.json +394 -0
- package/fixtures/defold-1.13.1/b2d_doc.json +128 -0
- package/fixtures/defold-1.13.1/b2d_fixture_doc.json +594 -0
- package/fixtures/defold-1.13.1/b2d_joint_doc.json +3315 -0
- package/fixtures/defold-1.13.1/b2d_shape_doc.json +802 -0
- package/fixtures/defold-1.13.1/b2d_world_doc.json +1314 -0
- package/fixtures/defold-1.13.1/base_doc.json +758 -0
- package/fixtures/defold-1.13.1/bit_doc.json +404 -0
- package/fixtures/defold-1.13.1/buffer_doc.json +422 -0
- package/fixtures/defold-1.13.1/camera_doc.json +900 -0
- package/fixtures/defold-1.13.1/collectionfactory_doc.json +219 -0
- package/fixtures/defold-1.13.1/collectionproxy_doc.json +323 -0
- package/fixtures/defold-1.13.1/compute_doc.json +182 -0
- package/fixtures/defold-1.13.1/coroutine_doc.json +151 -0
- package/fixtures/defold-1.13.1/crash_doc.json +497 -0
- package/fixtures/defold-1.13.1/debug_doc.json +410 -0
- package/fixtures/defold-1.13.1/editor_doc.json +3880 -0
- package/fixtures/defold-1.13.1/editor_http_doc.json +273 -0
- package/fixtures/defold-1.13.1/editor_image_doc.json +128 -0
- package/fixtures/defold-1.13.1/editor_json_doc.json +59 -0
- package/fixtures/defold-1.13.1/editor_localization_doc.json +138 -0
- package/fixtures/defold-1.13.1/editor_pprint_doc.json +36 -0
- package/fixtures/defold-1.13.1/editor_tilemap_tiles_doc.json +235 -0
- package/fixtures/defold-1.13.1/editor_zip_doc.json +163 -0
- package/fixtures/defold-1.13.1/editor_zlib_doc.json +48 -0
- package/fixtures/defold-1.13.1/factory_doc.json +219 -0
- package/fixtures/defold-1.13.1/font_doc.json +141 -0
- package/fixtures/defold-1.13.1/globals_doc.json +42 -0
- package/fixtures/defold-1.13.1/go-instance-functions.json +102 -0
- package/fixtures/defold-1.13.1/go_doc.json +1989 -0
- package/fixtures/defold-1.13.1/graphics_doc.json +1886 -0
- package/fixtures/defold-1.13.1/gui_doc.json +5277 -0
- package/fixtures/defold-1.13.1/html5_doc.json +64 -0
- package/fixtures/defold-1.13.1/http_doc.json +66 -0
- package/fixtures/defold-1.13.1/image_doc.json +170 -0
- package/fixtures/defold-1.13.1/import-manifest.json +10091 -0
- package/fixtures/defold-1.13.1/io_doc.json +399 -0
- package/fixtures/defold-1.13.1/json_doc.json +97 -0
- package/fixtures/defold-1.13.1/label_doc.json +220 -0
- package/fixtures/defold-1.13.1/liveupdate_doc.json +330 -0
- package/fixtures/defold-1.13.1/material_doc.json +238 -0
- package/fixtures/defold-1.13.1/math_doc.json +702 -0
- package/fixtures/defold-1.13.1/model_doc.json +412 -0
- package/fixtures/defold-1.13.1/msg_doc.json +137 -0
- package/fixtures/defold-1.13.1/os_doc.json +266 -0
- package/fixtures/defold-1.13.1/package_doc.json +139 -0
- package/fixtures/defold-1.13.1/particlefx_doc.json +249 -0
- package/fixtures/defold-1.13.1/physics_doc.json +1492 -0
- package/fixtures/defold-1.13.1/profiler_doc.json +375 -0
- package/fixtures/defold-1.13.1/render_doc.json +1381 -0
- package/fixtures/defold-1.13.1/resource_doc.json +762 -0
- package/fixtures/defold-1.13.1/socket_doc.json +2194 -0
- package/fixtures/defold-1.13.1/sound_doc.json +582 -0
- package/fixtures/defold-1.13.1/sprite_doc.json +335 -0
- package/fixtures/defold-1.13.1/string_doc.json +412 -0
- package/fixtures/defold-1.13.1/sys_doc.json +1142 -0
- package/fixtures/defold-1.13.1/table_doc.json +166 -0
- package/fixtures/defold-1.13.1/tilemap_doc.json +402 -0
- package/fixtures/defold-1.13.1/timer_doc.json +153 -0
- package/fixtures/defold-1.13.1/types_doc.json +212 -0
- package/fixtures/defold-1.13.1/vmath_doc.json +1814 -0
- package/fixtures/defold-1.13.1/window_doc.json +388 -0
- package/fixtures/defold-1.13.1/zlib_doc.json +70 -0
- package/fixtures/defold-1.13.2/b2d_body_doc.json +2359 -0
- package/fixtures/defold-1.13.2/b2d_chain_doc.json +395 -0
- package/fixtures/defold-1.13.2/b2d_doc.json +1945 -0
- package/fixtures/defold-1.13.2/b2d_fixture_doc.json +595 -0
- package/fixtures/defold-1.13.2/b2d_joint_doc.json +3178 -0
- package/fixtures/defold-1.13.2/b2d_shape_doc.json +767 -0
- package/fixtures/defold-1.13.2/b2d_world_doc.json +1315 -0
- package/fixtures/defold-1.13.2/base_doc.json +759 -0
- package/fixtures/defold-1.13.2/bit_doc.json +405 -0
- package/fixtures/defold-1.13.2/buffer_doc.json +393 -0
- package/fixtures/defold-1.13.2/bullet3d_collision_object_doc.json +1206 -0
- package/fixtures/defold-1.13.2/bullet3d_constraint_doc.json +2455 -0
- package/fixtures/defold-1.13.2/bullet3d_doc.json +215 -0
- package/fixtures/defold-1.13.2/bullet3d_rigid_body_doc.json +1376 -0
- package/fixtures/defold-1.13.2/bullet3d_shape_doc.json +430 -0
- package/fixtures/defold-1.13.2/bullet3d_world_doc.json +855 -0
- package/fixtures/defold-1.13.2/camera_doc.json +887 -0
- package/fixtures/defold-1.13.2/collectionfactory_doc.json +206 -0
- package/fixtures/defold-1.13.2/collectionproxy_doc.json +397 -0
- package/fixtures/defold-1.13.2/compute_doc.json +183 -0
- package/fixtures/defold-1.13.2/coroutine_doc.json +152 -0
- package/fixtures/defold-1.13.2/crash_doc.json +483 -0
- package/fixtures/defold-1.13.2/debug_doc.json +411 -0
- package/fixtures/defold-1.13.2/editor_doc.json +6320 -0
- package/fixtures/defold-1.13.2/editor_http_doc.json +476 -0
- package/fixtures/defold-1.13.2/editor_image_doc.json +129 -0
- package/fixtures/defold-1.13.2/editor_json_doc.json +81 -0
- package/fixtures/defold-1.13.2/editor_localization_doc.json +139 -0
- package/fixtures/defold-1.13.2/editor_pprint_doc.json +37 -0
- package/fixtures/defold-1.13.2/editor_tilemap_tiles_doc.json +292 -0
- package/fixtures/defold-1.13.2/editor_zip_doc.json +237 -0
- package/fixtures/defold-1.13.2/editor_zlib_doc.json +49 -0
- package/fixtures/defold-1.13.2/factory_doc.json +206 -0
- package/fixtures/defold-1.13.2/font_doc.json +230 -0
- package/fixtures/defold-1.13.2/globals_doc.json +64 -0
- package/fixtures/defold-1.13.2/go-instance-functions.json +106 -0
- package/fixtures/defold-1.13.2/go_doc.json +1789 -0
- package/fixtures/defold-1.13.2/graphics_doc.json +1211 -0
- package/fixtures/defold-1.13.2/gui_doc.json +4735 -0
- package/fixtures/defold-1.13.2/html5_doc.json +65 -0
- package/fixtures/defold-1.13.2/http_doc.json +174 -0
- package/fixtures/defold-1.13.2/image_doc.json +298 -0
- package/fixtures/defold-1.13.2/import-manifest.json +10902 -0
- package/fixtures/defold-1.13.2/io_doc.json +400 -0
- package/fixtures/defold-1.13.2/json_doc.json +140 -0
- package/fixtures/defold-1.13.2/label_doc.json +427 -0
- package/fixtures/defold-1.13.2/liveupdate_doc.json +221 -0
- package/fixtures/defold-1.13.2/material_doc.json +773 -0
- package/fixtures/defold-1.13.2/math_doc.json +703 -0
- package/fixtures/defold-1.13.2/model_doc.json +472 -0
- package/fixtures/defold-1.13.2/msg_doc.json +169 -0
- package/fixtures/defold-1.13.2/os_doc.json +269 -0
- package/fixtures/defold-1.13.2/package_doc.json +140 -0
- package/fixtures/defold-1.13.2/particlefx_doc.json +249 -0
- package/fixtures/defold-1.13.2/physics_doc.json +1624 -0
- package/fixtures/defold-1.13.2/profiler_doc.json +348 -0
- package/fixtures/defold-1.13.2/render_doc.json +1623 -0
- package/fixtures/defold-1.13.2/resource_doc.json +1539 -0
- package/fixtures/defold-1.13.2/socket_doc.json +2335 -0
- package/fixtures/defold-1.13.2/sound_doc.json +673 -0
- package/fixtures/defold-1.13.2/sprite_doc.json +364 -0
- package/fixtures/defold-1.13.2/string_doc.json +413 -0
- package/fixtures/defold-1.13.2/sys_doc.json +1347 -0
- package/fixtures/defold-1.13.2/table_doc.json +167 -0
- package/fixtures/defold-1.13.2/tilemap_doc.json +369 -0
- package/fixtures/defold-1.13.2/timer_doc.json +214 -0
- package/fixtures/defold-1.13.2/types_doc.json +213 -0
- package/fixtures/defold-1.13.2/vmath_doc.json +2056 -0
- package/fixtures/defold-1.13.2/window_doc.json +426 -0
- package/fixtures/defold-1.13.2/zlib_doc.json +71 -0
- package/fixtures/defold-1.14.0/b2d_body_doc.json +2359 -0
- package/fixtures/defold-1.14.0/b2d_chain_doc.json +395 -0
- package/fixtures/defold-1.14.0/b2d_doc.json +1973 -0
- package/fixtures/defold-1.14.0/b2d_fixture_doc.json +595 -0
- package/fixtures/defold-1.14.0/b2d_joint_doc.json +3178 -0
- package/fixtures/defold-1.14.0/b2d_shape_doc.json +767 -0
- package/fixtures/defold-1.14.0/b2d_world_doc.json +1315 -0
- package/fixtures/defold-1.14.0/base_doc.json +759 -0
- package/fixtures/defold-1.14.0/bit_doc.json +405 -0
- package/fixtures/defold-1.14.0/buffer_doc.json +393 -0
- package/fixtures/defold-1.14.0/bullet3d_collision_object_doc.json +1206 -0
- package/fixtures/defold-1.14.0/bullet3d_constraint_doc.json +2455 -0
- package/fixtures/defold-1.14.0/bullet3d_doc.json +243 -0
- package/fixtures/defold-1.14.0/bullet3d_rigid_body_doc.json +1376 -0
- package/fixtures/defold-1.14.0/bullet3d_shape_doc.json +430 -0
- package/fixtures/defold-1.14.0/bullet3d_world_doc.json +855 -0
- package/fixtures/defold-1.14.0/camera_doc.json +887 -0
- package/fixtures/defold-1.14.0/collectionfactory_doc.json +206 -0
- package/fixtures/defold-1.14.0/collectionproxy_doc.json +397 -0
- package/fixtures/defold-1.14.0/compute_doc.json +183 -0
- package/fixtures/defold-1.14.0/coroutine_doc.json +152 -0
- package/fixtures/defold-1.14.0/crash_doc.json +483 -0
- package/fixtures/defold-1.14.0/debug_doc.json +411 -0
- package/fixtures/defold-1.14.0/editor_doc.json +6320 -0
- package/fixtures/defold-1.14.0/editor_http_doc.json +476 -0
- package/fixtures/defold-1.14.0/editor_image_doc.json +129 -0
- package/fixtures/defold-1.14.0/editor_json_doc.json +81 -0
- package/fixtures/defold-1.14.0/editor_localization_doc.json +139 -0
- package/fixtures/defold-1.14.0/editor_pprint_doc.json +37 -0
- package/fixtures/defold-1.14.0/editor_tilemap_tiles_doc.json +292 -0
- package/fixtures/defold-1.14.0/editor_zip_doc.json +237 -0
- package/fixtures/defold-1.14.0/editor_zlib_doc.json +49 -0
- package/fixtures/defold-1.14.0/factory_doc.json +206 -0
- package/fixtures/defold-1.14.0/font_doc.json +230 -0
- package/fixtures/defold-1.14.0/globals_doc.json +64 -0
- package/fixtures/defold-1.14.0/go-instance-functions.json +106 -0
- package/fixtures/defold-1.14.0/go_doc.json +1789 -0
- package/fixtures/defold-1.14.0/graphics_doc.json +1257 -0
- package/fixtures/defold-1.14.0/gui_doc.json +4735 -0
- package/fixtures/defold-1.14.0/html5_doc.json +65 -0
- package/fixtures/defold-1.14.0/http_doc.json +174 -0
- package/fixtures/defold-1.14.0/image_doc.json +298 -0
- package/fixtures/defold-1.14.0/import-manifest.json +10260 -0
- package/fixtures/defold-1.14.0/io_doc.json +400 -0
- package/fixtures/defold-1.14.0/json_doc.json +140 -0
- package/fixtures/defold-1.14.0/label_doc.json +427 -0
- package/fixtures/defold-1.14.0/liveupdate_doc.json +221 -0
- package/fixtures/defold-1.14.0/material_doc.json +773 -0
- package/fixtures/defold-1.14.0/math_doc.json +703 -0
- package/fixtures/defold-1.14.0/model_doc.json +472 -0
- package/fixtures/defold-1.14.0/msg_doc.json +169 -0
- package/fixtures/defold-1.14.0/os_doc.json +269 -0
- package/fixtures/defold-1.14.0/package_doc.json +140 -0
- package/fixtures/defold-1.14.0/particlefx_doc.json +249 -0
- package/fixtures/defold-1.14.0/physics_doc.json +1624 -0
- package/fixtures/defold-1.14.0/profiler_doc.json +348 -0
- package/fixtures/defold-1.14.0/render_doc.json +1628 -0
- package/fixtures/defold-1.14.0/resource_doc.json +1539 -0
- package/fixtures/defold-1.14.0/socket_doc.json +2335 -0
- package/fixtures/defold-1.14.0/sound_doc.json +673 -0
- package/fixtures/defold-1.14.0/sprite_doc.json +364 -0
- package/fixtures/defold-1.14.0/string_doc.json +413 -0
- package/fixtures/defold-1.14.0/sys_doc.json +1347 -0
- package/fixtures/defold-1.14.0/table_doc.json +167 -0
- package/fixtures/defold-1.14.0/tilemap_doc.json +369 -0
- package/fixtures/defold-1.14.0/timer_doc.json +214 -0
- package/fixtures/defold-1.14.0/types_doc.json +213 -0
- package/fixtures/defold-1.14.0/vmath_doc.json +2056 -0
- package/fixtures/defold-1.14.0/window_doc.json +426 -0
- package/fixtures/defold-1.14.0/zlib_doc.json +71 -0
- package/generated/b2d.d.ts +39 -39
- package/generated/b2d_body.d.ts +11 -11
- package/generated/b2d_chain.d.ts +3 -3
- package/generated/b2d_fixture.d.ts +5 -5
- package/generated/b2d_joint.d.ts +29 -29
- package/generated/b2d_shape.d.ts +13 -13
- package/generated/b2d_world.d.ts +15 -15
- package/generated/buffer.d.ts +5 -6
- package/generated/bullet3d.d.ts +6 -6
- package/generated/bullet3d_collision_object.d.ts +9 -9
- package/generated/bullet3d_constraint.d.ts +78 -78
- package/generated/bullet3d_rigid_body.d.ts +3 -3
- package/generated/bullet3d_shape.d.ts +11 -11
- package/generated/bullet3d_world.d.ts +20 -20
- package/generated/camera.d.ts +4 -4
- package/generated/collectionfactory.d.ts +2 -3
- package/generated/collectionproxy.d.ts +5 -5
- package/generated/compute.d.ts +5 -5
- package/generated/crash.d.ts +7 -7
- package/generated/editor-vm/http.d.ts +13 -13
- package/generated/editor-vm/image.d.ts +4 -4
- package/generated/editor-vm/json.d.ts +1 -1
- package/generated/editor-vm/tilemap_tiles.d.ts +9 -9
- package/generated/editor-vm/zip.d.ts +4 -4
- package/generated/editor.d.ts +183 -183
- package/generated/factory.d.ts +2 -3
- package/generated/font.d.ts +4 -4
- package/generated/go.d.ts +10 -12
- package/generated/graphics.d.ts +23 -26
- package/generated/gui.d.ts +44 -58
- package/generated/http.d.ts +2 -2
- package/generated/image.d.ts +12 -12
- package/generated/json.d.ts +4 -4
- package/generated/label.d.ts +5 -5
- package/generated/liveupdate.d.ts +3 -3
- package/generated/material.d.ts +48 -48
- package/generated/model.d.ts +46 -14
- package/generated/particlefx.d.ts +5 -5
- package/generated/physics.d.ts +19 -19
- package/generated/profiler.d.ts +3 -5
- package/generated/render-script-modules/b2d.d.ts +39 -39
- package/generated/render-script-modules/bullet3d.d.ts +5 -5
- package/generated/render-script-modules/collectionfactory.d.ts +1 -2
- package/generated/render-script-modules/collectionproxy.d.ts +3 -3
- package/generated/render-script-modules/factory.d.ts +1 -2
- package/generated/render-script-modules/go.d.ts +8 -10
- package/generated/render-script-modules/label.d.ts +2 -2
- package/generated/render-script-modules/model.d.ts +43 -11
- package/generated/render-script-modules/particlefx.d.ts +3 -3
- package/generated/render-script-modules/physics.d.ts +12 -12
- package/generated/render-script-modules/resource.d.ts +52 -53
- package/generated/render-script-modules/sound.d.ts +4 -4
- package/generated/render-script-modules/sprite.d.ts +2 -2
- package/generated/render-script-modules/tilemap.d.ts +2 -2
- package/generated/render.d.ts +44 -45
- package/generated/resource.d.ts +58 -59
- package/generated/socket.d.ts +18 -23
- package/generated/sound.d.ts +6 -6
- package/generated/sprite.d.ts +3 -3
- package/generated/sys.d.ts +20 -21
- package/generated/tilemap.d.ts +3 -3
- package/generated/timer.d.ts +3 -3
- package/generated/versions/defold-1.12.4/b2d.d.ts +2 -2
- package/generated/versions/defold-1.12.4/b2d_body.d.ts +2 -2
- package/generated/versions/defold-1.12.4/go.d.ts +2 -2
- package/generated/versions/defold-1.12.4/graphics.d.ts +1 -1
- package/generated/versions/defold-1.12.4/gui.d.ts +18 -19
- package/generated/versions/defold-1.12.4/label.d.ts +1 -1
- package/generated/versions/defold-1.12.4/model.d.ts +42 -10
- package/generated/versions/defold-1.12.4/particlefx.d.ts +1 -1
- package/generated/versions/defold-1.12.4/physics.d.ts +1 -1
- package/generated/versions/defold-1.12.4/render.d.ts +5 -5
- package/generated/versions/defold-1.12.4/resource.d.ts +8 -8
- package/generated/versions/defold-1.12.4/socket.d.ts +12 -12
- package/generated/versions/defold-1.12.4/sound.d.ts +1 -1
- package/generated/versions/defold-1.12.4/sprite.d.ts +1 -1
- package/generated/versions/defold-1.12.4/sys.d.ts +2 -2
- package/generated/versions/defold-1.12.4/tilemap.d.ts +1 -1
- package/generated/versions/defold-1.12.4/window.d.ts +3 -4
- package/generated/versions/defold-1.13.0/b2d.d.ts +2 -2
- package/generated/versions/defold-1.13.0/b2d_body.d.ts +2 -2
- package/generated/versions/defold-1.13.0/b2d_chain.d.ts +1 -1
- package/generated/versions/defold-1.13.0/b2d_joint.d.ts +1 -1
- package/generated/versions/defold-1.13.0/b2d_shape.d.ts +1 -1
- package/generated/versions/defold-1.13.0/camera.d.ts +1 -1
- package/generated/versions/defold-1.13.0/go.d.ts +2 -2
- package/generated/versions/defold-1.13.0/graphics.d.ts +1 -1
- package/generated/versions/defold-1.13.0/gui.d.ts +18 -19
- package/generated/versions/defold-1.13.0/label.d.ts +1 -1
- package/generated/versions/defold-1.13.0/model.d.ts +42 -10
- package/generated/versions/defold-1.13.0/particlefx.d.ts +1 -1
- package/generated/versions/defold-1.13.0/physics.d.ts +1 -1
- package/generated/versions/defold-1.13.0/render.d.ts +5 -5
- package/generated/versions/defold-1.13.0/resource.d.ts +8 -8
- package/generated/versions/defold-1.13.0/socket.d.ts +12 -12
- package/generated/versions/defold-1.13.0/sound.d.ts +1 -1
- package/generated/versions/defold-1.13.0/sprite.d.ts +1 -1
- package/generated/versions/defold-1.13.0/sys.d.ts +2 -2
- package/generated/versions/defold-1.13.0/tilemap.d.ts +1 -1
- package/generated/versions/defold-1.13.0/window.d.ts +3 -4
- package/generated/versions/defold-1.13.1/b2d.d.ts +2 -2
- package/generated/versions/defold-1.13.1/b2d_body.d.ts +2 -2
- package/generated/versions/defold-1.13.1/b2d_chain.d.ts +1 -1
- package/generated/versions/defold-1.13.1/b2d_joint.d.ts +1 -1
- package/generated/versions/defold-1.13.1/b2d_shape.d.ts +1 -1
- package/generated/versions/defold-1.13.1/camera.d.ts +1 -1
- package/generated/versions/defold-1.13.1/go.d.ts +2 -2
- package/generated/versions/defold-1.13.1/graphics.d.ts +1 -1
- package/generated/versions/defold-1.13.1/gui.d.ts +18 -19
- package/generated/versions/defold-1.13.1/label.d.ts +1 -1
- package/generated/versions/defold-1.13.1/model.d.ts +42 -10
- package/generated/versions/defold-1.13.1/particlefx.d.ts +1 -1
- package/generated/versions/defold-1.13.1/physics.d.ts +1 -1
- package/generated/versions/defold-1.13.1/render.d.ts +5 -5
- package/generated/versions/defold-1.13.1/resource.d.ts +8 -8
- package/generated/versions/defold-1.13.1/socket.d.ts +12 -12
- package/generated/versions/defold-1.13.1/sound.d.ts +1 -1
- package/generated/versions/defold-1.13.1/sprite.d.ts +1 -1
- package/generated/versions/defold-1.13.1/sys.d.ts +2 -2
- package/generated/versions/defold-1.13.1/tilemap.d.ts +1 -1
- package/generated/versions/defold-1.13.1/window.d.ts +3 -4
- package/generated/versions/defold-1.13.2/b2d.d.ts +39 -39
- package/generated/versions/defold-1.13.2/b2d_body.d.ts +11 -11
- package/generated/versions/defold-1.13.2/b2d_chain.d.ts +3 -3
- package/generated/versions/defold-1.13.2/b2d_fixture.d.ts +5 -5
- package/generated/versions/defold-1.13.2/b2d_joint.d.ts +29 -29
- package/generated/versions/defold-1.13.2/b2d_shape.d.ts +13 -13
- package/generated/versions/defold-1.13.2/b2d_world.d.ts +15 -15
- package/generated/versions/defold-1.13.2/buffer.d.ts +5 -6
- package/generated/versions/defold-1.13.2/bullet3d.d.ts +6 -6
- package/generated/versions/defold-1.13.2/bullet3d_collision_object.d.ts +9 -9
- package/generated/versions/defold-1.13.2/bullet3d_constraint.d.ts +78 -78
- package/generated/versions/defold-1.13.2/bullet3d_rigid_body.d.ts +3 -3
- package/generated/versions/defold-1.13.2/bullet3d_shape.d.ts +11 -11
- package/generated/versions/defold-1.13.2/bullet3d_world.d.ts +20 -20
- package/generated/versions/defold-1.13.2/camera.d.ts +4 -4
- package/generated/versions/defold-1.13.2/collectionfactory.d.ts +2 -3
- package/generated/versions/defold-1.13.2/collectionproxy.d.ts +5 -5
- package/generated/versions/defold-1.13.2/compute.d.ts +5 -5
- package/generated/versions/defold-1.13.2/crash.d.ts +7 -7
- package/generated/versions/defold-1.13.2/editor-vm/http.d.ts +13 -13
- package/generated/versions/defold-1.13.2/editor-vm/image.d.ts +4 -4
- package/generated/versions/defold-1.13.2/editor-vm/json.d.ts +1 -1
- package/generated/versions/defold-1.13.2/editor-vm/tilemap_tiles.d.ts +9 -9
- package/generated/versions/defold-1.13.2/editor-vm/zip.d.ts +4 -4
- package/generated/versions/defold-1.13.2/editor.d.ts +183 -183
- package/generated/versions/defold-1.13.2/factory.d.ts +2 -3
- package/generated/versions/defold-1.13.2/font.d.ts +4 -4
- package/generated/versions/defold-1.13.2/go.d.ts +10 -12
- package/generated/versions/defold-1.13.2/graphics.d.ts +22 -25
- package/generated/versions/defold-1.13.2/gui.d.ts +44 -58
- package/generated/versions/defold-1.13.2/http.d.ts +2 -2
- package/generated/versions/defold-1.13.2/image.d.ts +12 -12
- package/generated/versions/defold-1.13.2/json.d.ts +4 -4
- package/generated/versions/defold-1.13.2/label.d.ts +5 -5
- package/generated/versions/defold-1.13.2/liveupdate.d.ts +3 -3
- package/generated/versions/defold-1.13.2/material.d.ts +48 -48
- package/generated/versions/defold-1.13.2/model.d.ts +46 -14
- package/generated/versions/defold-1.13.2/particlefx.d.ts +5 -5
- package/generated/versions/defold-1.13.2/physics.d.ts +19 -19
- package/generated/versions/defold-1.13.2/profiler.d.ts +3 -5
- package/generated/versions/defold-1.13.2/render.d.ts +43 -44
- package/generated/versions/defold-1.13.2/resource.d.ts +58 -59
- package/generated/versions/defold-1.13.2/socket.d.ts +18 -23
- package/generated/versions/defold-1.13.2/sound.d.ts +6 -6
- package/generated/versions/defold-1.13.2/sprite.d.ts +3 -3
- package/generated/versions/defold-1.13.2/sys.d.ts +20 -21
- package/generated/versions/defold-1.13.2/tilemap.d.ts +3 -3
- package/generated/versions/defold-1.13.2/timer.d.ts +3 -3
- package/generated/versions/defold-1.13.2/vmath.d.ts +0 -1
- package/generated/versions/defold-1.13.2/window.d.ts +8 -10
- package/generated/vmath.d.ts +0 -1
- package/generated/window.d.ts +8 -10
- package/identity-vocabulary.json +41 -34
- package/package.json +13 -5
- package/scripts/cli-runtime.ts +18 -0
- package/scripts/example-store-io.ts +2 -2
- package/scripts/extension-goldens.ts +9 -5
- package/scripts/generate-api-availability.ts +10 -4
- package/scripts/generate-api-signatures.ts +1 -1
- package/scripts/import-defold-release.ts +1 -1
- package/scripts/regen.ts +35 -9
- package/scripts/shared-handle-methods.ts +3 -2
- package/scripts/signature-store-fs.ts +37 -17
- package/scripts/sync-api-docs.ts +127 -20
- package/src/api-doc.ts +19 -4
- package/src/api-identity.ts +32 -1
- package/src/component-properties.d.ts +8 -8
- package/src/core-types.ts +29 -13
- package/src/doc-corrections.ts +9 -0
- package/src/emit-dts.ts +770 -214
- package/src/engine-type-name.ts +33 -0
- package/src/go-overloads.d.ts +10 -10
- package/src/gui-overloads.d.ts +11 -11
- package/src/index-slot-classifications.ts +75 -9
- package/src/index.ts +4 -1
- package/src/lifecycle.ts +2 -2
- package/src/publish-dts.ts +16 -0
- package/src/script-api.ts +36 -38
- package/src/socket-types.d.ts +3 -3
- package/src/library-index-slot-classifications.ts +0 -332
|
@@ -0,0 +1,1347 @@
|
|
|
1
|
+
{
|
|
2
|
+
"elements": [
|
|
3
|
+
{
|
|
4
|
+
"type": "FUNCTION",
|
|
5
|
+
"name": "sys.set_engine_throttle",
|
|
6
|
+
"brief": "Enables engine throttling.",
|
|
7
|
+
"description": "Enables engine throttling.",
|
|
8
|
+
"returnvalues": [],
|
|
9
|
+
"parameters": [
|
|
10
|
+
{
|
|
11
|
+
"name": "enable",
|
|
12
|
+
"doc": "true if throttling should be enabled",
|
|
13
|
+
"types": ["boolean"],
|
|
14
|
+
"is_optional": "False"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "cooldown",
|
|
18
|
+
"doc": "the time period to do update + render for (seconds)",
|
|
19
|
+
"types": ["number"],
|
|
20
|
+
"is_optional": "False"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"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>",
|
|
24
|
+
"replaces": "",
|
|
25
|
+
"error": "",
|
|
26
|
+
"tparams": [],
|
|
27
|
+
"members": [],
|
|
28
|
+
"notes": [
|
|
29
|
+
"It will automatically wake up on input events",
|
|
30
|
+
"It will automatically throttle again after the cooldown period",
|
|
31
|
+
"It skips entire update+render loop on the main thread. E.g loading of assets, callbacks from threads (http)",
|
|
32
|
+
"On threaded systems, Sound will continue to play any started non-streaming sounds. (e.g. looping background music)"
|
|
33
|
+
],
|
|
34
|
+
"language": ""
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "FUNCTION",
|
|
38
|
+
"name": "sys.set_render_enable",
|
|
39
|
+
"brief": "Disables rendering",
|
|
40
|
+
"description": "Disables rendering",
|
|
41
|
+
"returnvalues": [],
|
|
42
|
+
"parameters": [
|
|
43
|
+
{
|
|
44
|
+
"name": "enable",
|
|
45
|
+
"doc": "true if throttling should be enabled",
|
|
46
|
+
"types": ["boolean"],
|
|
47
|
+
"is_optional": "False"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"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>",
|
|
51
|
+
"replaces": "",
|
|
52
|
+
"error": "",
|
|
53
|
+
"tparams": [],
|
|
54
|
+
"members": [],
|
|
55
|
+
"notes": ["It will will leave the back buffer as-is"],
|
|
56
|
+
"language": ""
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "MESSAGE",
|
|
60
|
+
"name": "exit",
|
|
61
|
+
"brief": "exits application",
|
|
62
|
+
"description": "Terminates the game application and reports the specified <code>code</code> to the OS.\nThis message can only be sent to the designated <code>@system</code> socket.",
|
|
63
|
+
"returnvalues": [],
|
|
64
|
+
"parameters": [
|
|
65
|
+
{
|
|
66
|
+
"name": "code",
|
|
67
|
+
"doc": "exit code to report to the OS, 0 means clean exit",
|
|
68
|
+
"types": ["number"],
|
|
69
|
+
"is_optional": "False"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"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\">"quit"</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">"@system:"</span><span class=\"p\">,</span> <span class=\"s2\">"exit"</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">code</span> <span class=\"o\">=</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>",
|
|
73
|
+
"replaces": "",
|
|
74
|
+
"error": "",
|
|
75
|
+
"tparams": [],
|
|
76
|
+
"members": [],
|
|
77
|
+
"notes": [],
|
|
78
|
+
"language": ""
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"type": "MESSAGE",
|
|
82
|
+
"name": "toggle_profile",
|
|
83
|
+
"brief": "shows/hides the on-screen profiler",
|
|
84
|
+
"description": "Toggles the on-screen profiler.\nThe profiler is a real-time tool that shows the numbers of milliseconds spent\nin each scope per frame as well as counters. The profiler is very useful for\ntracking down performance and resource problems.\nIn addition to the on-screen profiler, Defold includes a web-based profiler that\nallows you to sample a series of data points and then analyze them in detail.\nThe web profiler is available at <code>http://<device IP>:8002</code> where <device IP> is\nthe IP address of the device you are running your game on.\nThis message can only be sent to the designated <code>@system</code> socket.",
|
|
85
|
+
"returnvalues": [],
|
|
86
|
+
"parameters": [],
|
|
87
|
+
"examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">"@system:"</span><span class=\"p\">,</span> <span class=\"s2\">"toggle_profile"</span><span class=\"p\">)</span>\n</code></pre></div>",
|
|
88
|
+
"replaces": "",
|
|
89
|
+
"error": "",
|
|
90
|
+
"tparams": [],
|
|
91
|
+
"members": [],
|
|
92
|
+
"notes": [],
|
|
93
|
+
"language": ""
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"type": "MESSAGE",
|
|
97
|
+
"name": "toggle_physics_debug",
|
|
98
|
+
"brief": "shows/hides the on-screen physics visual debugging",
|
|
99
|
+
"description": "Toggles the on-screen physics visual debugging mode which is very useful for\ntracking down issues related to physics. This mode visualizes\nall collision object shapes and normals at detected contact points. Toggling\nthis mode on is equal to setting <code>physics.debug</code> in the \"game.project\" settings,\nbut set in run-time.\nThis message can only be sent to the designated <code>@system</code> socket.",
|
|
100
|
+
"returnvalues": [],
|
|
101
|
+
"parameters": [],
|
|
102
|
+
"examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">"@system:"</span><span class=\"p\">,</span> <span class=\"s2\">"toggle_physics_debug"</span><span class=\"p\">)</span>\n</code></pre></div>",
|
|
103
|
+
"replaces": "",
|
|
104
|
+
"error": "",
|
|
105
|
+
"tparams": [],
|
|
106
|
+
"members": [],
|
|
107
|
+
"notes": [],
|
|
108
|
+
"language": ""
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"type": "MESSAGE",
|
|
112
|
+
"name": "start_record",
|
|
113
|
+
"brief": "starts video recording",
|
|
114
|
+
"description": "Starts video recording of the game frame-buffer to file. Current video format is the\nopen vp8 codec in the ivf container. It's possible to upload this format directly\nto YouTube. The VLC video player has native support but with the known issue that\nnot the entire file is played back. It's probably an issue with VLC.\nThe Miro Video Converter has support for vp8/ivf.\n<span class=\"icon-macos\"></span> <span class=\"icon-windows\"></span> <span class=\"icon-linux\"></span> Video recording is only supported on desktop platforms.\n<span class=\"icon-attention\"></span> Audio is currently not supported\n<span class=\"icon-attention\"></span> Window width and height must be a multiple of 8 to be able to record video.\nThis message can only be sent to the designated <code>@system</code> socket.",
|
|
115
|
+
"returnvalues": [],
|
|
116
|
+
"parameters": [
|
|
117
|
+
{
|
|
118
|
+
"name": "file_name",
|
|
119
|
+
"doc": "file name to write the video to",
|
|
120
|
+
"types": ["string"],
|
|
121
|
+
"is_optional": "False"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "frame_period",
|
|
125
|
+
"doc": "frame period to record, ie write every nth frame. Default value is <code>2</code>",
|
|
126
|
+
"types": ["number"],
|
|
127
|
+
"is_optional": "False"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "fps",
|
|
131
|
+
"doc": "frames per second. Playback speed for the video. Default value is <code>30</code>. The fps value doens't affect the recording. It's only meta-data in the written video file.",
|
|
132
|
+
"types": ["number"],
|
|
133
|
+
"is_optional": "False"
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"examples": "Record a video in 30 fps given that the native game fps is 60:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">"@system:"</span><span class=\"p\">,</span> <span class=\"s2\">"start_record"</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">file_name</span> <span class=\"o\">=</span> <span class=\"s2\">"test_rec.ivf"</span> <span class=\"p\">}</span> <span class=\"p\">)</span>\n</code></pre></div>\n\nTo write a video in 60 fps given that the native game fps is 60:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">"@system:"</span><span class=\"p\">,</span> <span class=\"s2\">"start_record"</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">file_name</span> <span class=\"o\">=</span> <span class=\"s2\">"test_rec.ivf"</span><span class=\"p\">,</span> <span class=\"n\">frame_period</span> <span class=\"o\">=</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">fps</span> <span class=\"o\">=</span> <span class=\"mi\">60</span> <span class=\"p\">}</span> <span class=\"p\">)</span>\n</code></pre></div>",
|
|
137
|
+
"replaces": "",
|
|
138
|
+
"error": "",
|
|
139
|
+
"tparams": [],
|
|
140
|
+
"members": [],
|
|
141
|
+
"notes": [],
|
|
142
|
+
"language": ""
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"type": "MESSAGE",
|
|
146
|
+
"name": "stop_record",
|
|
147
|
+
"brief": "stop current video recording",
|
|
148
|
+
"description": "Stops the currently active video recording.\n<span class=\"icon-macos\"></span> <span class=\"icon-windows\"></span> <span class=\"icon-linux\"></span> Video recording is only supported on desktop platforms.\nThis message can only be sent to the designated <code>@system</code> socket.",
|
|
149
|
+
"returnvalues": [],
|
|
150
|
+
"parameters": [],
|
|
151
|
+
"examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">"@system:"</span><span class=\"p\">,</span> <span class=\"s2\">"stop_record"</span><span class=\"p\">)</span>\n</code></pre></div>",
|
|
152
|
+
"replaces": "",
|
|
153
|
+
"error": "",
|
|
154
|
+
"tparams": [],
|
|
155
|
+
"members": [],
|
|
156
|
+
"notes": [],
|
|
157
|
+
"language": ""
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"type": "MESSAGE",
|
|
161
|
+
"name": "reboot",
|
|
162
|
+
"brief": "reboot engine with arguments",
|
|
163
|
+
"description": "Reboots the game engine with a specified set of arguments.\nArguments will be translated into command line arguments. Sending the reboot\ncommand is equivalent to starting the engine with the same arguments.\nOn startup the engine reads configuration from \"game.project\" in the\nproject root.\nThis message can only be sent to the designated <code>@system</code> socket.",
|
|
164
|
+
"returnvalues": [],
|
|
165
|
+
"parameters": [
|
|
166
|
+
{
|
|
167
|
+
"name": "arg1",
|
|
168
|
+
"doc": "argument 1",
|
|
169
|
+
"types": ["string"],
|
|
170
|
+
"is_optional": "False"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"name": "arg2",
|
|
174
|
+
"doc": "argument 2",
|
|
175
|
+
"types": ["string"],
|
|
176
|
+
"is_optional": "False"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "arg3",
|
|
180
|
+
"doc": "argument 3",
|
|
181
|
+
"types": ["string"],
|
|
182
|
+
"is_optional": "False"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "arg4",
|
|
186
|
+
"doc": "argument 4",
|
|
187
|
+
"types": ["string"],
|
|
188
|
+
"is_optional": "False"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"name": "arg5",
|
|
192
|
+
"doc": "argument 5",
|
|
193
|
+
"types": ["string"],
|
|
194
|
+
"is_optional": "False"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"name": "arg6",
|
|
198
|
+
"doc": "argument 6",
|
|
199
|
+
"types": ["string"],
|
|
200
|
+
"is_optional": "False"
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"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\">'--config=bootstrap.main_collection=/my.collectionc'</span>\n<span class=\"kd\">local</span> <span class=\"n\">arg2</span> <span class=\"o\">=</span> <span class=\"s1\">'build/game.projectc'</span>\n<span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">"@system:"</span><span class=\"p\">,</span> <span class=\"s2\">"reboot"</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">arg1</span> <span class=\"o\">=</span> <span class=\"n\">arg1</span><span class=\"p\">,</span> <span class=\"n\">arg2</span> <span class=\"o\">=</span> <span class=\"n\">arg2</span><span class=\"p\">})</span>\n</code></pre></div>",
|
|
204
|
+
"replaces": "",
|
|
205
|
+
"error": "",
|
|
206
|
+
"tparams": [],
|
|
207
|
+
"members": [],
|
|
208
|
+
"notes": [],
|
|
209
|
+
"language": ""
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"type": "MESSAGE",
|
|
213
|
+
"name": "set_vsync",
|
|
214
|
+
"brief": "set vsync swap interval",
|
|
215
|
+
"description": "Request a presentation interval relative to vertical blanks (v-blank).\n0 requests disabling vsync and 1 requests presenting every refresh (the default).\nOpenGL may support larger intervals, such as 2 for every other refresh.\nVulkan and Metal treat any nonzero interval as enabling vsync; DX12 clamps\nintervals to the supported range 0 through 4. Actual behavior depends on\nthe backend, platform, and driver.\nOn platforms where Defold owns the application loop, a positive\n<code>display.update_frequency</code> or a positive value set by <code>sys.set_update_frequency()</code>\nuses timer pacing and requests a swap interval of 0. The requested\nswap interval is retained and applied again when the update frequency is set to 0.\nThis setting may be overridden by driver settings.\nThis message can only be sent to the designated <code>@system</code> socket.",
|
|
216
|
+
"returnvalues": [],
|
|
217
|
+
"parameters": [
|
|
218
|
+
{
|
|
219
|
+
"name": "swap_interval",
|
|
220
|
+
"doc": "target swap interval.",
|
|
221
|
+
"types": ["number"],
|
|
222
|
+
"is_optional": "False"
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"examples": "<pre>\nmsg.post(\"@system:\", \"set_vsync\", { swap_interval = 1 } )\n</pre>",
|
|
226
|
+
"replaces": "",
|
|
227
|
+
"error": "",
|
|
228
|
+
"tparams": [],
|
|
229
|
+
"members": [],
|
|
230
|
+
"notes": [],
|
|
231
|
+
"language": ""
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"type": "MESSAGE",
|
|
235
|
+
"name": "set_update_frequency",
|
|
236
|
+
"brief": "set update frequency",
|
|
237
|
+
"description": "Set game update-frequency (frame cap). This option is equivalent to\n<code>display.update_frequency</code> in the \"game.project\" settings but set at run-time.\nOn platforms where Defold owns the application loop, a positive value uses\ntimer pacing and requests a swap interval of 0 to avoid an additional vsync\nwait where supported. Setting the frequency to 0 restores the requested swap\ninterval and uses variable-rate updates. Platform-owned loops, such as HTML5\nand iOS, retain their platform scheduling and presentation behavior. There is\nno guarantee that the frame cap will be achieved depending on platform and\nhardware constraints.\nWith engine-side timer pacing, the update dt can be shortened or enlarged to\naccount for elapsed time; the frame cap does not guarantee a constant dt.\nElapsed time beyond max(engine.max_time_step, 1 / frequency) is discarded,\nso accumulated dt can trail wall-clock time after hitches. An intentional\nfixed interval longer than engine.max_time_step is allowed. This setting\nis separate from the fixed_update() timestep.\nThis message can only be sent to the designated <code>@system</code> socket.",
|
|
238
|
+
"returnvalues": [],
|
|
239
|
+
"parameters": [
|
|
240
|
+
{
|
|
241
|
+
"name": "frequency",
|
|
242
|
+
"doc": "target frequency in hertz. 0 selects a variable\nframe rate; negative values are treated as 0.",
|
|
243
|
+
"types": ["number"],
|
|
244
|
+
"is_optional": "False"
|
|
245
|
+
}
|
|
246
|
+
],
|
|
247
|
+
"examples": "<pre>\nmsg.post(\"@system:\", \"set_update_frequency\", { frequency = 60 } )\n</pre>",
|
|
248
|
+
"replaces": "",
|
|
249
|
+
"error": "",
|
|
250
|
+
"tparams": [],
|
|
251
|
+
"members": [],
|
|
252
|
+
"notes": [],
|
|
253
|
+
"language": ""
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"type": "MESSAGE",
|
|
257
|
+
"name": "resume_rendering",
|
|
258
|
+
"brief": "resume rendering",
|
|
259
|
+
"description": "Resume rendering.\nThis message can only be sent to the designated <code>@system</code> socket.",
|
|
260
|
+
"returnvalues": [],
|
|
261
|
+
"parameters": [],
|
|
262
|
+
"examples": "<pre>\nmsg.post(\"@system:\", \"resume_rendering\")\n</pre>",
|
|
263
|
+
"replaces": "",
|
|
264
|
+
"error": "",
|
|
265
|
+
"tparams": [],
|
|
266
|
+
"members": [],
|
|
267
|
+
"notes": [],
|
|
268
|
+
"language": ""
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"type": "ENUM",
|
|
272
|
+
"name": "sys.REQUEST_STATUS",
|
|
273
|
+
"brief": "Asynchronous request status values",
|
|
274
|
+
"description": "Asynchronous request status values",
|
|
275
|
+
"returnvalues": [],
|
|
276
|
+
"parameters": [],
|
|
277
|
+
"examples": "",
|
|
278
|
+
"replaces": "",
|
|
279
|
+
"error": "",
|
|
280
|
+
"tparams": [],
|
|
281
|
+
"members": [
|
|
282
|
+
{
|
|
283
|
+
"name": "sys.REQUEST_STATUS_ERROR_IO_ERROR",
|
|
284
|
+
"doc": "An I/O error occurred.",
|
|
285
|
+
"type": ""
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "sys.REQUEST_STATUS_ERROR_NOT_FOUND",
|
|
289
|
+
"doc": "The requested resource was not found.",
|
|
290
|
+
"type": ""
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"name": "sys.REQUEST_STATUS_FINISHED",
|
|
294
|
+
"doc": "The request completed successfully.",
|
|
295
|
+
"type": ""
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"notes": [],
|
|
299
|
+
"language": ""
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"type": "STRUCT",
|
|
303
|
+
"name": "sys.load_buffer_result",
|
|
304
|
+
"brief": "Asynchronous buffer-load result",
|
|
305
|
+
"description": "Asynchronous buffer-load result",
|
|
306
|
+
"returnvalues": [],
|
|
307
|
+
"parameters": [],
|
|
308
|
+
"examples": "",
|
|
309
|
+
"replaces": "",
|
|
310
|
+
"error": "",
|
|
311
|
+
"tparams": [],
|
|
312
|
+
"members": [
|
|
313
|
+
{
|
|
314
|
+
"name": "status",
|
|
315
|
+
"doc": "Request status.",
|
|
316
|
+
"type": "sys.REQUEST_STATUS"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"name": "buffer?",
|
|
320
|
+
"doc": "Loaded payload for a successful request.",
|
|
321
|
+
"type": "buffer_data"
|
|
322
|
+
}
|
|
323
|
+
],
|
|
324
|
+
"notes": [],
|
|
325
|
+
"language": ""
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"type": "FUNCTION",
|
|
329
|
+
"name": "sys.load_buffer",
|
|
330
|
+
"brief": "loads a buffer from a resource or disk path",
|
|
331
|
+
"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\".",
|
|
332
|
+
"returnvalues": [
|
|
333
|
+
{
|
|
334
|
+
"name": "buffer",
|
|
335
|
+
"doc": "the buffer with data",
|
|
336
|
+
"types": ["buffer_data"]
|
|
337
|
+
}
|
|
338
|
+
],
|
|
339
|
+
"parameters": [
|
|
340
|
+
{
|
|
341
|
+
"name": "path",
|
|
342
|
+
"doc": "the path to load the buffer from",
|
|
343
|
+
"types": ["string"],
|
|
344
|
+
"is_optional": "False"
|
|
345
|
+
}
|
|
346
|
+
],
|
|
347
|
+
"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\">"/assets/my_level_data.bin"</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\">"data"</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\">"D3F0LD"</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\">"folder_next_to_binary/my_level_asset.txt"</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\">"/my/absolute/path"</span><span class=\"p\">)</span>\n</code></pre></div>",
|
|
348
|
+
"replaces": "",
|
|
349
|
+
"error": "",
|
|
350
|
+
"tparams": [],
|
|
351
|
+
"members": [],
|
|
352
|
+
"notes": [],
|
|
353
|
+
"language": ""
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"type": "FUNCTION",
|
|
357
|
+
"name": "sys.load_buffer_async",
|
|
358
|
+
"brief": "loads a buffer from a resource or disk path asynchronously",
|
|
359
|
+
"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 implicit caching of the buffers\nbased on request path.",
|
|
360
|
+
"returnvalues": [
|
|
361
|
+
{
|
|
362
|
+
"name": "handle",
|
|
363
|
+
"doc": "a handle to the request",
|
|
364
|
+
"types": ["integer"]
|
|
365
|
+
}
|
|
366
|
+
],
|
|
367
|
+
"parameters": [
|
|
368
|
+
{
|
|
369
|
+
"name": "path",
|
|
370
|
+
"doc": "the path to load the buffer from",
|
|
371
|
+
"types": ["string"],
|
|
372
|
+
"is_optional": "False"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"name": "status_callback",
|
|
376
|
+
"doc": "callback invoked when the request completes or fails",
|
|
377
|
+
"types": ["fun(self:script_instance, request_id:integer, result:sys.load_buffer_result)"],
|
|
378
|
+
"is_optional": "False"
|
|
379
|
+
}
|
|
380
|
+
],
|
|
381
|
+
"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\">sys</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\">"/my_texture"</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\">buffer</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\">"/assets/my_level_data.bin"</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_request</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- result.buffer contains data from my_level_asset.bin</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\">second_request</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- result.buffer contains data from 'my_level.bin'</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_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\">"folder_next_to_binary/my_level_asset.bin"</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=\"s2\">"/some_absolute_path/my_level.bin"</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>",
|
|
382
|
+
"replaces": "",
|
|
383
|
+
"error": "",
|
|
384
|
+
"tparams": [],
|
|
385
|
+
"members": [],
|
|
386
|
+
"notes": [],
|
|
387
|
+
"language": ""
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"type": "ENUM",
|
|
391
|
+
"name": "sys.NETWORK",
|
|
392
|
+
"brief": "Network connectivity states",
|
|
393
|
+
"description": "Network connectivity states",
|
|
394
|
+
"returnvalues": [],
|
|
395
|
+
"parameters": [],
|
|
396
|
+
"examples": "",
|
|
397
|
+
"replaces": "",
|
|
398
|
+
"error": "",
|
|
399
|
+
"tparams": [],
|
|
400
|
+
"members": [
|
|
401
|
+
{
|
|
402
|
+
"name": "sys.NETWORK_CONNECTED",
|
|
403
|
+
"doc": "Connected through Wi-Fi or another non-cellular network.",
|
|
404
|
+
"type": ""
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"name": "sys.NETWORK_CONNECTED_CELLULAR",
|
|
408
|
+
"doc": "Connected through a cellular network.",
|
|
409
|
+
"type": ""
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"name": "sys.NETWORK_DISCONNECTED",
|
|
413
|
+
"doc": "No network connection was found.",
|
|
414
|
+
"type": ""
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
"notes": [],
|
|
418
|
+
"language": ""
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"type": "STRUCT",
|
|
422
|
+
"name": "sys.open_url_attributes",
|
|
423
|
+
"brief": "URL opening attributes",
|
|
424
|
+
"description": "URL opening attributes",
|
|
425
|
+
"returnvalues": [],
|
|
426
|
+
"parameters": [],
|
|
427
|
+
"examples": "",
|
|
428
|
+
"replaces": "",
|
|
429
|
+
"error": "",
|
|
430
|
+
"tparams": [],
|
|
431
|
+
"members": [
|
|
432
|
+
{
|
|
433
|
+
"name": "target?",
|
|
434
|
+
"doc": "HTML5 browsing context: <code>_self</code>, <code>_blank</code>, <code>_parent</code>, <code>_top</code>, or a named window.",
|
|
435
|
+
"type": "string"
|
|
436
|
+
}
|
|
437
|
+
],
|
|
438
|
+
"notes": [],
|
|
439
|
+
"language": ""
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"type": "STRUCT",
|
|
443
|
+
"name": "sys.sys_info_options",
|
|
444
|
+
"brief": "System-information options",
|
|
445
|
+
"description": "System-information options",
|
|
446
|
+
"returnvalues": [],
|
|
447
|
+
"parameters": [],
|
|
448
|
+
"examples": "",
|
|
449
|
+
"replaces": "",
|
|
450
|
+
"error": "",
|
|
451
|
+
"tparams": [],
|
|
452
|
+
"members": [
|
|
453
|
+
{
|
|
454
|
+
"name": "ignore_secure?",
|
|
455
|
+
"doc": "Omit operating-system-protected values such as <code>device_ident</code>.",
|
|
456
|
+
"type": "boolean"
|
|
457
|
+
}
|
|
458
|
+
],
|
|
459
|
+
"notes": [],
|
|
460
|
+
"language": ""
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"type": "STRUCT",
|
|
464
|
+
"name": "sys.sys_info",
|
|
465
|
+
"brief": "System information",
|
|
466
|
+
"description": "System information",
|
|
467
|
+
"returnvalues": [],
|
|
468
|
+
"parameters": [],
|
|
469
|
+
"examples": "",
|
|
470
|
+
"replaces": "",
|
|
471
|
+
"error": "",
|
|
472
|
+
"tparams": [],
|
|
473
|
+
"members": [
|
|
474
|
+
{
|
|
475
|
+
"name": "device_model?",
|
|
476
|
+
"doc": "Device model on iOS and Android.",
|
|
477
|
+
"type": "string"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"name": "manufacturer?",
|
|
481
|
+
"doc": "Device manufacturer on iOS and Android.",
|
|
482
|
+
"type": "string"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"name": "system_name",
|
|
486
|
+
"doc": "Operating-system name.",
|
|
487
|
+
"type": "string"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"name": "system_version",
|
|
491
|
+
"doc": "Operating-system version.",
|
|
492
|
+
"type": "string"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
"name": "api_version",
|
|
496
|
+
"doc": "Platform API version.",
|
|
497
|
+
"type": "string"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "language",
|
|
501
|
+
"doc": "ISO 639 language code.",
|
|
502
|
+
"type": "string"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"name": "device_language",
|
|
506
|
+
"doc": "Preferred device language, optionally followed by an ISO 15924 script code.",
|
|
507
|
+
"type": "string"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"name": "territory",
|
|
511
|
+
"doc": "ISO 3166-1 alpha-2 country code or UN M.49 numeric region code.",
|
|
512
|
+
"type": "string"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"name": "gmt_offset",
|
|
516
|
+
"doc": "Current GMT offset in minutes.",
|
|
517
|
+
"type": "number"
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
"name": "device_ident?",
|
|
521
|
+
"doc": "Operating-system-protected device identifier.",
|
|
522
|
+
"type": "string"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"name": "user_agent?",
|
|
526
|
+
"doc": "HTTP user agent on HTML5.",
|
|
527
|
+
"type": "string"
|
|
528
|
+
}
|
|
529
|
+
],
|
|
530
|
+
"notes": [],
|
|
531
|
+
"language": ""
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"type": "STRUCT",
|
|
535
|
+
"name": "sys.engine_info",
|
|
536
|
+
"brief": "Engine information",
|
|
537
|
+
"description": "Engine information",
|
|
538
|
+
"returnvalues": [],
|
|
539
|
+
"parameters": [],
|
|
540
|
+
"examples": "",
|
|
541
|
+
"replaces": "",
|
|
542
|
+
"error": "",
|
|
543
|
+
"tparams": [],
|
|
544
|
+
"members": [
|
|
545
|
+
{
|
|
546
|
+
"name": "version",
|
|
547
|
+
"doc": "Defold engine version.",
|
|
548
|
+
"type": "string"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"name": "version_sha1",
|
|
552
|
+
"doc": "Engine build SHA-1.",
|
|
553
|
+
"type": "string"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"name": "is_debug",
|
|
557
|
+
"doc": "Whether this is a debug engine build.",
|
|
558
|
+
"type": "boolean"
|
|
559
|
+
}
|
|
560
|
+
],
|
|
561
|
+
"notes": [],
|
|
562
|
+
"language": ""
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"type": "STRUCT",
|
|
566
|
+
"name": "sys.application_info",
|
|
567
|
+
"brief": "Application information",
|
|
568
|
+
"description": "Application information",
|
|
569
|
+
"returnvalues": [],
|
|
570
|
+
"parameters": [],
|
|
571
|
+
"examples": "",
|
|
572
|
+
"replaces": "",
|
|
573
|
+
"error": "",
|
|
574
|
+
"tparams": [],
|
|
575
|
+
"members": [
|
|
576
|
+
{
|
|
577
|
+
"name": "installed",
|
|
578
|
+
"doc": "Whether the queried application is installed.",
|
|
579
|
+
"type": "boolean"
|
|
580
|
+
}
|
|
581
|
+
],
|
|
582
|
+
"notes": [],
|
|
583
|
+
"language": ""
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"type": "STRUCT",
|
|
587
|
+
"name": "sys.interface_info",
|
|
588
|
+
"brief": "Network-interface information",
|
|
589
|
+
"description": "Network-interface information",
|
|
590
|
+
"returnvalues": [],
|
|
591
|
+
"parameters": [],
|
|
592
|
+
"examples": "",
|
|
593
|
+
"replaces": "",
|
|
594
|
+
"error": "",
|
|
595
|
+
"tparams": [],
|
|
596
|
+
"members": [
|
|
597
|
+
{
|
|
598
|
+
"name": "name",
|
|
599
|
+
"doc": "Interface name.",
|
|
600
|
+
"type": "string"
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
"name": "address?",
|
|
604
|
+
"doc": "IP address, when available.",
|
|
605
|
+
"type": "string"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"name": "mac?",
|
|
609
|
+
"doc": "Hardware MAC address, when available.",
|
|
610
|
+
"type": "string"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
"name": "up",
|
|
614
|
+
"doc": "Whether the interface can transmit and receive data.",
|
|
615
|
+
"type": "boolean"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"name": "running",
|
|
619
|
+
"doc": "Whether the interface is running.",
|
|
620
|
+
"type": "boolean"
|
|
621
|
+
}
|
|
622
|
+
],
|
|
623
|
+
"notes": [],
|
|
624
|
+
"language": ""
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
"type": "FUNCTION",
|
|
628
|
+
"name": "sys.save",
|
|
629
|
+
"brief": "saves a lua table to a file stored on disk",
|
|
630
|
+
"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.",
|
|
631
|
+
"returnvalues": [],
|
|
632
|
+
"parameters": [
|
|
633
|
+
{
|
|
634
|
+
"name": "filename",
|
|
635
|
+
"doc": "file to write to",
|
|
636
|
+
"types": ["string"],
|
|
637
|
+
"is_optional": "False"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"name": "table",
|
|
641
|
+
"doc": "lua table to save",
|
|
642
|
+
"types": ["table<any, any>"],
|
|
643
|
+
"is_optional": "False"
|
|
644
|
+
}
|
|
645
|
+
],
|
|
646
|
+
"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\">"my_value"</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\">"my_game"</span><span class=\"p\">,</span> <span class=\"s2\">"my_file"</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>",
|
|
647
|
+
"replaces": "",
|
|
648
|
+
"error": "",
|
|
649
|
+
"tparams": [],
|
|
650
|
+
"members": [],
|
|
651
|
+
"notes": [],
|
|
652
|
+
"language": ""
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
"type": "FUNCTION",
|
|
656
|
+
"name": "sys.load",
|
|
657
|
+
"brief": "loads a lua table from a file on disk",
|
|
658
|
+
"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.",
|
|
659
|
+
"returnvalues": [
|
|
660
|
+
{
|
|
661
|
+
"name": "loaded",
|
|
662
|
+
"doc": "lua table, which is empty if the file could not be found",
|
|
663
|
+
"types": ["table<any, any>"]
|
|
664
|
+
}
|
|
665
|
+
],
|
|
666
|
+
"parameters": [
|
|
667
|
+
{
|
|
668
|
+
"name": "filename",
|
|
669
|
+
"doc": "file to read from",
|
|
670
|
+
"types": ["string"],
|
|
671
|
+
"is_optional": "False"
|
|
672
|
+
}
|
|
673
|
+
],
|
|
674
|
+
"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\">"my_game"</span><span class=\"p\">,</span> <span class=\"s2\">"my_file"</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>",
|
|
675
|
+
"replaces": "",
|
|
676
|
+
"error": "",
|
|
677
|
+
"tparams": [],
|
|
678
|
+
"members": [],
|
|
679
|
+
"notes": [],
|
|
680
|
+
"language": ""
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
"type": "FUNCTION",
|
|
684
|
+
"name": "sys.exists",
|
|
685
|
+
"brief": "check if a path exists",
|
|
686
|
+
"description": "Check if a path exists\nGood for checking if a file exists before loading a large file",
|
|
687
|
+
"returnvalues": [
|
|
688
|
+
{
|
|
689
|
+
"name": "result",
|
|
690
|
+
"doc": "<code>true</code> if the path exists, <code>false</code> otherwise",
|
|
691
|
+
"types": ["boolean"]
|
|
692
|
+
}
|
|
693
|
+
],
|
|
694
|
+
"parameters": [
|
|
695
|
+
{
|
|
696
|
+
"name": "path",
|
|
697
|
+
"doc": "path to check",
|
|
698
|
+
"types": ["string"],
|
|
699
|
+
"is_optional": "False"
|
|
700
|
+
}
|
|
701
|
+
],
|
|
702
|
+
"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>",
|
|
703
|
+
"replaces": "",
|
|
704
|
+
"error": "",
|
|
705
|
+
"tparams": [],
|
|
706
|
+
"members": [],
|
|
707
|
+
"notes": [],
|
|
708
|
+
"language": ""
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
"type": "FUNCTION",
|
|
712
|
+
"name": "sys.get_host_path",
|
|
713
|
+
"brief": "create a path to the host device for unit testing",
|
|
714
|
+
"description": "Create a path to the host device for unit testing\nUseful for saving logs etc during development",
|
|
715
|
+
"returnvalues": [
|
|
716
|
+
{
|
|
717
|
+
"name": "host_path",
|
|
718
|
+
"doc": "the path prefixed with the proper host mount",
|
|
719
|
+
"types": ["string"]
|
|
720
|
+
}
|
|
721
|
+
],
|
|
722
|
+
"parameters": [
|
|
723
|
+
{
|
|
724
|
+
"name": "filename",
|
|
725
|
+
"doc": "file to read from",
|
|
726
|
+
"types": ["string"],
|
|
727
|
+
"is_optional": "False"
|
|
728
|
+
}
|
|
729
|
+
],
|
|
730
|
+
"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\">"logs/test.txt"</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\">"logs/test.txt"</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>",
|
|
731
|
+
"replaces": "",
|
|
732
|
+
"error": "",
|
|
733
|
+
"tparams": [],
|
|
734
|
+
"members": [],
|
|
735
|
+
"notes": ["Only enabled in debug builds. In release builds returns the string unchanged"],
|
|
736
|
+
"language": ""
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
"type": "FUNCTION",
|
|
740
|
+
"name": "sys.get_save_file",
|
|
741
|
+
"brief": "gets the save-file path",
|
|
742
|
+
"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.",
|
|
743
|
+
"returnvalues": [
|
|
744
|
+
{
|
|
745
|
+
"name": "path",
|
|
746
|
+
"doc": "path to save-file",
|
|
747
|
+
"types": ["string"]
|
|
748
|
+
}
|
|
749
|
+
],
|
|
750
|
+
"parameters": [
|
|
751
|
+
{
|
|
752
|
+
"name": "application_id",
|
|
753
|
+
"doc": "user defined id of the application, which helps define the location of the save-file",
|
|
754
|
+
"types": ["string"],
|
|
755
|
+
"is_optional": "False"
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"name": "file_name",
|
|
759
|
+
"doc": "file-name to get path for",
|
|
760
|
+
"types": ["string"],
|
|
761
|
+
"is_optional": "False"
|
|
762
|
+
}
|
|
763
|
+
],
|
|
764
|
+
"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\">"my_game"</span><span class=\"p\">,</span> <span class=\"s2\">"my_file"</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\">--> /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\">--> 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\">--> /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\">--> /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\">--> /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\">--> /data/.my_game/my_file</span>\n</code></pre></div>",
|
|
765
|
+
"replaces": "",
|
|
766
|
+
"error": "",
|
|
767
|
+
"tparams": [],
|
|
768
|
+
"members": [],
|
|
769
|
+
"notes": [
|
|
770
|
+
"Setting the environment variable `DM_SAVE_HOME` overrides the default application support path."
|
|
771
|
+
],
|
|
772
|
+
"language": ""
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"type": "FUNCTION",
|
|
776
|
+
"name": "sys.get_application_path",
|
|
777
|
+
"brief": "gets the application path",
|
|
778
|
+
"description": "The path from which the application is run.\nThis function will raise a Lua error if unable to get the application support path.",
|
|
779
|
+
"returnvalues": [
|
|
780
|
+
{
|
|
781
|
+
"name": "path",
|
|
782
|
+
"doc": "path to application executable",
|
|
783
|
+
"types": ["string"]
|
|
784
|
+
}
|
|
785
|
+
],
|
|
786
|
+
"parameters": [],
|
|
787
|
+
"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\">--> /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\">--> 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\">--> /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\">--> /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\">--> /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\">--> http://www.foobar.com/my_game</span>\n</code></pre></div>",
|
|
788
|
+
"replaces": "",
|
|
789
|
+
"error": "",
|
|
790
|
+
"tparams": [],
|
|
791
|
+
"members": [],
|
|
792
|
+
"notes": [],
|
|
793
|
+
"language": ""
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"type": "FUNCTION",
|
|
797
|
+
"name": "sys.get_config_string",
|
|
798
|
+
"brief": "get string config value with optional default value",
|
|
799
|
+
"description": "Get string config value from the game.project configuration file with optional default value",
|
|
800
|
+
"returnvalues": [
|
|
801
|
+
{
|
|
802
|
+
"name": "value",
|
|
803
|
+
"doc": "config value as a string. default_value if the config key does not exist. nil if no default value was supplied.",
|
|
804
|
+
"types": ["string", "nil"]
|
|
805
|
+
}
|
|
806
|
+
],
|
|
807
|
+
"parameters": [
|
|
808
|
+
{
|
|
809
|
+
"name": "key",
|
|
810
|
+
"doc": "key to get value for. The syntax is SECTION.KEY",
|
|
811
|
+
"types": ["string"],
|
|
812
|
+
"is_optional": "False"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"name": "default_value",
|
|
816
|
+
"doc": "(optional) default value to return if the value does not exist",
|
|
817
|
+
"types": ["string"],
|
|
818
|
+
"is_optional": "True"
|
|
819
|
+
}
|
|
820
|
+
],
|
|
821
|
+
"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\">"my_game.text"</span><span class=\"p\">,</span> <span class=\"s2\">"default text"</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\">"mygame.testmode"</span><span class=\"p\">)</span>\n</code></pre></div>",
|
|
822
|
+
"replaces": "",
|
|
823
|
+
"error": "",
|
|
824
|
+
"tparams": [],
|
|
825
|
+
"members": [],
|
|
826
|
+
"notes": [],
|
|
827
|
+
"language": ""
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
"type": "FUNCTION",
|
|
831
|
+
"name": "sys.get_config_int",
|
|
832
|
+
"brief": "get integer config value with optional default value",
|
|
833
|
+
"description": "Get integer config value from the game.project configuration file with optional default value",
|
|
834
|
+
"returnvalues": [
|
|
835
|
+
{
|
|
836
|
+
"name": "value",
|
|
837
|
+
"doc": "config value as an integer. default_value if the config key does not exist. 0 if no default value was supplied.",
|
|
838
|
+
"types": ["number"]
|
|
839
|
+
}
|
|
840
|
+
],
|
|
841
|
+
"parameters": [
|
|
842
|
+
{
|
|
843
|
+
"name": "key",
|
|
844
|
+
"doc": "key to get value for. The syntax is SECTION.KEY",
|
|
845
|
+
"types": ["string"],
|
|
846
|
+
"is_optional": "False"
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
"name": "default_value",
|
|
850
|
+
"doc": "(optional) default value to return if the value does not exist",
|
|
851
|
+
"types": ["number"],
|
|
852
|
+
"is_optional": "True"
|
|
853
|
+
}
|
|
854
|
+
],
|
|
855
|
+
"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\">"my_game.speed"</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\">"my_game.testmode"</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>",
|
|
856
|
+
"replaces": "",
|
|
857
|
+
"error": "",
|
|
858
|
+
"tparams": [],
|
|
859
|
+
"members": [],
|
|
860
|
+
"notes": [],
|
|
861
|
+
"language": ""
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"type": "FUNCTION",
|
|
865
|
+
"name": "sys.get_config_number",
|
|
866
|
+
"brief": "get number config value with optional default value",
|
|
867
|
+
"description": "Get number config value from the game.project configuration file with optional default value",
|
|
868
|
+
"returnvalues": [
|
|
869
|
+
{
|
|
870
|
+
"name": "value",
|
|
871
|
+
"doc": "config value as an number. default_value if the config key does not exist. 0 if no default value was supplied.",
|
|
872
|
+
"types": ["number"]
|
|
873
|
+
}
|
|
874
|
+
],
|
|
875
|
+
"parameters": [
|
|
876
|
+
{
|
|
877
|
+
"name": "key",
|
|
878
|
+
"doc": "key to get value for. The syntax is SECTION.KEY",
|
|
879
|
+
"types": ["string"],
|
|
880
|
+
"is_optional": "False"
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
"name": "default_value",
|
|
884
|
+
"doc": "(optional) default value to return if the value does not exist",
|
|
885
|
+
"types": ["number"],
|
|
886
|
+
"is_optional": "True"
|
|
887
|
+
}
|
|
888
|
+
],
|
|
889
|
+
"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\">"my_game.speed"</span><span class=\"p\">,</span> <span class=\"mf\">20.0</span><span class=\"p\">)</span>\n</code></pre></div>",
|
|
890
|
+
"replaces": "",
|
|
891
|
+
"error": "",
|
|
892
|
+
"tparams": [],
|
|
893
|
+
"members": [],
|
|
894
|
+
"notes": [],
|
|
895
|
+
"language": ""
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
"type": "FUNCTION",
|
|
899
|
+
"name": "sys.get_config_boolean",
|
|
900
|
+
"brief": "get boolean config value with optional default value",
|
|
901
|
+
"description": "Get boolean config value from the game.project configuration file with optional default value",
|
|
902
|
+
"returnvalues": [
|
|
903
|
+
{
|
|
904
|
+
"name": "value",
|
|
905
|
+
"doc": "config value as a boolean. default_value if the config key does not exist. false if no default value was supplied.",
|
|
906
|
+
"types": ["boolean"]
|
|
907
|
+
}
|
|
908
|
+
],
|
|
909
|
+
"parameters": [
|
|
910
|
+
{
|
|
911
|
+
"name": "key",
|
|
912
|
+
"doc": "key to get value for. The syntax is SECTION.KEY",
|
|
913
|
+
"types": ["string"],
|
|
914
|
+
"is_optional": "False"
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
"name": "default_value",
|
|
918
|
+
"doc": "(optional) default value to return if the value does not exist",
|
|
919
|
+
"types": ["boolean"],
|
|
920
|
+
"is_optional": "True"
|
|
921
|
+
}
|
|
922
|
+
],
|
|
923
|
+
"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\">"display.vsync"</span><span class=\"p\">,</span> <span class=\"kc\">false</span><span class=\"p\">)</span>\n</code></pre></div>",
|
|
924
|
+
"replaces": "",
|
|
925
|
+
"error": "",
|
|
926
|
+
"tparams": [],
|
|
927
|
+
"members": [],
|
|
928
|
+
"notes": [],
|
|
929
|
+
"language": ""
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
"type": "FUNCTION",
|
|
933
|
+
"name": "sys.open_url",
|
|
934
|
+
"brief": "open url in default application",
|
|
935
|
+
"description": "Open URL in default application, typically a browser",
|
|
936
|
+
"returnvalues": [
|
|
937
|
+
{
|
|
938
|
+
"name": "success",
|
|
939
|
+
"doc": "a boolean indicating if the url could be opened or not",
|
|
940
|
+
"types": ["boolean"]
|
|
941
|
+
}
|
|
942
|
+
],
|
|
943
|
+
"parameters": [
|
|
944
|
+
{
|
|
945
|
+
"name": "url",
|
|
946
|
+
"doc": "url to open",
|
|
947
|
+
"types": ["string"],
|
|
948
|
+
"is_optional": "False"
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
"name": "attributes",
|
|
952
|
+
"doc": "optional URL opening attributes",
|
|
953
|
+
"types": ["sys.open_url_attributes"],
|
|
954
|
+
"is_optional": "True"
|
|
955
|
+
}
|
|
956
|
+
],
|
|
957
|
+
"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\">"http://www.defold.com"</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">target</span> <span class=\"o\">=</span> <span class=\"s2\">"_blank"</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>",
|
|
958
|
+
"replaces": "",
|
|
959
|
+
"error": "",
|
|
960
|
+
"tparams": [],
|
|
961
|
+
"members": [],
|
|
962
|
+
"notes": [],
|
|
963
|
+
"language": ""
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
"type": "FUNCTION",
|
|
967
|
+
"name": "sys.load_resource",
|
|
968
|
+
"brief": "loads resource from game data",
|
|
969
|
+
"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\".",
|
|
970
|
+
"returnvalues": [
|
|
971
|
+
{
|
|
972
|
+
"name": "data",
|
|
973
|
+
"doc": "loaded data, or <code>nil</code> if the resource could not be loaded",
|
|
974
|
+
"types": ["string", "nil"]
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
"name": "error",
|
|
978
|
+
"doc": "the error message, or <code>nil</code> if no error occurred",
|
|
979
|
+
"types": ["string", "nil"]
|
|
980
|
+
}
|
|
981
|
+
],
|
|
982
|
+
"parameters": [
|
|
983
|
+
{
|
|
984
|
+
"name": "filename",
|
|
985
|
+
"doc": "resource to load, full path",
|
|
986
|
+
"types": ["string"],
|
|
987
|
+
"is_optional": "False"
|
|
988
|
+
}
|
|
989
|
+
],
|
|
990
|
+
"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\">"/assets/level_data.json"</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>",
|
|
991
|
+
"replaces": "",
|
|
992
|
+
"error": "",
|
|
993
|
+
"tparams": [],
|
|
994
|
+
"members": [],
|
|
995
|
+
"notes": [],
|
|
996
|
+
"language": ""
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
"type": "FUNCTION",
|
|
1000
|
+
"name": "sys.get_sys_info",
|
|
1001
|
+
"brief": "get system information",
|
|
1002
|
+
"description": "Returns a table with system information.",
|
|
1003
|
+
"returnvalues": [
|
|
1004
|
+
{
|
|
1005
|
+
"name": "sys_info",
|
|
1006
|
+
"doc": "system information",
|
|
1007
|
+
"types": ["sys.sys_info"]
|
|
1008
|
+
}
|
|
1009
|
+
],
|
|
1010
|
+
"parameters": [
|
|
1011
|
+
{
|
|
1012
|
+
"name": "options",
|
|
1013
|
+
"doc": "optional system-information options",
|
|
1014
|
+
"types": ["sys.sys_info_options"],
|
|
1015
|
+
"is_optional": "True"
|
|
1016
|
+
}
|
|
1017
|
+
],
|
|
1018
|
+
"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\">"HTML5"</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>",
|
|
1019
|
+
"replaces": "",
|
|
1020
|
+
"error": "",
|
|
1021
|
+
"tparams": [],
|
|
1022
|
+
"members": [],
|
|
1023
|
+
"notes": [],
|
|
1024
|
+
"language": ""
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
"type": "FUNCTION",
|
|
1028
|
+
"name": "sys.get_engine_info",
|
|
1029
|
+
"brief": "get engine information",
|
|
1030
|
+
"description": "Returns a table with engine information.",
|
|
1031
|
+
"returnvalues": [
|
|
1032
|
+
{
|
|
1033
|
+
"name": "engine_info",
|
|
1034
|
+
"doc": "engine information",
|
|
1035
|
+
"types": ["sys.engine_info"]
|
|
1036
|
+
}
|
|
1037
|
+
],
|
|
1038
|
+
"parameters": [],
|
|
1039
|
+
"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'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\">"Defold "</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\">"</span><span class=\"se\">\\n</span><span class=\"s2\">"</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\">"version"</span><span class=\"p\">),</span> <span class=\"n\">version_str</span><span class=\"p\">)</span>\n</code></pre></div>",
|
|
1040
|
+
"replaces": "",
|
|
1041
|
+
"error": "",
|
|
1042
|
+
"tparams": [],
|
|
1043
|
+
"members": [],
|
|
1044
|
+
"notes": [],
|
|
1045
|
+
"language": ""
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
"type": "FUNCTION",
|
|
1049
|
+
"name": "sys.get_application_info",
|
|
1050
|
+
"brief": "get application information",
|
|
1051
|
+
"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.",
|
|
1052
|
+
"returnvalues": [
|
|
1053
|
+
{
|
|
1054
|
+
"name": "app_info",
|
|
1055
|
+
"doc": "application information",
|
|
1056
|
+
"types": ["sys.application_info"]
|
|
1057
|
+
}
|
|
1058
|
+
],
|
|
1059
|
+
"parameters": [
|
|
1060
|
+
{
|
|
1061
|
+
"name": "app_string",
|
|
1062
|
+
"doc": "platform specific string with application package or query, see above for details.",
|
|
1063
|
+
"types": ["string"],
|
|
1064
|
+
"is_optional": "False"
|
|
1065
|
+
}
|
|
1066
|
+
],
|
|
1067
|
+
"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\">"Android"</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\">"com.twitter.android"</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\">"iPhone OS"</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\">"twitter:"</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\"><key></span>LSApplicationQueriesSchemes<span class=\"nt\"></key></span>\n <span class=\"nt\"><array></span>\n <span class=\"nt\"><string></span>twitter<span class=\"nt\"></string></span>\n <span class=\"nt\"></array></span>\n...\n</code></pre></div>",
|
|
1068
|
+
"replaces": "",
|
|
1069
|
+
"error": "",
|
|
1070
|
+
"tparams": [],
|
|
1071
|
+
"members": [],
|
|
1072
|
+
"notes": [],
|
|
1073
|
+
"language": ""
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
"type": "FUNCTION",
|
|
1077
|
+
"name": "sys.get_ifaddrs",
|
|
1078
|
+
"brief": "enumerate network interfaces",
|
|
1079
|
+
"description": "Returns an array of tables with information on network interfaces.",
|
|
1080
|
+
"returnvalues": [
|
|
1081
|
+
{
|
|
1082
|
+
"name": "ifaddrs",
|
|
1083
|
+
"doc": "network interfaces",
|
|
1084
|
+
"types": ["sys.interface_info[]"]
|
|
1085
|
+
}
|
|
1086
|
+
],
|
|
1087
|
+
"parameters": [],
|
|
1088
|
+
"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\">"en0"</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>",
|
|
1089
|
+
"replaces": "",
|
|
1090
|
+
"error": "",
|
|
1091
|
+
"tparams": [],
|
|
1092
|
+
"members": [],
|
|
1093
|
+
"notes": [],
|
|
1094
|
+
"language": ""
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
"type": "FUNCTION",
|
|
1098
|
+
"name": "sys.set_error_handler",
|
|
1099
|
+
"brief": "set the error handler",
|
|
1100
|
+
"description": "Set the Lua error handler function.\nThe error handler is a function which is called whenever a lua runtime error occurs.",
|
|
1101
|
+
"returnvalues": [],
|
|
1102
|
+
"parameters": [
|
|
1103
|
+
{
|
|
1104
|
+
"name": "error_handler",
|
|
1105
|
+
"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>",
|
|
1106
|
+
"types": ["fun(source:string, message:string, traceback:string)"],
|
|
1107
|
+
"is_optional": "False"
|
|
1108
|
+
}
|
|
1109
|
+
],
|
|
1110
|
+
"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\">--> lua</span>\n <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"c1\">--> 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\">--> stack traceback:</span>\n <span class=\"c1\">--> main/test.script:10: in function 'boom'</span>\n <span class=\"c1\">--> main/test.script:15: in function <main/my.script:13></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\">"string"</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>",
|
|
1111
|
+
"replaces": "",
|
|
1112
|
+
"error": "",
|
|
1113
|
+
"tparams": [],
|
|
1114
|
+
"members": [],
|
|
1115
|
+
"notes": [],
|
|
1116
|
+
"language": ""
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
"type": "FUNCTION",
|
|
1120
|
+
"name": "sys.set_connectivity_host",
|
|
1121
|
+
"brief": "set host to check for network connectivity against",
|
|
1122
|
+
"description": "Sets the host that is used to check for network connectivity against.",
|
|
1123
|
+
"returnvalues": [],
|
|
1124
|
+
"parameters": [
|
|
1125
|
+
{
|
|
1126
|
+
"name": "host",
|
|
1127
|
+
"doc": "hostname to check against",
|
|
1128
|
+
"types": ["string"],
|
|
1129
|
+
"is_optional": "False"
|
|
1130
|
+
}
|
|
1131
|
+
],
|
|
1132
|
+
"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\">"www.google.com"</span><span class=\"p\">)</span>\n</code></pre></div>",
|
|
1133
|
+
"replaces": "",
|
|
1134
|
+
"error": "",
|
|
1135
|
+
"tparams": [],
|
|
1136
|
+
"members": [],
|
|
1137
|
+
"notes": [],
|
|
1138
|
+
"language": ""
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
"type": "FUNCTION",
|
|
1142
|
+
"name": "sys.get_connectivity",
|
|
1143
|
+
"brief": "get current network connectivity status",
|
|
1144
|
+
"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>.",
|
|
1145
|
+
"returnvalues": [
|
|
1146
|
+
{
|
|
1147
|
+
"name": "status",
|
|
1148
|
+
"doc": "network connectivity status",
|
|
1149
|
+
"types": ["sys.NETWORK"]
|
|
1150
|
+
}
|
|
1151
|
+
],
|
|
1152
|
+
"parameters": [],
|
|
1153
|
+
"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\">"Connected via cellular, avoid downloading big files!"</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
|
|
1154
|
+
"replaces": "",
|
|
1155
|
+
"error": "",
|
|
1156
|
+
"tparams": [],
|
|
1157
|
+
"members": [],
|
|
1158
|
+
"notes": [],
|
|
1159
|
+
"language": ""
|
|
1160
|
+
},
|
|
1161
|
+
{
|
|
1162
|
+
"type": "FUNCTION",
|
|
1163
|
+
"name": "sys.exit",
|
|
1164
|
+
"brief": "exits application",
|
|
1165
|
+
"description": "Terminates the game application and reports the specified <code>code</code> to the OS.",
|
|
1166
|
+
"returnvalues": [],
|
|
1167
|
+
"parameters": [
|
|
1168
|
+
{
|
|
1169
|
+
"name": "code",
|
|
1170
|
+
"doc": "exit code to report to the OS, 0 means clean exit",
|
|
1171
|
+
"types": ["number"],
|
|
1172
|
+
"is_optional": "False"
|
|
1173
|
+
}
|
|
1174
|
+
],
|
|
1175
|
+
"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\">"quit"</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>",
|
|
1176
|
+
"replaces": "",
|
|
1177
|
+
"error": "",
|
|
1178
|
+
"tparams": [],
|
|
1179
|
+
"members": [],
|
|
1180
|
+
"notes": [],
|
|
1181
|
+
"language": ""
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
"type": "FUNCTION",
|
|
1185
|
+
"name": "sys.reboot",
|
|
1186
|
+
"brief": "reboot engine with arguments",
|
|
1187
|
+
"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.",
|
|
1188
|
+
"returnvalues": [],
|
|
1189
|
+
"parameters": [
|
|
1190
|
+
{
|
|
1191
|
+
"name": "arg1",
|
|
1192
|
+
"doc": "argument 1",
|
|
1193
|
+
"types": ["string"],
|
|
1194
|
+
"is_optional": "True"
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
"name": "arg2",
|
|
1198
|
+
"doc": "argument 2",
|
|
1199
|
+
"types": ["string"],
|
|
1200
|
+
"is_optional": "True"
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
"name": "arg3",
|
|
1204
|
+
"doc": "argument 3",
|
|
1205
|
+
"types": ["string"],
|
|
1206
|
+
"is_optional": "True"
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
"name": "arg4",
|
|
1210
|
+
"doc": "argument 4",
|
|
1211
|
+
"types": ["string"],
|
|
1212
|
+
"is_optional": "True"
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
"name": "arg5",
|
|
1216
|
+
"doc": "argument 5",
|
|
1217
|
+
"types": ["string"],
|
|
1218
|
+
"is_optional": "True"
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
"name": "arg6",
|
|
1222
|
+
"doc": "argument 6",
|
|
1223
|
+
"types": ["string"],
|
|
1224
|
+
"is_optional": "True"
|
|
1225
|
+
}
|
|
1226
|
+
],
|
|
1227
|
+
"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\">'--config=bootstrap.main_collection=/my.collectionc'</span>\n<span class=\"kd\">local</span> <span class=\"n\">arg2</span> <span class=\"o\">=</span> <span class=\"s1\">'build/game.projectc'</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>",
|
|
1228
|
+
"replaces": "",
|
|
1229
|
+
"error": "",
|
|
1230
|
+
"tparams": [],
|
|
1231
|
+
"members": [],
|
|
1232
|
+
"notes": [],
|
|
1233
|
+
"language": ""
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
"type": "FUNCTION",
|
|
1237
|
+
"name": "sys.set_vsync_swap_interval",
|
|
1238
|
+
"brief": "set vsync swap interval",
|
|
1239
|
+
"description": "Request a presentation interval relative to vertical blanks (v-blank).\n0 requests disabling vsync and 1 requests presenting every refresh (the default).\nOpenGL may support larger intervals, such as 2 for every other refresh.\nVulkan and Metal treat any nonzero interval as enabling vsync; DX12 clamps\nintervals to the supported range 0 through 4. Actual behavior depends on\nthe backend, platform, and driver.\nOn platforms where Defold owns the application loop, a positive\n<code>display.update_frequency</code> or a positive value set by <code>sys.set_update_frequency()</code>\nuses timer pacing and requests a swap interval of 0. The requested\nswap interval is retained and applied again when the update frequency is set to 0.\nThis setting may be overridden by driver settings.",
|
|
1240
|
+
"returnvalues": [],
|
|
1241
|
+
"parameters": [
|
|
1242
|
+
{
|
|
1243
|
+
"name": "swap_interval",
|
|
1244
|
+
"doc": "target swap interval.",
|
|
1245
|
+
"types": ["number"],
|
|
1246
|
+
"is_optional": "False"
|
|
1247
|
+
}
|
|
1248
|
+
],
|
|
1249
|
+
"examples": "Setting the swap interval 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>",
|
|
1250
|
+
"replaces": "",
|
|
1251
|
+
"error": "",
|
|
1252
|
+
"tparams": [],
|
|
1253
|
+
"members": [],
|
|
1254
|
+
"notes": [],
|
|
1255
|
+
"language": ""
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
"type": "FUNCTION",
|
|
1259
|
+
"name": "sys.set_update_frequency",
|
|
1260
|
+
"brief": "set update frequency",
|
|
1261
|
+
"description": "Set game update-frequency (frame cap). This option is equivalent to\n<code>display.update_frequency</code> in the \"game.project\" settings but set at run-time.\nOn platforms where Defold owns the application loop, a positive value uses\ntimer pacing and requests a swap interval of 0 to avoid an additional vsync\nwait where supported. Setting the frequency to 0 restores the requested swap\ninterval and uses variable-rate updates. Platform-owned loops, such as HTML5\nand iOS, retain their platform scheduling and presentation behavior. There is\nno guarantee that the frame cap will be achieved depending on platform and\nhardware constraints.\nWith engine-side timer pacing, the update dt can be shortened or enlarged to\naccount for elapsed time; the frame cap does not guarantee a constant dt.\nElapsed time beyond max(engine.max_time_step, 1 / frequency) is discarded,\nso accumulated dt can trail wall-clock time after hitches. An intentional\nfixed interval longer than engine.max_time_step is allowed. This setting\nis separate from the fixed_update() timestep.",
|
|
1262
|
+
"returnvalues": [],
|
|
1263
|
+
"parameters": [
|
|
1264
|
+
{
|
|
1265
|
+
"name": "frequency",
|
|
1266
|
+
"doc": "target frequency in hertz. 0 selects a variable\nframe rate; negative values are treated as 0.",
|
|
1267
|
+
"types": ["number"],
|
|
1268
|
+
"is_optional": "False"
|
|
1269
|
+
}
|
|
1270
|
+
],
|
|
1271
|
+
"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>",
|
|
1272
|
+
"replaces": "",
|
|
1273
|
+
"error": "",
|
|
1274
|
+
"tparams": [],
|
|
1275
|
+
"members": [],
|
|
1276
|
+
"notes": [],
|
|
1277
|
+
"language": ""
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
"type": "FUNCTION",
|
|
1281
|
+
"name": "sys.serialize",
|
|
1282
|
+
"brief": "serializes a lua table to a buffer and returns it",
|
|
1283
|
+
"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.",
|
|
1284
|
+
"returnvalues": [
|
|
1285
|
+
{
|
|
1286
|
+
"name": "buffer",
|
|
1287
|
+
"doc": "serialized data buffer",
|
|
1288
|
+
"types": ["string"]
|
|
1289
|
+
}
|
|
1290
|
+
],
|
|
1291
|
+
"parameters": [
|
|
1292
|
+
{
|
|
1293
|
+
"name": "table",
|
|
1294
|
+
"doc": "lua table to serialize",
|
|
1295
|
+
"types": ["table<any, any>"],
|
|
1296
|
+
"is_optional": "False"
|
|
1297
|
+
}
|
|
1298
|
+
],
|
|
1299
|
+
"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\">"my_value"</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>",
|
|
1300
|
+
"replaces": "",
|
|
1301
|
+
"error": "",
|
|
1302
|
+
"tparams": [],
|
|
1303
|
+
"members": [],
|
|
1304
|
+
"notes": [],
|
|
1305
|
+
"language": ""
|
|
1306
|
+
},
|
|
1307
|
+
{
|
|
1308
|
+
"type": "FUNCTION",
|
|
1309
|
+
"name": "sys.deserialize",
|
|
1310
|
+
"brief": "deserializes buffer into a lua table",
|
|
1311
|
+
"description": "This function will raise a Lua error if an error occurs while deserializing the buffer.",
|
|
1312
|
+
"returnvalues": [
|
|
1313
|
+
{
|
|
1314
|
+
"name": "table",
|
|
1315
|
+
"doc": "lua table with deserialized data",
|
|
1316
|
+
"types": ["table<any, any>"]
|
|
1317
|
+
}
|
|
1318
|
+
],
|
|
1319
|
+
"parameters": [
|
|
1320
|
+
{
|
|
1321
|
+
"name": "buffer",
|
|
1322
|
+
"doc": "buffer to deserialize from",
|
|
1323
|
+
"types": ["string"],
|
|
1324
|
+
"is_optional": "False"
|
|
1325
|
+
}
|
|
1326
|
+
],
|
|
1327
|
+
"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>",
|
|
1328
|
+
"replaces": "",
|
|
1329
|
+
"error": "",
|
|
1330
|
+
"tparams": [],
|
|
1331
|
+
"members": [],
|
|
1332
|
+
"notes": [],
|
|
1333
|
+
"language": ""
|
|
1334
|
+
}
|
|
1335
|
+
],
|
|
1336
|
+
"info": {
|
|
1337
|
+
"namespace": "sys",
|
|
1338
|
+
"name": "System",
|
|
1339
|
+
"brief": "System API documentation",
|
|
1340
|
+
"description": "Functions and messages for using system resources, controlling the engine,\nerror handling and debugging.",
|
|
1341
|
+
"path": "engine/engine/src/script/script_engine.cpp",
|
|
1342
|
+
"file": "",
|
|
1343
|
+
"notes": [],
|
|
1344
|
+
"language": "Lua"
|
|
1345
|
+
},
|
|
1346
|
+
"format_version": 2
|
|
1347
|
+
}
|