@defold-typescript/types 0.52.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (521) hide show
  1. package/api-signatures.json +2074 -1964
  2. package/dist/cli-runtime.js +8966 -0
  3. package/dist/identity-vocabulary.json +660 -0
  4. package/dist/src/index.d.ts +18 -0
  5. package/examples/translations.json +15 -15
  6. package/fixtures/defold-1.12.4/b2d_body_doc.json +1327 -0
  7. package/fixtures/defold-1.12.4/b2d_doc.json +107 -0
  8. package/fixtures/defold-1.12.4/base_doc.json +758 -0
  9. package/fixtures/defold-1.12.4/bit_doc.json +404 -0
  10. package/fixtures/defold-1.12.4/buffer_doc.json +422 -0
  11. package/fixtures/defold-1.12.4/camera_doc.json +664 -0
  12. package/fixtures/defold-1.12.4/collectionfactory_doc.json +219 -0
  13. package/fixtures/defold-1.12.4/collectionproxy_doc.json +289 -0
  14. package/fixtures/defold-1.12.4/coroutine_doc.json +151 -0
  15. package/fixtures/defold-1.12.4/crash_doc.json +497 -0
  16. package/fixtures/defold-1.12.4/debug_doc.json +410 -0
  17. package/fixtures/defold-1.12.4/factory_doc.json +219 -0
  18. package/fixtures/defold-1.12.4/font_doc.json +141 -0
  19. package/fixtures/defold-1.12.4/globals_doc.json +42 -0
  20. package/fixtures/defold-1.12.4/go-instance-functions.json +111 -0
  21. package/fixtures/defold-1.12.4/go_doc.json +1901 -0
  22. package/fixtures/defold-1.12.4/graphics_doc.json +1634 -0
  23. package/fixtures/defold-1.12.4/gui_doc.json +5249 -0
  24. package/fixtures/defold-1.12.4/html5_doc.json +64 -0
  25. package/fixtures/defold-1.12.4/http_doc.json +66 -0
  26. package/fixtures/defold-1.12.4/image_doc.json +170 -0
  27. package/fixtures/defold-1.12.4/io_doc.json +399 -0
  28. package/fixtures/defold-1.12.4/json_doc.json +97 -0
  29. package/fixtures/defold-1.12.4/label_doc.json +220 -0
  30. package/fixtures/defold-1.12.4/liveupdate_doc.json +308 -0
  31. package/fixtures/defold-1.12.4/math_doc.json +702 -0
  32. package/fixtures/defold-1.12.4/messages_doc.json +579 -0
  33. package/fixtures/defold-1.12.4/model_doc.json +315 -0
  34. package/fixtures/defold-1.12.4/msg_doc.json +137 -0
  35. package/fixtures/defold-1.12.4/os_doc.json +266 -0
  36. package/fixtures/defold-1.12.4/package_doc.json +139 -0
  37. package/fixtures/defold-1.12.4/particlefx_doc.json +249 -0
  38. package/fixtures/defold-1.12.4/physics_doc.json +1120 -0
  39. package/fixtures/defold-1.12.4/profiler_doc.json +375 -0
  40. package/fixtures/defold-1.12.4/render_doc.json +1167 -0
  41. package/fixtures/defold-1.12.4/resource_doc.json +762 -0
  42. package/fixtures/defold-1.12.4/socket_doc.json +2194 -0
  43. package/fixtures/defold-1.12.4/sound_doc.json +582 -0
  44. package/fixtures/defold-1.12.4/sprite_doc.json +245 -0
  45. package/fixtures/defold-1.12.4/string_doc.json +412 -0
  46. package/fixtures/defold-1.12.4/sys_doc.json +853 -0
  47. package/fixtures/defold-1.12.4/table_doc.json +166 -0
  48. package/fixtures/defold-1.12.4/tilemap_doc.json +374 -0
  49. package/fixtures/defold-1.12.4/timer_doc.json +153 -0
  50. package/fixtures/defold-1.12.4/types_doc.json +212 -0
  51. package/fixtures/defold-1.12.4/vmath_doc.json +1814 -0
  52. package/fixtures/defold-1.12.4/window_doc.json +388 -0
  53. package/fixtures/defold-1.12.4/zlib_doc.json +70 -0
  54. package/fixtures/defold-1.13.0/b2d_body_doc.json +2428 -0
  55. package/fixtures/defold-1.13.0/b2d_chain_doc.json +394 -0
  56. package/fixtures/defold-1.13.0/b2d_doc.json +128 -0
  57. package/fixtures/defold-1.13.0/b2d_fixture_doc.json +594 -0
  58. package/fixtures/defold-1.13.0/b2d_joint_doc.json +3315 -0
  59. package/fixtures/defold-1.13.0/b2d_shape_doc.json +802 -0
  60. package/fixtures/defold-1.13.0/b2d_world_doc.json +1314 -0
  61. package/fixtures/defold-1.13.0/base_doc.json +758 -0
  62. package/fixtures/defold-1.13.0/bit_doc.json +404 -0
  63. package/fixtures/defold-1.13.0/buffer_doc.json +422 -0
  64. package/fixtures/defold-1.13.0/camera_doc.json +900 -0
  65. package/fixtures/defold-1.13.0/collectionfactory_doc.json +219 -0
  66. package/fixtures/defold-1.13.0/collectionproxy_doc.json +289 -0
  67. package/fixtures/defold-1.13.0/compute_doc.json +182 -0
  68. package/fixtures/defold-1.13.0/coroutine_doc.json +151 -0
  69. package/fixtures/defold-1.13.0/crash_doc.json +497 -0
  70. package/fixtures/defold-1.13.0/debug_doc.json +410 -0
  71. package/fixtures/defold-1.13.0/editor_doc.json +3665 -0
  72. package/fixtures/defold-1.13.0/editor_http_doc.json +273 -0
  73. package/fixtures/defold-1.13.0/editor_json_doc.json +59 -0
  74. package/fixtures/defold-1.13.0/editor_localization_doc.json +138 -0
  75. package/fixtures/defold-1.13.0/editor_pprint_doc.json +36 -0
  76. package/fixtures/defold-1.13.0/editor_tilemap_tiles_doc.json +235 -0
  77. package/fixtures/defold-1.13.0/editor_zip_doc.json +163 -0
  78. package/fixtures/defold-1.13.0/editor_zlib_doc.json +48 -0
  79. package/fixtures/defold-1.13.0/factory_doc.json +219 -0
  80. package/fixtures/defold-1.13.0/font_doc.json +141 -0
  81. package/fixtures/defold-1.13.0/globals_doc.json +42 -0
  82. package/fixtures/defold-1.13.0/go-instance-functions.json +101 -0
  83. package/fixtures/defold-1.13.0/go_doc.json +1989 -0
  84. package/fixtures/defold-1.13.0/graphics_doc.json +1886 -0
  85. package/fixtures/defold-1.13.0/gui_doc.json +5277 -0
  86. package/fixtures/defold-1.13.0/html5_doc.json +64 -0
  87. package/fixtures/defold-1.13.0/http_doc.json +66 -0
  88. package/fixtures/defold-1.13.0/image_doc.json +170 -0
  89. package/fixtures/defold-1.13.0/import-manifest.json +10558 -0
  90. package/fixtures/defold-1.13.0/io_doc.json +399 -0
  91. package/fixtures/defold-1.13.0/json_doc.json +97 -0
  92. package/fixtures/defold-1.13.0/label_doc.json +220 -0
  93. package/fixtures/defold-1.13.0/liveupdate_doc.json +330 -0
  94. package/fixtures/defold-1.13.0/material_doc.json +238 -0
  95. package/fixtures/defold-1.13.0/math_doc.json +702 -0
  96. package/fixtures/defold-1.13.0/model_doc.json +412 -0
  97. package/fixtures/defold-1.13.0/msg_doc.json +137 -0
  98. package/fixtures/defold-1.13.0/os_doc.json +266 -0
  99. package/fixtures/defold-1.13.0/package_doc.json +139 -0
  100. package/fixtures/defold-1.13.0/particlefx_doc.json +249 -0
  101. package/fixtures/defold-1.13.0/physics_doc.json +1492 -0
  102. package/fixtures/defold-1.13.0/profiler_doc.json +375 -0
  103. package/fixtures/defold-1.13.0/render_doc.json +1381 -0
  104. package/fixtures/defold-1.13.0/resource_doc.json +762 -0
  105. package/fixtures/defold-1.13.0/socket_doc.json +2194 -0
  106. package/fixtures/defold-1.13.0/sound_doc.json +582 -0
  107. package/fixtures/defold-1.13.0/sprite_doc.json +335 -0
  108. package/fixtures/defold-1.13.0/string_doc.json +412 -0
  109. package/fixtures/defold-1.13.0/sys_doc.json +1142 -0
  110. package/fixtures/defold-1.13.0/table_doc.json +166 -0
  111. package/fixtures/defold-1.13.0/tilemap_doc.json +402 -0
  112. package/fixtures/defold-1.13.0/timer_doc.json +153 -0
  113. package/fixtures/defold-1.13.0/types_doc.json +212 -0
  114. package/fixtures/defold-1.13.0/vmath_doc.json +1814 -0
  115. package/fixtures/defold-1.13.0/window_doc.json +388 -0
  116. package/fixtures/defold-1.13.0/zlib_doc.json +70 -0
  117. package/fixtures/defold-1.13.1/b2d_body_doc.json +2428 -0
  118. package/fixtures/defold-1.13.1/b2d_chain_doc.json +394 -0
  119. package/fixtures/defold-1.13.1/b2d_doc.json +128 -0
  120. package/fixtures/defold-1.13.1/b2d_fixture_doc.json +594 -0
  121. package/fixtures/defold-1.13.1/b2d_joint_doc.json +3315 -0
  122. package/fixtures/defold-1.13.1/b2d_shape_doc.json +802 -0
  123. package/fixtures/defold-1.13.1/b2d_world_doc.json +1314 -0
  124. package/fixtures/defold-1.13.1/base_doc.json +758 -0
  125. package/fixtures/defold-1.13.1/bit_doc.json +404 -0
  126. package/fixtures/defold-1.13.1/buffer_doc.json +422 -0
  127. package/fixtures/defold-1.13.1/camera_doc.json +900 -0
  128. package/fixtures/defold-1.13.1/collectionfactory_doc.json +219 -0
  129. package/fixtures/defold-1.13.1/collectionproxy_doc.json +323 -0
  130. package/fixtures/defold-1.13.1/compute_doc.json +182 -0
  131. package/fixtures/defold-1.13.1/coroutine_doc.json +151 -0
  132. package/fixtures/defold-1.13.1/crash_doc.json +497 -0
  133. package/fixtures/defold-1.13.1/debug_doc.json +410 -0
  134. package/fixtures/defold-1.13.1/editor_doc.json +3880 -0
  135. package/fixtures/defold-1.13.1/editor_http_doc.json +273 -0
  136. package/fixtures/defold-1.13.1/editor_image_doc.json +128 -0
  137. package/fixtures/defold-1.13.1/editor_json_doc.json +59 -0
  138. package/fixtures/defold-1.13.1/editor_localization_doc.json +138 -0
  139. package/fixtures/defold-1.13.1/editor_pprint_doc.json +36 -0
  140. package/fixtures/defold-1.13.1/editor_tilemap_tiles_doc.json +235 -0
  141. package/fixtures/defold-1.13.1/editor_zip_doc.json +163 -0
  142. package/fixtures/defold-1.13.1/editor_zlib_doc.json +48 -0
  143. package/fixtures/defold-1.13.1/factory_doc.json +219 -0
  144. package/fixtures/defold-1.13.1/font_doc.json +141 -0
  145. package/fixtures/defold-1.13.1/globals_doc.json +42 -0
  146. package/fixtures/defold-1.13.1/go-instance-functions.json +102 -0
  147. package/fixtures/defold-1.13.1/go_doc.json +1989 -0
  148. package/fixtures/defold-1.13.1/graphics_doc.json +1886 -0
  149. package/fixtures/defold-1.13.1/gui_doc.json +5277 -0
  150. package/fixtures/defold-1.13.1/html5_doc.json +64 -0
  151. package/fixtures/defold-1.13.1/http_doc.json +66 -0
  152. package/fixtures/defold-1.13.1/image_doc.json +170 -0
  153. package/fixtures/defold-1.13.1/import-manifest.json +10091 -0
  154. package/fixtures/defold-1.13.1/io_doc.json +399 -0
  155. package/fixtures/defold-1.13.1/json_doc.json +97 -0
  156. package/fixtures/defold-1.13.1/label_doc.json +220 -0
  157. package/fixtures/defold-1.13.1/liveupdate_doc.json +330 -0
  158. package/fixtures/defold-1.13.1/material_doc.json +238 -0
  159. package/fixtures/defold-1.13.1/math_doc.json +702 -0
  160. package/fixtures/defold-1.13.1/model_doc.json +412 -0
  161. package/fixtures/defold-1.13.1/msg_doc.json +137 -0
  162. package/fixtures/defold-1.13.1/os_doc.json +266 -0
  163. package/fixtures/defold-1.13.1/package_doc.json +139 -0
  164. package/fixtures/defold-1.13.1/particlefx_doc.json +249 -0
  165. package/fixtures/defold-1.13.1/physics_doc.json +1492 -0
  166. package/fixtures/defold-1.13.1/profiler_doc.json +375 -0
  167. package/fixtures/defold-1.13.1/render_doc.json +1381 -0
  168. package/fixtures/defold-1.13.1/resource_doc.json +762 -0
  169. package/fixtures/defold-1.13.1/socket_doc.json +2194 -0
  170. package/fixtures/defold-1.13.1/sound_doc.json +582 -0
  171. package/fixtures/defold-1.13.1/sprite_doc.json +335 -0
  172. package/fixtures/defold-1.13.1/string_doc.json +412 -0
  173. package/fixtures/defold-1.13.1/sys_doc.json +1142 -0
  174. package/fixtures/defold-1.13.1/table_doc.json +166 -0
  175. package/fixtures/defold-1.13.1/tilemap_doc.json +402 -0
  176. package/fixtures/defold-1.13.1/timer_doc.json +153 -0
  177. package/fixtures/defold-1.13.1/types_doc.json +212 -0
  178. package/fixtures/defold-1.13.1/vmath_doc.json +1814 -0
  179. package/fixtures/defold-1.13.1/window_doc.json +388 -0
  180. package/fixtures/defold-1.13.1/zlib_doc.json +70 -0
  181. package/fixtures/defold-1.13.2/b2d_body_doc.json +2359 -0
  182. package/fixtures/defold-1.13.2/b2d_chain_doc.json +395 -0
  183. package/fixtures/defold-1.13.2/b2d_doc.json +1945 -0
  184. package/fixtures/defold-1.13.2/b2d_fixture_doc.json +595 -0
  185. package/fixtures/defold-1.13.2/b2d_joint_doc.json +3178 -0
  186. package/fixtures/defold-1.13.2/b2d_shape_doc.json +767 -0
  187. package/fixtures/defold-1.13.2/b2d_world_doc.json +1315 -0
  188. package/fixtures/defold-1.13.2/base_doc.json +759 -0
  189. package/fixtures/defold-1.13.2/bit_doc.json +405 -0
  190. package/fixtures/defold-1.13.2/buffer_doc.json +393 -0
  191. package/fixtures/defold-1.13.2/bullet3d_collision_object_doc.json +1206 -0
  192. package/fixtures/defold-1.13.2/bullet3d_constraint_doc.json +2455 -0
  193. package/fixtures/defold-1.13.2/bullet3d_doc.json +215 -0
  194. package/fixtures/defold-1.13.2/bullet3d_rigid_body_doc.json +1376 -0
  195. package/fixtures/defold-1.13.2/bullet3d_shape_doc.json +430 -0
  196. package/fixtures/defold-1.13.2/bullet3d_world_doc.json +855 -0
  197. package/fixtures/defold-1.13.2/camera_doc.json +887 -0
  198. package/fixtures/defold-1.13.2/collectionfactory_doc.json +206 -0
  199. package/fixtures/defold-1.13.2/collectionproxy_doc.json +397 -0
  200. package/fixtures/defold-1.13.2/compute_doc.json +183 -0
  201. package/fixtures/defold-1.13.2/coroutine_doc.json +152 -0
  202. package/fixtures/defold-1.13.2/crash_doc.json +483 -0
  203. package/fixtures/defold-1.13.2/debug_doc.json +411 -0
  204. package/fixtures/defold-1.13.2/editor_doc.json +6320 -0
  205. package/fixtures/defold-1.13.2/editor_http_doc.json +476 -0
  206. package/fixtures/defold-1.13.2/editor_image_doc.json +129 -0
  207. package/fixtures/defold-1.13.2/editor_json_doc.json +81 -0
  208. package/fixtures/defold-1.13.2/editor_localization_doc.json +139 -0
  209. package/fixtures/defold-1.13.2/editor_pprint_doc.json +37 -0
  210. package/fixtures/defold-1.13.2/editor_tilemap_tiles_doc.json +292 -0
  211. package/fixtures/defold-1.13.2/editor_zip_doc.json +237 -0
  212. package/fixtures/defold-1.13.2/editor_zlib_doc.json +49 -0
  213. package/fixtures/defold-1.13.2/factory_doc.json +206 -0
  214. package/fixtures/defold-1.13.2/font_doc.json +230 -0
  215. package/fixtures/defold-1.13.2/globals_doc.json +64 -0
  216. package/fixtures/defold-1.13.2/go-instance-functions.json +106 -0
  217. package/fixtures/defold-1.13.2/go_doc.json +1789 -0
  218. package/fixtures/defold-1.13.2/graphics_doc.json +1211 -0
  219. package/fixtures/defold-1.13.2/gui_doc.json +4735 -0
  220. package/fixtures/defold-1.13.2/html5_doc.json +65 -0
  221. package/fixtures/defold-1.13.2/http_doc.json +174 -0
  222. package/fixtures/defold-1.13.2/image_doc.json +298 -0
  223. package/fixtures/defold-1.13.2/import-manifest.json +10902 -0
  224. package/fixtures/defold-1.13.2/io_doc.json +400 -0
  225. package/fixtures/defold-1.13.2/json_doc.json +140 -0
  226. package/fixtures/defold-1.13.2/label_doc.json +427 -0
  227. package/fixtures/defold-1.13.2/liveupdate_doc.json +221 -0
  228. package/fixtures/defold-1.13.2/material_doc.json +773 -0
  229. package/fixtures/defold-1.13.2/math_doc.json +703 -0
  230. package/fixtures/defold-1.13.2/model_doc.json +472 -0
  231. package/fixtures/defold-1.13.2/msg_doc.json +169 -0
  232. package/fixtures/defold-1.13.2/os_doc.json +269 -0
  233. package/fixtures/defold-1.13.2/package_doc.json +140 -0
  234. package/fixtures/defold-1.13.2/particlefx_doc.json +249 -0
  235. package/fixtures/defold-1.13.2/physics_doc.json +1624 -0
  236. package/fixtures/defold-1.13.2/profiler_doc.json +348 -0
  237. package/fixtures/defold-1.13.2/render_doc.json +1623 -0
  238. package/fixtures/defold-1.13.2/resource_doc.json +1539 -0
  239. package/fixtures/defold-1.13.2/socket_doc.json +2335 -0
  240. package/fixtures/defold-1.13.2/sound_doc.json +673 -0
  241. package/fixtures/defold-1.13.2/sprite_doc.json +364 -0
  242. package/fixtures/defold-1.13.2/string_doc.json +413 -0
  243. package/fixtures/defold-1.13.2/sys_doc.json +1347 -0
  244. package/fixtures/defold-1.13.2/table_doc.json +167 -0
  245. package/fixtures/defold-1.13.2/tilemap_doc.json +369 -0
  246. package/fixtures/defold-1.13.2/timer_doc.json +214 -0
  247. package/fixtures/defold-1.13.2/types_doc.json +213 -0
  248. package/fixtures/defold-1.13.2/vmath_doc.json +2056 -0
  249. package/fixtures/defold-1.13.2/window_doc.json +426 -0
  250. package/fixtures/defold-1.13.2/zlib_doc.json +71 -0
  251. package/fixtures/defold-1.14.0/b2d_body_doc.json +2359 -0
  252. package/fixtures/defold-1.14.0/b2d_chain_doc.json +395 -0
  253. package/fixtures/defold-1.14.0/b2d_doc.json +1973 -0
  254. package/fixtures/defold-1.14.0/b2d_fixture_doc.json +595 -0
  255. package/fixtures/defold-1.14.0/b2d_joint_doc.json +3178 -0
  256. package/fixtures/defold-1.14.0/b2d_shape_doc.json +767 -0
  257. package/fixtures/defold-1.14.0/b2d_world_doc.json +1315 -0
  258. package/fixtures/defold-1.14.0/base_doc.json +759 -0
  259. package/fixtures/defold-1.14.0/bit_doc.json +405 -0
  260. package/fixtures/defold-1.14.0/buffer_doc.json +393 -0
  261. package/fixtures/defold-1.14.0/bullet3d_collision_object_doc.json +1206 -0
  262. package/fixtures/defold-1.14.0/bullet3d_constraint_doc.json +2455 -0
  263. package/fixtures/defold-1.14.0/bullet3d_doc.json +243 -0
  264. package/fixtures/defold-1.14.0/bullet3d_rigid_body_doc.json +1376 -0
  265. package/fixtures/defold-1.14.0/bullet3d_shape_doc.json +430 -0
  266. package/fixtures/defold-1.14.0/bullet3d_world_doc.json +855 -0
  267. package/fixtures/defold-1.14.0/camera_doc.json +887 -0
  268. package/fixtures/defold-1.14.0/collectionfactory_doc.json +206 -0
  269. package/fixtures/defold-1.14.0/collectionproxy_doc.json +397 -0
  270. package/fixtures/defold-1.14.0/compute_doc.json +183 -0
  271. package/fixtures/defold-1.14.0/coroutine_doc.json +152 -0
  272. package/fixtures/defold-1.14.0/crash_doc.json +483 -0
  273. package/fixtures/defold-1.14.0/debug_doc.json +411 -0
  274. package/fixtures/defold-1.14.0/editor_doc.json +6320 -0
  275. package/fixtures/defold-1.14.0/editor_http_doc.json +476 -0
  276. package/fixtures/defold-1.14.0/editor_image_doc.json +129 -0
  277. package/fixtures/defold-1.14.0/editor_json_doc.json +81 -0
  278. package/fixtures/defold-1.14.0/editor_localization_doc.json +139 -0
  279. package/fixtures/defold-1.14.0/editor_pprint_doc.json +37 -0
  280. package/fixtures/defold-1.14.0/editor_tilemap_tiles_doc.json +292 -0
  281. package/fixtures/defold-1.14.0/editor_zip_doc.json +237 -0
  282. package/fixtures/defold-1.14.0/editor_zlib_doc.json +49 -0
  283. package/fixtures/defold-1.14.0/factory_doc.json +206 -0
  284. package/fixtures/defold-1.14.0/font_doc.json +230 -0
  285. package/fixtures/defold-1.14.0/globals_doc.json +64 -0
  286. package/fixtures/defold-1.14.0/go-instance-functions.json +106 -0
  287. package/fixtures/defold-1.14.0/go_doc.json +1789 -0
  288. package/fixtures/defold-1.14.0/graphics_doc.json +1257 -0
  289. package/fixtures/defold-1.14.0/gui_doc.json +4735 -0
  290. package/fixtures/defold-1.14.0/html5_doc.json +65 -0
  291. package/fixtures/defold-1.14.0/http_doc.json +174 -0
  292. package/fixtures/defold-1.14.0/image_doc.json +298 -0
  293. package/fixtures/defold-1.14.0/import-manifest.json +10260 -0
  294. package/fixtures/defold-1.14.0/io_doc.json +400 -0
  295. package/fixtures/defold-1.14.0/json_doc.json +140 -0
  296. package/fixtures/defold-1.14.0/label_doc.json +427 -0
  297. package/fixtures/defold-1.14.0/liveupdate_doc.json +221 -0
  298. package/fixtures/defold-1.14.0/material_doc.json +773 -0
  299. package/fixtures/defold-1.14.0/math_doc.json +703 -0
  300. package/fixtures/defold-1.14.0/model_doc.json +472 -0
  301. package/fixtures/defold-1.14.0/msg_doc.json +169 -0
  302. package/fixtures/defold-1.14.0/os_doc.json +269 -0
  303. package/fixtures/defold-1.14.0/package_doc.json +140 -0
  304. package/fixtures/defold-1.14.0/particlefx_doc.json +249 -0
  305. package/fixtures/defold-1.14.0/physics_doc.json +1624 -0
  306. package/fixtures/defold-1.14.0/profiler_doc.json +348 -0
  307. package/fixtures/defold-1.14.0/render_doc.json +1628 -0
  308. package/fixtures/defold-1.14.0/resource_doc.json +1539 -0
  309. package/fixtures/defold-1.14.0/socket_doc.json +2335 -0
  310. package/fixtures/defold-1.14.0/sound_doc.json +673 -0
  311. package/fixtures/defold-1.14.0/sprite_doc.json +364 -0
  312. package/fixtures/defold-1.14.0/string_doc.json +413 -0
  313. package/fixtures/defold-1.14.0/sys_doc.json +1347 -0
  314. package/fixtures/defold-1.14.0/table_doc.json +167 -0
  315. package/fixtures/defold-1.14.0/tilemap_doc.json +369 -0
  316. package/fixtures/defold-1.14.0/timer_doc.json +214 -0
  317. package/fixtures/defold-1.14.0/types_doc.json +213 -0
  318. package/fixtures/defold-1.14.0/vmath_doc.json +2056 -0
  319. package/fixtures/defold-1.14.0/window_doc.json +426 -0
  320. package/fixtures/defold-1.14.0/zlib_doc.json +71 -0
  321. package/generated/b2d.d.ts +39 -39
  322. package/generated/b2d_body.d.ts +11 -11
  323. package/generated/b2d_chain.d.ts +3 -3
  324. package/generated/b2d_fixture.d.ts +5 -5
  325. package/generated/b2d_joint.d.ts +29 -29
  326. package/generated/b2d_shape.d.ts +13 -13
  327. package/generated/b2d_world.d.ts +15 -15
  328. package/generated/buffer.d.ts +5 -6
  329. package/generated/bullet3d.d.ts +6 -6
  330. package/generated/bullet3d_collision_object.d.ts +9 -9
  331. package/generated/bullet3d_constraint.d.ts +78 -78
  332. package/generated/bullet3d_rigid_body.d.ts +3 -3
  333. package/generated/bullet3d_shape.d.ts +11 -11
  334. package/generated/bullet3d_world.d.ts +20 -20
  335. package/generated/camera.d.ts +4 -4
  336. package/generated/collectionfactory.d.ts +2 -3
  337. package/generated/collectionproxy.d.ts +5 -5
  338. package/generated/compute.d.ts +5 -5
  339. package/generated/crash.d.ts +7 -7
  340. package/generated/editor-vm/http.d.ts +13 -13
  341. package/generated/editor-vm/image.d.ts +4 -4
  342. package/generated/editor-vm/json.d.ts +1 -1
  343. package/generated/editor-vm/tilemap_tiles.d.ts +9 -9
  344. package/generated/editor-vm/zip.d.ts +4 -4
  345. package/generated/editor.d.ts +183 -183
  346. package/generated/factory.d.ts +2 -3
  347. package/generated/font.d.ts +4 -4
  348. package/generated/go.d.ts +10 -12
  349. package/generated/graphics.d.ts +23 -26
  350. package/generated/gui.d.ts +44 -58
  351. package/generated/http.d.ts +2 -2
  352. package/generated/image.d.ts +12 -12
  353. package/generated/json.d.ts +4 -4
  354. package/generated/label.d.ts +5 -5
  355. package/generated/liveupdate.d.ts +3 -3
  356. package/generated/material.d.ts +48 -48
  357. package/generated/model.d.ts +46 -14
  358. package/generated/particlefx.d.ts +5 -5
  359. package/generated/physics.d.ts +19 -19
  360. package/generated/profiler.d.ts +3 -5
  361. package/generated/render-script-modules/b2d.d.ts +39 -39
  362. package/generated/render-script-modules/bullet3d.d.ts +5 -5
  363. package/generated/render-script-modules/collectionfactory.d.ts +1 -2
  364. package/generated/render-script-modules/collectionproxy.d.ts +3 -3
  365. package/generated/render-script-modules/factory.d.ts +1 -2
  366. package/generated/render-script-modules/go.d.ts +8 -10
  367. package/generated/render-script-modules/label.d.ts +2 -2
  368. package/generated/render-script-modules/model.d.ts +43 -11
  369. package/generated/render-script-modules/particlefx.d.ts +3 -3
  370. package/generated/render-script-modules/physics.d.ts +12 -12
  371. package/generated/render-script-modules/resource.d.ts +52 -53
  372. package/generated/render-script-modules/sound.d.ts +4 -4
  373. package/generated/render-script-modules/sprite.d.ts +2 -2
  374. package/generated/render-script-modules/tilemap.d.ts +2 -2
  375. package/generated/render.d.ts +44 -45
  376. package/generated/resource.d.ts +58 -59
  377. package/generated/socket.d.ts +18 -23
  378. package/generated/sound.d.ts +6 -6
  379. package/generated/sprite.d.ts +3 -3
  380. package/generated/sys.d.ts +20 -21
  381. package/generated/tilemap.d.ts +3 -3
  382. package/generated/timer.d.ts +3 -3
  383. package/generated/versions/defold-1.12.4/b2d.d.ts +2 -2
  384. package/generated/versions/defold-1.12.4/b2d_body.d.ts +2 -2
  385. package/generated/versions/defold-1.12.4/go.d.ts +2 -2
  386. package/generated/versions/defold-1.12.4/graphics.d.ts +1 -1
  387. package/generated/versions/defold-1.12.4/gui.d.ts +18 -19
  388. package/generated/versions/defold-1.12.4/label.d.ts +1 -1
  389. package/generated/versions/defold-1.12.4/model.d.ts +42 -10
  390. package/generated/versions/defold-1.12.4/particlefx.d.ts +1 -1
  391. package/generated/versions/defold-1.12.4/physics.d.ts +1 -1
  392. package/generated/versions/defold-1.12.4/render.d.ts +5 -5
  393. package/generated/versions/defold-1.12.4/resource.d.ts +8 -8
  394. package/generated/versions/defold-1.12.4/socket.d.ts +12 -12
  395. package/generated/versions/defold-1.12.4/sound.d.ts +1 -1
  396. package/generated/versions/defold-1.12.4/sprite.d.ts +1 -1
  397. package/generated/versions/defold-1.12.4/sys.d.ts +2 -2
  398. package/generated/versions/defold-1.12.4/tilemap.d.ts +1 -1
  399. package/generated/versions/defold-1.12.4/window.d.ts +3 -4
  400. package/generated/versions/defold-1.13.0/b2d.d.ts +2 -2
  401. package/generated/versions/defold-1.13.0/b2d_body.d.ts +2 -2
  402. package/generated/versions/defold-1.13.0/b2d_chain.d.ts +1 -1
  403. package/generated/versions/defold-1.13.0/b2d_joint.d.ts +1 -1
  404. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +1 -1
  405. package/generated/versions/defold-1.13.0/camera.d.ts +1 -1
  406. package/generated/versions/defold-1.13.0/go.d.ts +2 -2
  407. package/generated/versions/defold-1.13.0/graphics.d.ts +1 -1
  408. package/generated/versions/defold-1.13.0/gui.d.ts +18 -19
  409. package/generated/versions/defold-1.13.0/label.d.ts +1 -1
  410. package/generated/versions/defold-1.13.0/model.d.ts +42 -10
  411. package/generated/versions/defold-1.13.0/particlefx.d.ts +1 -1
  412. package/generated/versions/defold-1.13.0/physics.d.ts +1 -1
  413. package/generated/versions/defold-1.13.0/render.d.ts +5 -5
  414. package/generated/versions/defold-1.13.0/resource.d.ts +8 -8
  415. package/generated/versions/defold-1.13.0/socket.d.ts +12 -12
  416. package/generated/versions/defold-1.13.0/sound.d.ts +1 -1
  417. package/generated/versions/defold-1.13.0/sprite.d.ts +1 -1
  418. package/generated/versions/defold-1.13.0/sys.d.ts +2 -2
  419. package/generated/versions/defold-1.13.0/tilemap.d.ts +1 -1
  420. package/generated/versions/defold-1.13.0/window.d.ts +3 -4
  421. package/generated/versions/defold-1.13.1/b2d.d.ts +2 -2
  422. package/generated/versions/defold-1.13.1/b2d_body.d.ts +2 -2
  423. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +1 -1
  424. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +1 -1
  425. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +1 -1
  426. package/generated/versions/defold-1.13.1/camera.d.ts +1 -1
  427. package/generated/versions/defold-1.13.1/go.d.ts +2 -2
  428. package/generated/versions/defold-1.13.1/graphics.d.ts +1 -1
  429. package/generated/versions/defold-1.13.1/gui.d.ts +18 -19
  430. package/generated/versions/defold-1.13.1/label.d.ts +1 -1
  431. package/generated/versions/defold-1.13.1/model.d.ts +42 -10
  432. package/generated/versions/defold-1.13.1/particlefx.d.ts +1 -1
  433. package/generated/versions/defold-1.13.1/physics.d.ts +1 -1
  434. package/generated/versions/defold-1.13.1/render.d.ts +5 -5
  435. package/generated/versions/defold-1.13.1/resource.d.ts +8 -8
  436. package/generated/versions/defold-1.13.1/socket.d.ts +12 -12
  437. package/generated/versions/defold-1.13.1/sound.d.ts +1 -1
  438. package/generated/versions/defold-1.13.1/sprite.d.ts +1 -1
  439. package/generated/versions/defold-1.13.1/sys.d.ts +2 -2
  440. package/generated/versions/defold-1.13.1/tilemap.d.ts +1 -1
  441. package/generated/versions/defold-1.13.1/window.d.ts +3 -4
  442. package/generated/versions/defold-1.13.2/b2d.d.ts +39 -39
  443. package/generated/versions/defold-1.13.2/b2d_body.d.ts +11 -11
  444. package/generated/versions/defold-1.13.2/b2d_chain.d.ts +3 -3
  445. package/generated/versions/defold-1.13.2/b2d_fixture.d.ts +5 -5
  446. package/generated/versions/defold-1.13.2/b2d_joint.d.ts +29 -29
  447. package/generated/versions/defold-1.13.2/b2d_shape.d.ts +13 -13
  448. package/generated/versions/defold-1.13.2/b2d_world.d.ts +15 -15
  449. package/generated/versions/defold-1.13.2/buffer.d.ts +5 -6
  450. package/generated/versions/defold-1.13.2/bullet3d.d.ts +6 -6
  451. package/generated/versions/defold-1.13.2/bullet3d_collision_object.d.ts +9 -9
  452. package/generated/versions/defold-1.13.2/bullet3d_constraint.d.ts +78 -78
  453. package/generated/versions/defold-1.13.2/bullet3d_rigid_body.d.ts +3 -3
  454. package/generated/versions/defold-1.13.2/bullet3d_shape.d.ts +11 -11
  455. package/generated/versions/defold-1.13.2/bullet3d_world.d.ts +20 -20
  456. package/generated/versions/defold-1.13.2/camera.d.ts +4 -4
  457. package/generated/versions/defold-1.13.2/collectionfactory.d.ts +2 -3
  458. package/generated/versions/defold-1.13.2/collectionproxy.d.ts +5 -5
  459. package/generated/versions/defold-1.13.2/compute.d.ts +5 -5
  460. package/generated/versions/defold-1.13.2/crash.d.ts +7 -7
  461. package/generated/versions/defold-1.13.2/editor-vm/http.d.ts +13 -13
  462. package/generated/versions/defold-1.13.2/editor-vm/image.d.ts +4 -4
  463. package/generated/versions/defold-1.13.2/editor-vm/json.d.ts +1 -1
  464. package/generated/versions/defold-1.13.2/editor-vm/tilemap_tiles.d.ts +9 -9
  465. package/generated/versions/defold-1.13.2/editor-vm/zip.d.ts +4 -4
  466. package/generated/versions/defold-1.13.2/editor.d.ts +183 -183
  467. package/generated/versions/defold-1.13.2/factory.d.ts +2 -3
  468. package/generated/versions/defold-1.13.2/font.d.ts +4 -4
  469. package/generated/versions/defold-1.13.2/go.d.ts +10 -12
  470. package/generated/versions/defold-1.13.2/graphics.d.ts +22 -25
  471. package/generated/versions/defold-1.13.2/gui.d.ts +44 -58
  472. package/generated/versions/defold-1.13.2/http.d.ts +2 -2
  473. package/generated/versions/defold-1.13.2/image.d.ts +12 -12
  474. package/generated/versions/defold-1.13.2/json.d.ts +4 -4
  475. package/generated/versions/defold-1.13.2/label.d.ts +5 -5
  476. package/generated/versions/defold-1.13.2/liveupdate.d.ts +3 -3
  477. package/generated/versions/defold-1.13.2/material.d.ts +48 -48
  478. package/generated/versions/defold-1.13.2/model.d.ts +46 -14
  479. package/generated/versions/defold-1.13.2/particlefx.d.ts +5 -5
  480. package/generated/versions/defold-1.13.2/physics.d.ts +19 -19
  481. package/generated/versions/defold-1.13.2/profiler.d.ts +3 -5
  482. package/generated/versions/defold-1.13.2/render.d.ts +43 -44
  483. package/generated/versions/defold-1.13.2/resource.d.ts +58 -59
  484. package/generated/versions/defold-1.13.2/socket.d.ts +18 -23
  485. package/generated/versions/defold-1.13.2/sound.d.ts +6 -6
  486. package/generated/versions/defold-1.13.2/sprite.d.ts +3 -3
  487. package/generated/versions/defold-1.13.2/sys.d.ts +20 -21
  488. package/generated/versions/defold-1.13.2/tilemap.d.ts +3 -3
  489. package/generated/versions/defold-1.13.2/timer.d.ts +3 -3
  490. package/generated/versions/defold-1.13.2/vmath.d.ts +0 -1
  491. package/generated/versions/defold-1.13.2/window.d.ts +8 -10
  492. package/generated/vmath.d.ts +0 -1
  493. package/generated/window.d.ts +8 -10
  494. package/identity-vocabulary.json +41 -34
  495. package/package.json +13 -5
  496. package/scripts/cli-runtime.ts +18 -0
  497. package/scripts/example-store-io.ts +2 -2
  498. package/scripts/extension-goldens.ts +9 -5
  499. package/scripts/generate-api-availability.ts +10 -4
  500. package/scripts/generate-api-signatures.ts +1 -1
  501. package/scripts/import-defold-release.ts +1 -1
  502. package/scripts/regen.ts +35 -9
  503. package/scripts/shared-handle-methods.ts +3 -2
  504. package/scripts/signature-store-fs.ts +37 -17
  505. package/scripts/sync-api-docs.ts +127 -20
  506. package/src/api-doc.ts +19 -4
  507. package/src/api-identity.ts +32 -1
  508. package/src/component-properties.d.ts +8 -8
  509. package/src/core-types.ts +29 -13
  510. package/src/doc-corrections.ts +9 -0
  511. package/src/emit-dts.ts +770 -214
  512. package/src/engine-type-name.ts +33 -0
  513. package/src/go-overloads.d.ts +10 -10
  514. package/src/gui-overloads.d.ts +11 -11
  515. package/src/index-slot-classifications.ts +75 -9
  516. package/src/index.ts +4 -1
  517. package/src/lifecycle.ts +2 -2
  518. package/src/publish-dts.ts +16 -0
  519. package/src/script-api.ts +36 -38
  520. package/src/socket-types.d.ts +3 -3
  521. package/src/library-index-slot-classifications.ts +0 -332
@@ -0,0 +1,1167 @@
1
+ {
2
+ "elements": [
3
+ {
4
+ "type": "TYPEDEF",
5
+ "name": "constant_buffer",
6
+ "brief": "Constant buffer",
7
+ "description": "Constant buffer",
8
+ "returnvalues": [],
9
+ "parameters": [
10
+ {
11
+ "name": "value",
12
+ "doc": "",
13
+ "types": ["userdata"],
14
+ "is_optional": "False"
15
+ }
16
+ ],
17
+ "examples": "",
18
+ "replaces": "",
19
+ "error": "",
20
+ "tparams": [],
21
+ "members": [],
22
+ "notes": [],
23
+ "language": ""
24
+ },
25
+ {
26
+ "type": "TYPEDEF",
27
+ "name": "render_target",
28
+ "brief": "Render target",
29
+ "description": "Render target",
30
+ "returnvalues": [],
31
+ "parameters": [
32
+ {
33
+ "name": "value",
34
+ "doc": "",
35
+ "types": ["number"],
36
+ "is_optional": "False"
37
+ }
38
+ ],
39
+ "examples": "",
40
+ "replaces": "",
41
+ "error": "",
42
+ "tparams": [],
43
+ "members": [],
44
+ "notes": [],
45
+ "language": ""
46
+ },
47
+ {
48
+ "type": "TYPEDEF",
49
+ "name": "texture",
50
+ "brief": "Texture handle",
51
+ "description": "Texture handle",
52
+ "returnvalues": [],
53
+ "parameters": [
54
+ {
55
+ "name": "value",
56
+ "doc": "",
57
+ "types": ["number"],
58
+ "is_optional": "False"
59
+ }
60
+ ],
61
+ "examples": "",
62
+ "replaces": "",
63
+ "error": "",
64
+ "tparams": [],
65
+ "members": [],
66
+ "notes": [],
67
+ "language": ""
68
+ },
69
+ {
70
+ "type": "FUNCTION",
71
+ "name": "render.constant_buffer",
72
+ "brief": "create a new constant buffer.",
73
+ "description": "Constant buffers are used to set shader program variables and are optionally passed to the <code>render.draw()</code> function.\nThe buffer's constant elements can be indexed like an ordinary Lua table, but you can't iterate over them with pairs() or ipairs().",
74
+ "returnvalues": [
75
+ {
76
+ "name": "buffer",
77
+ "doc": "new constant buffer",
78
+ "types": ["constant_buffer"]
79
+ }
80
+ ],
81
+ "parameters": [],
82
+ "examples": "Set a \"tint\" constant in a constant buffer in the render script:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">constant_buffer</span><span class=\"p\">()</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">tint</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n</code></pre></div>\n\nThen use the constant buffer when drawing a predicate:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">constants</span><span class=\"p\">})</span>\n</code></pre></div>\n\nThe constant buffer also supports array values by specifying constants in a table:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">constant_buffer</span><span class=\"p\">()</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">light_colors</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">light_colors</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">light_colors</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">light_colors</span><span class=\"p\">[</span><span class=\"mi\">3</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n</code></pre></div>\n\nYou can also create the table by passing the vectors directly when creating the table:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">constant_buffer</span><span class=\"p\">()</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">light_colors</span> <span class=\"o\">=</span> <span class=\"p\">{</span>\n <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n\n<span class=\"c1\">-- Add more constant to the array</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">light_colors</span><span class=\"p\">[</span><span class=\"mi\">4</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n</code></pre></div>",
83
+ "replaces": "",
84
+ "error": "",
85
+ "tparams": [],
86
+ "members": [],
87
+ "notes": [],
88
+ "language": ""
89
+ },
90
+ {
91
+ "type": "FUNCTION",
92
+ "name": "render.enable_state",
93
+ "brief": "enables a render state",
94
+ "description": "Enables a particular render state. The state will be enabled until disabled.",
95
+ "returnvalues": [],
96
+ "parameters": [
97
+ {
98
+ "name": "state",
99
+ "doc": "state to enable\n<ul>\n<li><code>graphics.STATE_DEPTH_TEST</code></li>\n<li><code>graphics.STATE_STENCIL_TEST</code></li>\n<li><code>graphics.STATE_BLEND</code></li>\n<li><code>graphics.STATE_ALPHA_TEST</code> (<span class=\"icon-ios\"></span><span class=\"icon-android\"></span> not available on iOS and Android)</li>\n<li><code>graphics.STATE_CULL_FACE</code></li>\n<li><code>graphics.STATE_POLYGON_OFFSET_FILL</code></li>\n</ul>",
100
+ "types": ["constant"],
101
+ "is_optional": "False"
102
+ }
103
+ ],
104
+ "examples": "Enable stencil test when drawing the gui predicate, then disable it:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_state</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STATE_STENCIL_TEST</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">gui_pred</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">disable_state</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STATE_STENCIL_TEST</span><span class=\"p\">)</span>\n</code></pre></div>",
105
+ "replaces": "",
106
+ "error": "",
107
+ "tparams": [],
108
+ "members": [],
109
+ "notes": [],
110
+ "language": ""
111
+ },
112
+ {
113
+ "type": "FUNCTION",
114
+ "name": "render.disable_state",
115
+ "brief": "disables a render state",
116
+ "description": "Disables a render state.",
117
+ "returnvalues": [],
118
+ "parameters": [
119
+ {
120
+ "name": "state",
121
+ "doc": "state to disable\n<ul>\n<li><code>graphics.STATE_DEPTH_TEST</code></li>\n<li><code>graphics.STATE_STENCIL_TEST</code></li>\n<li><code>graphics.STATE_BLEND</code></li>\n<li><code>graphics.STATE_ALPHA_TEST</code> (<span class=\"icon-ios\"></span><span class=\"icon-android\"></span> not available on iOS and Android)</li>\n<li><code>graphics.STATE_CULL_FACE</code></li>\n<li><code>graphics.STATE_POLYGON_OFFSET_FILL</code></li>\n</ul>",
122
+ "types": ["constant"],
123
+ "is_optional": "False"
124
+ }
125
+ ],
126
+ "examples": "Disable face culling when drawing the tile predicate:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">disable_state</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STATE_CULL_FACE</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">tile_pred</span><span class=\"p\">)</span>\n</code></pre></div>",
127
+ "replaces": "",
128
+ "error": "",
129
+ "tparams": [],
130
+ "members": [],
131
+ "notes": [],
132
+ "language": ""
133
+ },
134
+ {
135
+ "type": "FUNCTION",
136
+ "name": "render.set_viewport",
137
+ "brief": "sets the render viewport",
138
+ "description": "Set the render viewport to the specified rectangle.",
139
+ "returnvalues": [],
140
+ "parameters": [
141
+ {
142
+ "name": "x",
143
+ "doc": "left corner",
144
+ "types": ["number"],
145
+ "is_optional": "False"
146
+ },
147
+ {
148
+ "name": "y",
149
+ "doc": "bottom corner",
150
+ "types": ["number"],
151
+ "is_optional": "False"
152
+ },
153
+ {
154
+ "name": "width",
155
+ "doc": "viewport width",
156
+ "types": ["number"],
157
+ "is_optional": "False"
158
+ },
159
+ {
160
+ "name": "height",
161
+ "doc": "viewport height",
162
+ "types": ["number"],
163
+ "is_optional": "False"
164
+ }
165
+ ],
166
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- Set the viewport to the window dimensions.</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_viewport</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">())</span>\n</code></pre></div>",
167
+ "replaces": "",
168
+ "error": "",
169
+ "tparams": [],
170
+ "members": [],
171
+ "notes": [],
172
+ "language": ""
173
+ },
174
+ {
175
+ "type": "FUNCTION",
176
+ "name": "render.render_target",
177
+ "brief": "creates a new render target",
178
+ "description": "Creates a new render target according to the supplied\nspecification table.\nThe table should contain keys specifying which buffers should be created\nwith what parameters. Each buffer key should have a table value consisting\nof parameters. The following parameter keys are available:\n<table>\n<thead>\n<tr>\n<th>Key</th>\n<th>Values</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>format</code></td>\n<td><code>graphics.TEXTURE_FORMAT_LUMINANCE</code><br/><code>graphics.TEXTURE_FORMAT_RGB</code><br/><code>graphics.TEXTURE_FORMAT_RGBA</code><br/><code>graphics.TEXTURE_FORMAT_DEPTH</code><br/><code>graphics.TEXTURE_FORMAT_STENCIL</code><br/><code>graphics.TEXTURE_FORMAT_RGBA32F</code><br/><code>graphics.TEXTURE_FORMAT_RGBA16F</code><br/></td>\n</tr>\n<tr>\n<td><code>width</code></td>\n<td>number</td>\n</tr>\n<tr>\n<td><code>height</code></td>\n<td>number</td>\n</tr>\n<tr>\n<td><code>min_filter</code> (optional)</td>\n<td><code>graphics.TEXTURE_FILTER_LINEAR</code><br/><code>graphics.TEXTURE_FILTER_NEAREST</code></td>\n</tr>\n<tr>\n<td><code>mag_filter</code> (optional)</td>\n<td><code>graphics.TEXTURE_FILTER_LINEAR</code><br/><code>graphics.TEXTURE_FILTER_NEAREST</code></td>\n</tr>\n<tr>\n<td><code>u_wrap</code> (optional)</td>\n<td><code>graphics.TEXTURE_WRAP_CLAMP_TO_BORDER</code><br/><code>graphics.TEXTURE_WRAP_CLAMP_TO_EDGE</code><br/><code>graphics.TEXTURE_WRAP_MIRRORED_REPEAT</code><br/><code>graphics.TEXTURE_WRAP_REPEAT</code><br/></td>\n</tr>\n<tr>\n<td><code>v_wrap</code> (optional)</td>\n<td><code>graphics.TEXTURE_WRAP_CLAMP_TO_BORDER</code><br/><code>graphics.TEXTURE_WRAP_CLAMP_TO_EDGE</code><br/><code>graphics.TEXTURE_WRAP_MIRRORED_REPEAT</code><br/><code>graphics.TEXTURE_WRAP_REPEAT</code></td>\n</tr>\n<tr>\n<td><code>flags</code> (optional)</td>\n<td><code>render.TEXTURE_BIT</code> (only applicable to depth and stencil buffers)</td>\n</tr>\n</tbody>\n</table>\nThe render target can be created to support multiple color attachments. Each attachment can have different format settings and texture filters,\nbut attachments must be added in sequence, meaning you cannot create a render target at slot 0 and 3.\nInstead it has to be created with all four buffer types ranging from [0..3] (as denoted by graphics.BUFFER_TYPE_COLORX_BIT where 'X' is the attachment you want to create).\nIt is not guaranteed that the device running the script can support creating render targets with multiple color attachments. To check if the device can support multiple attachments,\nyou can check if the <code>render</code> table contains any of the <code>BUFFER_TYPE_COLOR1_BIT</code>, <code>BUFFER_TYPE_COLOR2_BIT</code> or <code>BUFFER_TYPE_COLOR3_BIT</code> constants:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR1_BIT</span> <span class=\"o\">==</span> <span class=\"kc\">nil</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- this devices does not support multiple color attachments</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
179
+ "returnvalues": [
180
+ {
181
+ "name": "render_target",
182
+ "doc": "new render target",
183
+ "types": ["render_target"]
184
+ }
185
+ ],
186
+ "parameters": [
187
+ {
188
+ "name": "name",
189
+ "doc": "render target name",
190
+ "types": ["string"],
191
+ "is_optional": "False"
192
+ },
193
+ {
194
+ "name": "parameters",
195
+ "doc": "table of buffer parameters, see the description for available keys and values",
196
+ "types": ["table"],
197
+ "is_optional": "False"
198
+ }
199
+ ],
200
+ "examples": "How to create a new render target and draw to it:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- render target buffer parameters</span>\n <span class=\"kd\">local</span> <span class=\"n\">color_params</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">format</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FORMAT_RGBA</span><span class=\"p\">,</span>\n <span class=\"n\">width</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span>\n <span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">(),</span>\n <span class=\"n\">min_filter</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FILTER_LINEAR</span><span class=\"p\">,</span>\n <span class=\"n\">mag_filter</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FILTER_LINEAR</span><span class=\"p\">,</span>\n <span class=\"n\">u_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span><span class=\"p\">,</span>\n <span class=\"n\">v_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span> <span class=\"p\">}</span>\n <span class=\"kd\">local</span> <span class=\"n\">depth_params</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">format</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FORMAT_DEPTH</span><span class=\"p\">,</span>\n <span class=\"n\">width</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span>\n <span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">(),</span>\n <span class=\"n\">u_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span><span class=\"p\">,</span>\n <span class=\"n\">v_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span> <span class=\"p\">}</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">render_target</span><span class=\"p\">({[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">color_params</span><span class=\"p\">,</span> <span class=\"p\">[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_DEPTH_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">depth_params</span> <span class=\"p\">})</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- enable target so all drawing is done to it</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- draw a predicate to the render target</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\nHow to create a render target with multiple outputs:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- render target buffer parameters</span>\n <span class=\"kd\">local</span> <span class=\"n\">color_params_rgba</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">format</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FORMAT_RGBA</span><span class=\"p\">,</span>\n <span class=\"n\">width</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span>\n <span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">(),</span>\n <span class=\"n\">min_filter</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FILTER_LINEAR</span><span class=\"p\">,</span>\n <span class=\"n\">mag_filter</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FILTER_LINEAR</span><span class=\"p\">,</span>\n <span class=\"n\">u_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span><span class=\"p\">,</span>\n <span class=\"n\">v_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span> <span class=\"p\">}</span>\n <span class=\"kd\">local</span> <span class=\"n\">color_params_float</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">format</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FORMAT_RG32F</span><span class=\"p\">,</span>\n <span class=\"n\">width</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span>\n <span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">(),</span>\n <span class=\"n\">min_filter</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FILTER_LINEAR</span><span class=\"p\">,</span>\n <span class=\"n\">mag_filter</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FILTER_LINEAR</span><span class=\"p\">,</span>\n <span class=\"n\">u_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span><span class=\"p\">,</span>\n <span class=\"n\">v_wrap</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_WRAP_CLAMP_TO_EDGE</span> <span class=\"p\">}</span>\n\n\n <span class=\"c1\">-- Create a render target with three color attachments</span>\n <span class=\"c1\">-- Note: No depth buffer is attached here</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">render_target</span><span class=\"p\">({</span>\n <span class=\"p\">[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">color_params_rgba</span><span class=\"p\">,</span>\n <span class=\"p\">[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR1_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">color_params_rgba</span><span class=\"p\">,</span>\n <span class=\"p\">[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR2_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">color_params_float</span><span class=\"p\">,</span> <span class=\"p\">})</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- enable target so all drawing is done to it</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_render_target</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- draw a predicate to the render target</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
201
+ "replaces": "",
202
+ "error": "",
203
+ "tparams": [],
204
+ "members": [],
205
+ "notes": [],
206
+ "language": ""
207
+ },
208
+ {
209
+ "type": "FUNCTION",
210
+ "name": "render.delete_render_target",
211
+ "brief": "deletes a render target",
212
+ "description": "Deletes a render target created by a render script.\nYou cannot delete a render target resource.",
213
+ "returnvalues": [],
214
+ "parameters": [
215
+ {
216
+ "name": "render_target",
217
+ "doc": "render target to delete",
218
+ "types": ["render_target"],
219
+ "is_optional": "False"
220
+ }
221
+ ],
222
+ "examples": "How to delete a render target:\n<div class=\"codehilite\"><pre><span></span><code> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">delete_render_target</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">)</span>\n</code></pre></div>",
223
+ "replaces": "",
224
+ "error": "",
225
+ "tparams": [],
226
+ "members": [],
227
+ "notes": [],
228
+ "language": ""
229
+ },
230
+ {
231
+ "type": "CONSTANT",
232
+ "name": "render.RENDER_TARGET_DEFAULT",
233
+ "brief": "",
234
+ "description": "",
235
+ "returnvalues": [],
236
+ "parameters": [],
237
+ "examples": "",
238
+ "replaces": "",
239
+ "error": "",
240
+ "tparams": [],
241
+ "members": [],
242
+ "notes": [],
243
+ "language": ""
244
+ },
245
+ {
246
+ "type": "FUNCTION",
247
+ "name": "render.set_render_target",
248
+ "brief": "sets a render target",
249
+ "description": "Sets a render target. Subsequent draw operations will be to the\nrender target until it is replaced by a subsequent call to set_render_target.\nThis function supports render targets created by a render script, or a render target resource.",
250
+ "returnvalues": [],
251
+ "parameters": [
252
+ {
253
+ "name": "render_target",
254
+ "doc": "render target to set. render.RENDER_TARGET_DEFAULT to set the default render target",
255
+ "types": ["render_target"],
256
+ "is_optional": "False"
257
+ },
258
+ {
259
+ "name": "options",
260
+ "doc": "optional table with behaviour parameters\n<dl>\n<dt><code>transient</code></dt>\n<dd><span class=\"type\">table</span> Transient frame buffer types are only valid while the render target is active, i.e becomes undefined when a new target is set by a subsequent call to set_render_target.\n Default is all non-transient. Be aware that some hardware uses a combined depth stencil buffer and when this is the case both are considered non-transient if exclusively selected!\n A buffer type defined that doesn't exist in the render target is silently ignored.</dd>\n</dl>\n<ul>\n<li><code>graphics.BUFFER_TYPE_COLOR0_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_DEPTH_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_STENCIL_BIT</code></li>\n</ul>",
261
+ "types": ["table"],
262
+ "is_optional": "True"
263
+ }
264
+ ],
265
+ "examples": "How to set a render target and draw to it and then switch back to the default render target\nThe render target defines the depth/stencil buffers as transient, when set_render_target is called the next time the buffers may be invalidated and allow for optimisations depending on driver support\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- set render target so all drawing is done to it</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">transient</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_DEPTH_BIT</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_STENCIL_BIT</span> <span class=\"p\">}</span> <span class=\"p\">}</span> <span class=\"p\">)</span>\n\n <span class=\"c1\">-- draw a predicate to the render target</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- set default render target. This also invalidates the depth and stencil buffers of the current target (self.my_render_target)</span>\n <span class=\"c1\">-- which can be an optimisation on some hardware</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">RENDER_TARGET_DEFAULT</span><span class=\"p\">)</span>\n\n<span class=\"kr\">end</span>\n</code></pre></div>\n\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- set render target by a render target resource identifier</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"s1\">&#39;my_rt_resource&#39;</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- draw a predicate to the render target</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- reset the render target to the default backbuffer</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">RENDER_TARGET_DEFAULT</span><span class=\"p\">)</span>\n\n<span class=\"kr\">end</span>\n</code></pre></div>",
266
+ "replaces": "",
267
+ "error": "",
268
+ "tparams": [],
269
+ "members": [],
270
+ "notes": [],
271
+ "language": ""
272
+ },
273
+ {
274
+ "type": "FUNCTION",
275
+ "name": "render.set_render_target_size",
276
+ "brief": "sets the render target size",
277
+ "description": "Sets the render target size for a render target created from\neither a render script, or from a render target resource.",
278
+ "returnvalues": [],
279
+ "parameters": [
280
+ {
281
+ "name": "render_target",
282
+ "doc": "render target to set size for",
283
+ "types": ["render_target"],
284
+ "is_optional": "False"
285
+ },
286
+ {
287
+ "name": "width",
288
+ "doc": "new render target width",
289
+ "types": ["number"],
290
+ "is_optional": "False"
291
+ },
292
+ {
293
+ "name": "height",
294
+ "doc": "new render target height",
295
+ "types": ["number"],
296
+ "is_optional": "False"
297
+ }
298
+ ],
299
+ "examples": "Resize render targets to the current window size:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target_size</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">,</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">())</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target_size</span><span class=\"p\">(</span><span class=\"s1\">&#39;my_rt_resource&#39;</span><span class=\"p\">,</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">())</span>\n</code></pre></div>",
300
+ "replaces": "",
301
+ "error": "",
302
+ "tparams": [],
303
+ "members": [],
304
+ "notes": [],
305
+ "language": ""
306
+ },
307
+ {
308
+ "type": "FUNCTION",
309
+ "name": "render.enable_texture",
310
+ "brief": "sets a texture to the render state",
311
+ "description": "Sets the specified texture handle for a render target attachment or a regular texture\nthat should be used for rendering. The texture can be bound to either a texture unit\nor to a sampler name by a hash or a string.\nA texture can be bound to multiple units and sampler names at the same time,\nthe actual binding will be applied to the shaders when a shader program is bound.\nWhen mixing binding using both units and sampler names, you might end up in situations\nwhere two different textures will be applied to the same bind location in the shader.\nIn this case, the texture set to the named sampler will take precedence over the unit.\nNote that you can bind multiple sampler names to the same texture, in case you want to reuse\nthe same texture for differnt use-cases. It is however recommended that you use the same name\neverywhere for the textures that should be shared across different materials.",
312
+ "returnvalues": [],
313
+ "parameters": [
314
+ {
315
+ "name": "binding",
316
+ "doc": "texture binding, either by texture unit, string or hash for the sampler name that the texture should be bound to",
317
+ "types": ["number", "string", "hash"],
318
+ "is_optional": "False"
319
+ },
320
+ {
321
+ "name": "handle_or_name",
322
+ "doc": "render target or texture handle that should be bound, or a named resource in the \"Render Resource\" table in the currently assigned .render file",
323
+ "types": ["texture", "string", "hash"],
324
+ "is_optional": "False"
325
+ },
326
+ {
327
+ "name": "buffer_type",
328
+ "doc": "optional buffer type from which to enable the texture. Note that this argument only applies to render targets. Defaults to <code>graphics.BUFFER_TYPE_COLOR0_BIT</code>. These values are supported:\n<ul>\n<li><code>graphics.BUFFER_TYPE_COLOR0_BIT</code></li>\n</ul>\nIf The render target has been created as depth and/or stencil textures, these buffer types can be used:\n<ul>\n<li><code>graphics.BUFFER_TYPE_DEPTH_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_STENCIL_BIT</code></li>\n</ul>\nIf the render target has been created with multiple color attachments, these buffer types can be used\nto enable those textures as well. Currently 4 color attachments are supported:\n<ul>\n<li><code>graphics.BUFFER_TYPE_COLOR0_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_COLOR1_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_COLOR2_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_COLOR3_BIT</code></li>\n</ul>",
329
+ "types": [
330
+ "graphics.BUFFER_TYPE_COLOR0_BIT",
331
+ "graphics.BUFFER_TYPE_COLOR1_BIT",
332
+ "graphics.BUFFER_TYPE_COLOR2_BIT",
333
+ "graphics.BUFFER_TYPE_COLOR3_BIT",
334
+ "graphics.BUFFER_TYPE_DEPTH_BIT",
335
+ "graphics.BUFFER_TYPE_STENCIL_BIT"
336
+ ],
337
+ "is_optional": "True"
338
+ }
339
+ ],
340
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- enable target so all drawing is done to it</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- draw a predicate to the render target</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- disable target</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">RENDER_TARGET_DEFAULT</span><span class=\"p\">)</span>\n\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n <span class=\"c1\">-- draw a predicate with the render target available as texture 0 in the predicate</span>\n <span class=\"c1\">-- material shader.</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- enable render target by resource id</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"s1\">&#39;my_rt_resource&#39;</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_render_target</span><span class=\"p\">(</span><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">RENDER_TARGET_DEFAULT</span><span class=\"p\">)</span>\n\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"s1\">&#39;my_rt_resource&#39;</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n <span class=\"c1\">-- draw a predicate with the render target available as texture 0 in the predicate</span>\n <span class=\"c1\">-- material shader.</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- bind a texture to the texture unit 0</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_texture_handle</span><span class=\"p\">)</span>\n <span class=\"c1\">-- bind the same texture to a named sampler</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_texture_sampler&quot;</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_texture_handle</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
341
+ "replaces": "",
342
+ "error": "",
343
+ "tparams": [],
344
+ "members": [],
345
+ "notes": [],
346
+ "language": ""
347
+ },
348
+ {
349
+ "type": "FUNCTION",
350
+ "name": "render.disable_texture",
351
+ "brief": "disables a texture on the render state",
352
+ "description": "Disables a texture that has previourly been enabled.",
353
+ "returnvalues": [],
354
+ "parameters": [
355
+ {
356
+ "name": "binding",
357
+ "doc": "texture binding, either by texture unit, string or hash that should be disabled",
358
+ "types": ["texture", "string", "hash"],
359
+ "is_optional": "False"
360
+ }
361
+ ],
362
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_render_target</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n <span class=\"c1\">-- draw a predicate with the render target available as texture 0 in the predicate</span>\n <span class=\"c1\">-- material shader.</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n <span class=\"c1\">-- done, disable the texture</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">disable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
363
+ "replaces": "",
364
+ "error": "",
365
+ "tparams": [],
366
+ "members": [],
367
+ "notes": [],
368
+ "language": ""
369
+ },
370
+ {
371
+ "type": "FUNCTION",
372
+ "name": "render.get_render_target_width",
373
+ "brief": "retrieve the buffer width from a render target",
374
+ "description": "Returns the specified buffer width from a render target.",
375
+ "returnvalues": [
376
+ {
377
+ "name": "width",
378
+ "doc": "the width of the render target buffer texture",
379
+ "types": ["number"]
380
+ }
381
+ ],
382
+ "parameters": [
383
+ {
384
+ "name": "render_target",
385
+ "doc": "render target from which to retrieve the buffer width",
386
+ "types": ["render_target"],
387
+ "is_optional": "False"
388
+ },
389
+ {
390
+ "name": "buffer_type",
391
+ "doc": "which type of buffer to retrieve the width from\n<ul>\n<li><code>graphics.BUFFER_TYPE_COLOR0_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_COLOR[x]_BIT</code> (x: [0..3], if supported!)</li>\n<li><code>graphics.BUFFER_TYPE_DEPTH_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_STENCIL_BIT</code></li>\n</ul>",
392
+ "types": [
393
+ "graphics.BUFFER_TYPE_COLOR0_BIT",
394
+ "graphics.BUFFER_TYPE_COLOR1_BIT",
395
+ "graphics.BUFFER_TYPE_COLOR2_BIT",
396
+ "graphics.BUFFER_TYPE_COLOR3_BIT",
397
+ "graphics.BUFFER_TYPE_DEPTH_BIT",
398
+ "graphics.BUFFER_TYPE_STENCIL_BIT"
399
+ ],
400
+ "is_optional": "False"
401
+ }
402
+ ],
403
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- get the width of the render target color buffer</span>\n<span class=\"kd\">local</span> <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_render_target_width</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">target_right</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n<span class=\"c1\">-- get the width of a render target resource</span>\n<span class=\"kd\">local</span> <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_render_target_width</span><span class=\"p\">(</span><span class=\"s1\">&#39;my_rt_resource&#39;</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n</code></pre></div>",
404
+ "replaces": "",
405
+ "error": "",
406
+ "tparams": [],
407
+ "members": [],
408
+ "notes": [],
409
+ "language": ""
410
+ },
411
+ {
412
+ "type": "FUNCTION",
413
+ "name": "render.get_render_target_height",
414
+ "brief": "retrieve a buffer height from a render target",
415
+ "description": "Returns the specified buffer height from a render target.",
416
+ "returnvalues": [
417
+ {
418
+ "name": "height",
419
+ "doc": "the height of the render target buffer texture",
420
+ "types": ["number"]
421
+ }
422
+ ],
423
+ "parameters": [
424
+ {
425
+ "name": "render_target",
426
+ "doc": "render target from which to retrieve the buffer height",
427
+ "types": ["render_target"],
428
+ "is_optional": "False"
429
+ },
430
+ {
431
+ "name": "buffer_type",
432
+ "doc": "which type of buffer to retrieve the height from\n<ul>\n<li><code>graphics.BUFFER_TYPE_COLOR0_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_DEPTH_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_STENCIL_BIT</code></li>\n</ul>",
433
+ "types": [
434
+ "graphics.BUFFER_TYPE_COLOR0_BIT",
435
+ "graphics.BUFFER_TYPE_COLOR1_BIT",
436
+ "graphics.BUFFER_TYPE_COLOR2_BIT",
437
+ "graphics.BUFFER_TYPE_COLOR3_BIT",
438
+ "graphics.BUFFER_TYPE_DEPTH_BIT",
439
+ "graphics.BUFFER_TYPE_STENCIL_BIT"
440
+ ],
441
+ "is_optional": "False"
442
+ }
443
+ ],
444
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- get the height of the render target color buffer</span>\n<span class=\"kd\">local</span> <span class=\"n\">h</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_render_target_height</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">target_right</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n<span class=\"c1\">-- get the height of a render target resource</span>\n<span class=\"kd\">local</span> <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_render_target_height</span><span class=\"p\">(</span><span class=\"s1\">&#39;my_rt_resource&#39;</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">)</span>\n</code></pre></div>",
445
+ "replaces": "",
446
+ "error": "",
447
+ "tparams": [],
448
+ "members": [],
449
+ "notes": [],
450
+ "language": ""
451
+ },
452
+ {
453
+ "type": "FUNCTION",
454
+ "name": "render.clear",
455
+ "brief": "clears the active render target",
456
+ "description": "Clear buffers in the currently enabled render target with specified value. If the render target has been created with multiple\ncolor attachments, all buffers will be cleared with the same value.",
457
+ "returnvalues": [],
458
+ "parameters": [
459
+ {
460
+ "name": "buffers",
461
+ "doc": "table with keys specifying which buffers to clear and values set to clear values. Available keys are:\n<ul>\n<li><code>graphics.BUFFER_TYPE_COLOR0_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_DEPTH_BIT</code></li>\n<li><code>graphics.BUFFER_TYPE_STENCIL_BIT</code></li>\n</ul>",
462
+ "types": ["table"],
463
+ "is_optional": "False"
464
+ }
465
+ ],
466
+ "examples": "Clear the color buffer and the depth buffer.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">clear</span><span class=\"p\">({[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">),</span> <span class=\"p\">[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_DEPTH_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"mi\">1</span><span class=\"p\">})</span>\n</code></pre></div>",
467
+ "replaces": "",
468
+ "error": "",
469
+ "tparams": [],
470
+ "members": [],
471
+ "notes": [],
472
+ "language": ""
473
+ },
474
+ {
475
+ "type": "FUNCTION",
476
+ "name": "render.draw",
477
+ "brief": "draws all objects matching a predicate",
478
+ "description": "Draws all objects that match a specified predicate. An optional constant buffer can be\nprovided to override the default constants. If no constants buffer is provided, a default\nsystem constants buffer is used containing constants as defined in materials and set through\n<a href=\"/ref/go#go.set\">go.set</a> (or <a href=\"/ref/particlefx#particlefx.set_constant\">particlefx.set_constant</a>) on visual components.",
479
+ "returnvalues": [],
480
+ "parameters": [
481
+ {
482
+ "name": "predicate",
483
+ "doc": "predicate to draw for",
484
+ "types": ["number"],
485
+ "is_optional": "False"
486
+ },
487
+ {
488
+ "name": "options",
489
+ "doc": "optional table with properties:\n<dl>\n<dt><code>frustum</code></dt>\n<dd><span class=\"type\">matrix4</span> A frustum matrix used to cull renderable items. (E.g. <code>local frustum = proj * view</code>). default=nil</dd>\n<dt><code>frustum_planes</code></dt>\n<dd><span class=\"type\">int</span> Determines which sides of the frustum will be used. Default is render.FRUSTUM_PLANES_SIDES.</dd>\n</dl>\n<ul>\n<li>render.FRUSTUM_PLANES_SIDES : The left, right, top and bottom sides of the frustum.</li>\n<li>render.FRUSTUM_PLANES_ALL : All 6 sides of the frustum.</li>\n</ul>\n<dl>\n<dt><code>constants</code></dt>\n<dd><span class=\"type\">constant_buffer</span> optional constants to use while rendering</dd>\n<dt><code>sort_order</code></dt>\n<dd><span class=\"type\">int</span> How to sort draw order for world-ordered entries. Default uses the renderer's preferred world sorting (back-to-front).</dd>\n</dl>",
490
+ "types": ["table"],
491
+ "is_optional": "True"
492
+ }
493
+ ],
494
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- define a predicate matching anything with material tag &quot;my_tag&quot;</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">predicate</span><span class=\"p\">({</span><span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_tag&quot;</span><span class=\"p\">)})</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- draw everything in the my_pred predicate</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\nDraw predicate with constants:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">constant_buffer</span><span class=\"p\">()</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">tint</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">constants</span><span class=\"p\">})</span>\n</code></pre></div>\n\nDraw with predicate and frustum culling (without near+far planes):\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">frustum</span> <span class=\"o\">=</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">proj</span> <span class=\"o\">*</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">view</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">frustum</span> <span class=\"o\">=</span> <span class=\"n\">frustum</span><span class=\"p\">})</span>\n</code></pre></div>\n\nDraw with predicate and frustum culling (with near+far planes):\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">frustum</span> <span class=\"o\">=</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">proj</span> <span class=\"o\">*</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">view</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">frustum</span> <span class=\"o\">=</span> <span class=\"n\">frustum</span><span class=\"p\">,</span> <span class=\"n\">frustum_planes</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">FRUSTUM_PLANES_ALL</span><span class=\"p\">})</span>\n</code></pre></div>",
495
+ "replaces": "",
496
+ "error": "",
497
+ "tparams": [],
498
+ "members": [],
499
+ "notes": [],
500
+ "language": ""
501
+ },
502
+ {
503
+ "type": "FUNCTION",
504
+ "name": "render.draw_debug3d",
505
+ "brief": "draws all 3d debug graphics",
506
+ "description": "Draws all 3d debug graphics such as lines drawn with \"draw_line\" messages and physics visualization.",
507
+ "returnvalues": [],
508
+ "parameters": [
509
+ {
510
+ "name": "options",
511
+ "doc": "optional table with properties:\n<dl>\n<dt><code>frustum</code></dt>\n<dd><span class=\"type\">matrix4</span> A frustum matrix used to cull renderable items. (E.g. <code>local frustum = proj * view</code>). May be nil.</dd>\n<dt><code>frustum_planes</code></dt>\n<dd><span class=\"type\">int</span> Determines which sides of the frustum will be used. Default is render.FRUSTUM_PLANES_SIDES.</dd>\n</dl>\n<ul>\n<li>render.FRUSTUM_PLANES_SIDES : The left, right, top and bottom sides of the frustum.</li>\n<li>render.FRUSTUM_PLANES_ALL : All sides of the frustum.</li>\n</ul>",
512
+ "types": ["table"],
513
+ "is_optional": "True"
514
+ }
515
+ ],
516
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- draw debug visualization</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw_debug3d</span><span class=\"p\">()</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
517
+ "replaces": "render.draw_debug2d",
518
+ "error": "",
519
+ "tparams": [],
520
+ "members": [],
521
+ "notes": [],
522
+ "language": ""
523
+ },
524
+ {
525
+ "type": "FUNCTION",
526
+ "name": "render.set_view",
527
+ "brief": "sets the view matrix",
528
+ "description": "Sets the view matrix to use when rendering.",
529
+ "returnvalues": [],
530
+ "parameters": [
531
+ {
532
+ "name": "matrix",
533
+ "doc": "view matrix to set",
534
+ "types": ["matrix4"],
535
+ "is_optional": "False"
536
+ }
537
+ ],
538
+ "examples": "How to set the view and projection matrices according to\nthe values supplied by a camera.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">view</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">matrix4</span><span class=\"p\">()</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">projection</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">matrix4</span><span class=\"p\">()</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- set the view to the stored view value</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_view</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">view</span><span class=\"p\">)</span>\n <span class=\"c1\">-- now we can draw with this view</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">on_message</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">message_id</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">message_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;set_view_projection&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- camera view and projection arrives here.</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">view</span> <span class=\"o\">=</span> <span class=\"n\">message</span><span class=\"p\">.</span><span class=\"n\">view</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">projection</span> <span class=\"o\">=</span> <span class=\"n\">message</span><span class=\"p\">.</span><span class=\"n\">projection</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
539
+ "replaces": "",
540
+ "error": "",
541
+ "tparams": [],
542
+ "members": [],
543
+ "notes": [],
544
+ "language": ""
545
+ },
546
+ {
547
+ "type": "FUNCTION",
548
+ "name": "render.set_projection",
549
+ "brief": "sets the projection matrix",
550
+ "description": "Sets the projection matrix to use when rendering.",
551
+ "returnvalues": [],
552
+ "parameters": [
553
+ {
554
+ "name": "matrix",
555
+ "doc": "projection matrix",
556
+ "types": ["matrix4"],
557
+ "is_optional": "False"
558
+ }
559
+ ],
560
+ "examples": "How to set the projection to orthographic with world origo at lower left,\nwidth and height as set in project settings and depth (z) between -1 and 1:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_projection</span><span class=\"p\">(</span><span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">matrix4_orthographic</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_width</span><span class=\"p\">(),</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_height</span><span class=\"p\">(),</span> <span class=\"o\">-</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">))</span>\n</code></pre></div>",
561
+ "replaces": "",
562
+ "error": "",
563
+ "tparams": [],
564
+ "members": [],
565
+ "notes": [],
566
+ "language": ""
567
+ },
568
+ {
569
+ "type": "CONSTANT",
570
+ "name": "render.FRUSTUM_PLANES_SIDES",
571
+ "brief": "",
572
+ "description": "",
573
+ "returnvalues": [],
574
+ "parameters": [],
575
+ "examples": "",
576
+ "replaces": "",
577
+ "error": "",
578
+ "tparams": [],
579
+ "members": [],
580
+ "notes": [],
581
+ "language": ""
582
+ },
583
+ {
584
+ "type": "CONSTANT",
585
+ "name": "render.FRUSTUM_PLANES_ALL",
586
+ "brief": "",
587
+ "description": "",
588
+ "returnvalues": [],
589
+ "parameters": [],
590
+ "examples": "",
591
+ "replaces": "",
592
+ "error": "",
593
+ "tparams": [],
594
+ "members": [],
595
+ "notes": [],
596
+ "language": ""
597
+ },
598
+ {
599
+ "type": "CONSTANT",
600
+ "name": "render.SORT_BACK_TO_FRONT",
601
+ "brief": "Depth sort far-to-near (default; good for transpar...",
602
+ "description": "Depth sort far-to-near (default; good for transparent passes).",
603
+ "returnvalues": [],
604
+ "parameters": [],
605
+ "examples": "",
606
+ "replaces": "",
607
+ "error": "",
608
+ "tparams": [],
609
+ "members": [],
610
+ "notes": [],
611
+ "language": ""
612
+ },
613
+ {
614
+ "type": "CONSTANT",
615
+ "name": "render.SORT_FRONT_TO_BACK",
616
+ "brief": "Depth sort near-to-far (good for opaque passes to ...",
617
+ "description": "Depth sort near-to-far (good for opaque passes to reduce overdraw).",
618
+ "returnvalues": [],
619
+ "parameters": [],
620
+ "examples": "",
621
+ "replaces": "",
622
+ "error": "",
623
+ "tparams": [],
624
+ "members": [],
625
+ "notes": [],
626
+ "language": ""
627
+ },
628
+ {
629
+ "type": "CONSTANT",
630
+ "name": "render.SORT_NONE",
631
+ "brief": "No per-call sorting; draw entries in insertion ord...",
632
+ "description": "No per-call sorting; draw entries in insertion order.",
633
+ "returnvalues": [],
634
+ "parameters": [],
635
+ "examples": "",
636
+ "replaces": "",
637
+ "error": "",
638
+ "tparams": [],
639
+ "members": [],
640
+ "notes": [],
641
+ "language": ""
642
+ },
643
+ {
644
+ "type": "FUNCTION",
645
+ "name": "render.set_blend_func",
646
+ "brief": "sets the blending function",
647
+ "description": "Specifies the arithmetic used when computing pixel values that are written to the frame\nbuffer. In RGBA mode, pixels can be drawn using a function that blends the source RGBA\npixel values with the destination pixel values already in the frame buffer.\nBlending is initially disabled.\n<code>source_factor</code> specifies which method is used to scale the source color components.\n<code>destination_factor</code> specifies which method is used to scale the destination color\ncomponents.\nSource color components are referred to as (R<sub>s</sub>,G<sub>s</sub>,B<sub>s</sub>,A<sub>s</sub>).\nDestination color components are referred to as (R<sub>d</sub>,G<sub>d</sub>,B<sub>d</sub>,A<sub>d</sub>).\nThe color specified by setting the blendcolor is referred to as (R<sub>c</sub>,G<sub>c</sub>,B<sub>c</sub>,A<sub>c</sub>).\nThe source scale factor is referred to as (s<sub>R</sub>,s<sub>G</sub>,s<sub>B</sub>,s<sub>A</sub>).\nThe destination scale factor is referred to as (d<sub>R</sub>,d<sub>G</sub>,d<sub>B</sub>,d<sub>A</sub>).\nThe color values have integer values between 0 and (k<sub>R</sub>,k<sub>G</sub>,k<sub>B</sub>,k<sub>A</sub>), where k<sub>c</sub> = 2<sup>m<sub>c</sub></sup> - 1 and m<sub>c</sub> is the number of bitplanes for that color. I.e for 8 bit color depth, color values are between <code>0</code> and <code>255</code>.\nAvailable factor constants and corresponding scale factors:\n<table>\n<thead>\n<tr>\n<th>Factor constant</th>\n<th>Scale factor (f<sub>R</sub>,f<sub>G</sub>,f<sub>B</sub>,f<sub>A</sub>)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>graphics.BLEND_FACTOR_ZERO</code></td>\n<td>(0,0,0,0)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_ONE</code></td>\n<td>(1,1,1,1)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_SRC_COLOR</code></td>\n<td>(R<sub>s</sub>/k<sub>R</sub>,G<sub>s</sub>/k<sub>G</sub>,B<sub>s</sub>/k<sub>B</sub>,A<sub>s</sub>/k<sub>A</sub>)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_ONE_MINUS_SRC_COLOR</code></td>\n<td>(1,1,1,1) - (R<sub>s</sub>/k<sub>R</sub>,G<sub>s</sub>/k<sub>G</sub>,B<sub>s</sub>/k<sub>B</sub>,A<sub>s</sub>/k<sub>A</sub>)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_DST_COLOR</code></td>\n<td>(R<sub>d</sub>/k<sub>R</sub>,G<sub>d</sub>/k<sub>G</sub>,B<sub>d</sub>/k<sub>B</sub>,A<sub>d</sub>/k<sub>A</sub>)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_ONE_MINUS_DST_COLOR</code></td>\n<td>(1,1,1,1) - (R<sub>d</sub>/k<sub>R</sub>,G<sub>d</sub>/k<sub>G</sub>,B<sub>d</sub>/k<sub>B</sub>,A<sub>d</sub>/k<sub>A</sub>)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_SRC_ALPHA</code></td>\n<td>(A<sub>s</sub>/k<sub>A</sub>,A<sub>s</sub>/k<sub>A</sub>,A<sub>s</sub>/k<sub>A</sub>,A<sub>s</sub>/k<sub>A</sub>)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA</code></td>\n<td>(1,1,1,1) - (A<sub>s</sub>/k<sub>A</sub>,A<sub>s</sub>/k<sub>A</sub>,A<sub>s</sub>/k<sub>A</sub>,A<sub>s</sub>/k<sub>A</sub>)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_DST_ALPHA</code></td>\n<td>(A<sub>d</sub>/k<sub>A</sub>,A<sub>d</sub>/k<sub>A</sub>,A<sub>d</sub>/k<sub>A</sub>,A<sub>d</sub>/k<sub>A</sub>)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_ONE_MINUS_DST_ALPHA</code></td>\n<td>(1,1,1,1) - (A<sub>d</sub>/k<sub>A</sub>,A<sub>d</sub>/k<sub>A</sub>,A<sub>d</sub>/k<sub>A</sub>,A<sub>d</sub>/k<sub>A</sub>)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_CONSTANT_COLOR</code></td>\n<td>(R<sub>c</sub>,G<sub>c</sub>,B<sub>c</sub>,A<sub>c</sub>)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR</code></td>\n<td>(1,1,1,1) - (R<sub>c</sub>,G<sub>c</sub>,B<sub>c</sub>,A<sub>c</sub>)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_CONSTANT_ALPHA</code></td>\n<td>(A<sub>c</sub>,A<sub>c</sub>,A<sub>c</sub>,A<sub>c</sub>)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA</code></td>\n<td>(1,1,1,1) - (A<sub>c</sub>,A<sub>c</sub>,A<sub>c</sub>,A<sub>c</sub>)</td>\n</tr>\n<tr>\n<td><code>graphics.BLEND_FACTOR_SRC_ALPHA_SATURATE</code></td>\n<td>(i,i,i,1) where i = min(A<sub>s</sub>, k<sub>A</sub> - A<sub>d</sub>) /k<sub>A</sub></td>\n</tr>\n</tbody>\n</table>\nThe blended RGBA values of a pixel comes from the following equations:\n<ul>\n<li>R<sub>d</sub> = min(k<sub>R</sub>, R<sub>s</sub> * s<sub>R</sub> + R<sub>d</sub> * d<sub>R</sub>)</li>\n<li>G<sub>d</sub> = min(k<sub>G</sub>, G<sub>s</sub> * s<sub>G</sub> + G<sub>d</sub> * d<sub>G</sub>)</li>\n<li>B<sub>d</sub> = min(k<sub>B</sub>, B<sub>s</sub> * s<sub>B</sub> + B<sub>d</sub> * d<sub>B</sub>)</li>\n<li>A<sub>d</sub> = min(k<sub>A</sub>, A<sub>s</sub> * s<sub>A</sub> + A<sub>d</sub> * d<sub>A</sub>)</li>\n</ul>\nBlend function <code>(graphics.BLEND_FACTOR_SRC_ALPHA, graphics.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA)</code> is useful for\ndrawing with transparency when the drawn objects are sorted from farthest to nearest.\nIt is also useful for drawing antialiased points and lines in arbitrary order.",
648
+ "returnvalues": [],
649
+ "parameters": [
650
+ {
651
+ "name": "source_factor",
652
+ "doc": "source factor",
653
+ "types": ["number"],
654
+ "is_optional": "False"
655
+ },
656
+ {
657
+ "name": "destination_factor",
658
+ "doc": "destination factor",
659
+ "types": ["number"],
660
+ "is_optional": "False"
661
+ }
662
+ ],
663
+ "examples": "Set the blend func to the most common one:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_blend_func</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BLEND_FACTOR_SRC_ALPHA</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BLEND_FACTOR_ONE_MINUS_SRC_ALPHA</span><span class=\"p\">)</span>\n</code></pre></div>",
664
+ "replaces": "",
665
+ "error": "",
666
+ "tparams": [],
667
+ "members": [],
668
+ "notes": [],
669
+ "language": ""
670
+ },
671
+ {
672
+ "type": "FUNCTION",
673
+ "name": "render.set_color_mask",
674
+ "brief": "sets the color mask",
675
+ "description": "Specifies whether the individual color components in the frame buffer is enabled for writing (<code>true</code>) or disabled (<code>false</code>). For example, if <code>blue</code> is <code>false</code>, nothing is written to the blue component of any pixel in any of the color buffers, regardless of the drawing operation attempted. Note that writing are either enabled or disabled for entire color components, not the individual bits of a component.\nThe component masks are all initially <code>true</code>.",
676
+ "returnvalues": [],
677
+ "parameters": [
678
+ {
679
+ "name": "red",
680
+ "doc": "red mask",
681
+ "types": ["boolean"],
682
+ "is_optional": "False"
683
+ },
684
+ {
685
+ "name": "green",
686
+ "doc": "green mask",
687
+ "types": ["boolean"],
688
+ "is_optional": "False"
689
+ },
690
+ {
691
+ "name": "blue",
692
+ "doc": "blue mask",
693
+ "types": ["boolean"],
694
+ "is_optional": "False"
695
+ },
696
+ {
697
+ "name": "alpha",
698
+ "doc": "alpha mask",
699
+ "types": ["boolean"],
700
+ "is_optional": "False"
701
+ }
702
+ ],
703
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- alpha cannot be written to frame buffer</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_color_mask</span><span class=\"p\">(</span><span class=\"kc\">true</span><span class=\"p\">,</span> <span class=\"kc\">true</span><span class=\"p\">,</span> <span class=\"kc\">true</span><span class=\"p\">,</span> <span class=\"kc\">false</span><span class=\"p\">)</span>\n</code></pre></div>",
704
+ "replaces": "",
705
+ "error": "",
706
+ "tparams": [],
707
+ "members": [],
708
+ "notes": [],
709
+ "language": ""
710
+ },
711
+ {
712
+ "type": "FUNCTION",
713
+ "name": "render.set_depth_mask",
714
+ "brief": "sets the depth mask",
715
+ "description": "Specifies whether the depth buffer is enabled for writing. The supplied mask governs\nif depth buffer writing is enabled (<code>true</code>) or disabled (<code>false</code>).\nThe mask is initially <code>true</code>.",
716
+ "returnvalues": [],
717
+ "parameters": [
718
+ {
719
+ "name": "depth",
720
+ "doc": "depth mask",
721
+ "types": ["boolean"],
722
+ "is_optional": "False"
723
+ }
724
+ ],
725
+ "examples": "How to turn off writing to the depth buffer:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_depth_mask</span><span class=\"p\">(</span><span class=\"kc\">false</span><span class=\"p\">)</span>\n</code></pre></div>",
726
+ "replaces": "",
727
+ "error": "",
728
+ "tparams": [],
729
+ "members": [],
730
+ "notes": [],
731
+ "language": ""
732
+ },
733
+ {
734
+ "type": "FUNCTION",
735
+ "name": "render.set_stencil_mask",
736
+ "brief": "sets the stencil mask",
737
+ "description": "The stencil mask controls the writing of individual bits in the stencil buffer.\nThe least significant <code>n</code> bits of the parameter <code>mask</code>, where <code>n</code> is the number of\nbits in the stencil buffer, specify the mask.\nWhere a <code>1</code> bit appears in the mask, the corresponding\nbit in the stencil buffer can be written. Where a <code>0</code> bit appears in the mask,\nthe corresponding bit in the stencil buffer is never written.\nThe mask is initially all <code>1</code>'s.",
738
+ "returnvalues": [],
739
+ "parameters": [
740
+ {
741
+ "name": "mask",
742
+ "doc": "stencil mask",
743
+ "types": ["number"],
744
+ "is_optional": "False"
745
+ }
746
+ ],
747
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- set the stencil mask to all 1:s</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_stencil_mask</span><span class=\"p\">(</span><span class=\"mh\">0xff</span><span class=\"p\">)</span>\n</code></pre></div>",
748
+ "replaces": "",
749
+ "error": "",
750
+ "tparams": [],
751
+ "members": [],
752
+ "notes": [],
753
+ "language": ""
754
+ },
755
+ {
756
+ "type": "FUNCTION",
757
+ "name": "render.set_depth_func",
758
+ "brief": "sets the depth test function",
759
+ "description": "Specifies the function that should be used to compare each incoming pixel\ndepth value with the value present in the depth buffer.\nThe comparison is performed only if depth testing is enabled and specifies\nthe conditions under which a pixel will be drawn.\nFunction constants:\n<ul>\n<li><code>graphics.COMPARE_FUNC_NEVER</code> (never passes)</li>\n<li><code>graphics.COMPARE_FUNC_LESS</code> (passes if the incoming depth value is less than the stored value)</li>\n<li><code>graphics.COMPARE_FUNC_LEQUAL</code> (passes if the incoming depth value is less than or equal to the stored value)</li>\n<li><code>graphics.COMPARE_FUNC_GREATER</code> (passes if the incoming depth value is greater than the stored value)</li>\n<li><code>graphics.COMPARE_FUNC_GEQUAL</code> (passes if the incoming depth value is greater than or equal to the stored value)</li>\n<li><code>graphics.COMPARE_FUNC_EQUAL</code> (passes if the incoming depth value is equal to the stored value)</li>\n<li><code>graphics.COMPARE_FUNC_NOTEQUAL</code> (passes if the incoming depth value is not equal to the stored value)</li>\n<li><code>graphics.COMPARE_FUNC_ALWAYS</code> (always passes)</li>\n</ul>\nThe depth function is initially set to <code>graphics.COMPARE_FUNC_LESS</code>.",
760
+ "returnvalues": [],
761
+ "parameters": [
762
+ {
763
+ "name": "func",
764
+ "doc": "depth test function, see the description for available values",
765
+ "types": ["number"],
766
+ "is_optional": "False"
767
+ }
768
+ ],
769
+ "examples": "Enable depth test and set the depth test function to \"not equal\".\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_state</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STATE_DEPTH_TEST</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_depth_func</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">COMPARE_FUNC_NOTEQUAL</span><span class=\"p\">)</span>\n</code></pre></div>",
770
+ "replaces": "",
771
+ "error": "",
772
+ "tparams": [],
773
+ "members": [],
774
+ "notes": [],
775
+ "language": ""
776
+ },
777
+ {
778
+ "type": "FUNCTION",
779
+ "name": "render.set_stencil_func",
780
+ "brief": "sets the stencil test function",
781
+ "description": "Stenciling is similar to depth-buffering as it enables and disables drawing on a\nper-pixel basis. First, GL drawing primitives are drawn into the stencil planes.\nSecond, geometry and images are rendered but using the stencil planes to mask out\nwhere to draw.\nThe stencil test discards a pixel based on the outcome of a comparison between the\nreference value <code>ref</code> and the corresponding value in the stencil buffer.\n<code>func</code> specifies the comparison function. See the table below for values.\nThe initial value is <code>graphics.COMPARE_FUNC_ALWAYS</code>.\n<code>ref</code> specifies the reference value for the stencil test. The value is clamped to\nthe range [0, 2<sup>n</sup>-1], where n is the number of bitplanes in the stencil buffer.\nThe initial value is <code>0</code>.\n<code>mask</code> is ANDed with both the reference value and the stored stencil value when the test\nis done. The initial value is all <code>1</code>'s.\nFunction constant:\n<ul>\n<li><code>graphics.COMPARE_FUNC_NEVER</code> (never passes)</li>\n<li><code>graphics.COMPARE_FUNC_LESS</code> (passes if (ref &amp; mask) &lt; (stencil &amp; mask))</li>\n<li><code>graphics.COMPARE_FUNC_LEQUAL</code> (passes if (ref &amp; mask) &lt;= (stencil &amp; mask))</li>\n<li><code>graphics.COMPARE_FUNC_GREATER</code> (passes if (ref &amp; mask) &gt; (stencil &amp; mask))</li>\n<li><code>graphics.COMPARE_FUNC_GEQUAL</code> (passes if (ref &amp; mask) &gt;= (stencil &amp; mask))</li>\n<li><code>graphics.COMPARE_FUNC_EQUAL</code> (passes if (ref &amp; mask) = (stencil &amp; mask))</li>\n<li><code>graphics.COMPARE_FUNC_NOTEQUAL</code> (passes if (ref &amp; mask) != (stencil &amp; mask))</li>\n<li><code>graphics.COMPARE_FUNC_ALWAYS</code> (always passes)</li>\n</ul>",
782
+ "returnvalues": [],
783
+ "parameters": [
784
+ {
785
+ "name": "func",
786
+ "doc": "stencil test function, see the description for available values",
787
+ "types": ["number"],
788
+ "is_optional": "False"
789
+ },
790
+ {
791
+ "name": "ref",
792
+ "doc": "reference value for the stencil test",
793
+ "types": ["number"],
794
+ "is_optional": "False"
795
+ },
796
+ {
797
+ "name": "mask",
798
+ "doc": "mask that is ANDed with both the reference value and the stored stencil value when the test is done",
799
+ "types": ["number"],
800
+ "is_optional": "False"
801
+ }
802
+ ],
803
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- let only 0&#39;s pass the stencil test</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_stencil_func</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">COMPARE_FUNC_EQUAL</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n</code></pre></div>",
804
+ "replaces": "",
805
+ "error": "",
806
+ "tparams": [],
807
+ "members": [],
808
+ "notes": [],
809
+ "language": ""
810
+ },
811
+ {
812
+ "type": "FUNCTION",
813
+ "name": "render.set_stencil_op",
814
+ "brief": "sets the stencil operator",
815
+ "description": "The stencil test discards a pixel based on the outcome of a comparison between the\nreference value <code>ref</code> and the corresponding value in the stencil buffer.\nTo control the test, call <a href=\"/ref/render#render.set_stencil_func\">render.set_stencil_func</a>.\nThis function takes three arguments that control what happens to the stored stencil\nvalue while stenciling is enabled. If the stencil test fails, no change is made to the\npixel's color or depth buffers, and <code>sfail</code> specifies what happens to the stencil buffer\ncontents.\nOperator constants:\n<ul>\n<li><code>graphics.STENCIL_OP_KEEP</code> (keeps the current value)</li>\n<li><code>graphics.STENCIL_OP_ZERO</code> (sets the stencil buffer value to 0)</li>\n<li><code>graphics.STENCIL_OP_REPLACE</code> (sets the stencil buffer value to <code>ref</code>, as specified by <a href=\"/ref/render#render.set_stencil_func\">render.set_stencil_func</a>)</li>\n<li><code>graphics.STENCIL_OP_INCR</code> (increments the stencil buffer value and clamp to the maximum representable unsigned value)</li>\n<li><code>graphics.STENCIL_OP_INCR_WRAP</code> (increments the stencil buffer value and wrap to zero when incrementing the maximum representable unsigned value)</li>\n<li><code>graphics.STENCIL_OP_DECR</code> (decrements the current stencil buffer value and clamp to 0)</li>\n<li><code>graphics.STENCIL_OP_DECR_WRAP</code> (decrements the current stencil buffer value and wrap to the maximum representable unsigned value when decrementing zero)</li>\n<li><code>graphics.STENCIL_OP_INVERT</code> (bitwise inverts the current stencil buffer value)</li>\n</ul>\n<code>dppass</code> and <code>dpfail</code> specify the stencil buffer actions depending on whether subsequent\ndepth buffer tests succeed (dppass) or fail (dpfail).\nThe initial value for all operators is <code>graphics.STENCIL_OP_KEEP</code>.",
816
+ "returnvalues": [],
817
+ "parameters": [
818
+ {
819
+ "name": "sfail",
820
+ "doc": "action to take when the stencil test fails",
821
+ "types": ["number"],
822
+ "is_optional": "False"
823
+ },
824
+ {
825
+ "name": "dpfail",
826
+ "doc": "the stencil action when the stencil test passes",
827
+ "types": ["number"],
828
+ "is_optional": "False"
829
+ },
830
+ {
831
+ "name": "dppass",
832
+ "doc": "the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled",
833
+ "types": ["number"],
834
+ "is_optional": "False"
835
+ }
836
+ ],
837
+ "examples": "Set the stencil function to never pass and operator to always draw 1's\non test fail.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_stencil_func</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">COMPARE_FUNC_NEVER</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mh\">0xFF</span><span class=\"p\">)</span>\n<span class=\"c1\">-- always draw 1&#39;s on test fail</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_stencil_op</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STENCIL_OP_REPLACE</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STENCIL_OP_KEEP</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STENCIL_OP_KEEP</span><span class=\"p\">)</span>\n</code></pre></div>",
838
+ "replaces": "",
839
+ "error": "",
840
+ "tparams": [],
841
+ "members": [],
842
+ "notes": [],
843
+ "language": ""
844
+ },
845
+ {
846
+ "type": "FUNCTION",
847
+ "name": "render.set_cull_face",
848
+ "brief": "sets the cull face",
849
+ "description": "Specifies whether front- or back-facing polygons can be culled\nwhen polygon culling is enabled. Polygon culling is initially disabled.\nIf mode is <code>graphics.FACE_TYPE_FRONT_AND_BACK</code>, no polygons are drawn, but other\nprimitives such as points and lines are drawn. The initial value for\n<code>face_type</code> is <code>graphics.FACE_TYPE_BACK</code>.",
850
+ "returnvalues": [],
851
+ "parameters": [
852
+ {
853
+ "name": "face_type",
854
+ "doc": "face type\n<ul>\n<li><code>graphics.FACE_TYPE_FRONT</code></li>\n<li><code>graphics.FACE_TYPE_BACK</code></li>\n<li><code>graphics.FACE_TYPE_FRONT_AND_BACK</code></li>\n</ul>",
855
+ "types": ["number"],
856
+ "is_optional": "False"
857
+ }
858
+ ],
859
+ "examples": "How to enable polygon culling and set front face culling:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_state</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STATE_CULL_FACE</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_cull_face</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">FACE_TYPE_FRONT</span><span class=\"p\">)</span>\n</code></pre></div>",
860
+ "replaces": "",
861
+ "error": "",
862
+ "tparams": [],
863
+ "members": [],
864
+ "notes": [],
865
+ "language": ""
866
+ },
867
+ {
868
+ "type": "FUNCTION",
869
+ "name": "render.set_polygon_offset",
870
+ "brief": "sets the polygon offset",
871
+ "description": "Sets the scale and units used to calculate depth values.\nIf <code>graphics.STATE_POLYGON_OFFSET_FILL</code> is enabled, each fragment's depth value\nis offset from its interpolated value (depending on the depth value of the\nappropriate vertices). Polygon offset can be used when drawing decals, rendering\nhidden-line images etc.\n<code>factor</code> specifies a scale factor that is used to create a variable depth\noffset for each polygon. The initial value is <code>0</code>.\n<code>units</code> is multiplied by an implementation-specific value to create a\nconstant depth offset. The initial value is <code>0</code>.\nThe value of the offset is computed as <code>factor</code> &times; <code>DZ</code> + <code>r</code> &times; <code>units</code>\n<code>DZ</code> is a measurement of the depth slope of the polygon which is the change in z (depth)\nvalues divided by the change in either x or y coordinates, as you traverse a polygon.\nThe depth values are in window coordinates, clamped to the range [0, 1].\n<code>r</code> is the smallest value that is guaranteed to produce a resolvable difference.\nIt's value is an implementation-specific constant.\nThe offset is added before the depth test is performed and before the\nvalue is written into the depth buffer.",
872
+ "returnvalues": [],
873
+ "parameters": [
874
+ {
875
+ "name": "factor",
876
+ "doc": "polygon offset factor",
877
+ "types": ["number"],
878
+ "is_optional": "False"
879
+ },
880
+ {
881
+ "name": "units",
882
+ "doc": "polygon offset units",
883
+ "types": ["number"],
884
+ "is_optional": "False"
885
+ }
886
+ ],
887
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_state</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">STATE_POLYGON_OFFSET_FILL</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_polygon_offset</span><span class=\"p\">(</span><span class=\"mf\">1.0</span><span class=\"p\">,</span> <span class=\"mf\">1.0</span><span class=\"p\">)</span>\n</code></pre></div>",
888
+ "replaces": "",
889
+ "error": "",
890
+ "tparams": [],
891
+ "members": [],
892
+ "notes": [],
893
+ "language": ""
894
+ },
895
+ {
896
+ "type": "FUNCTION",
897
+ "name": "render.get_width",
898
+ "brief": "gets the window width, as specified for the project",
899
+ "description": "Returns the logical window width that is set in the \"game.project\" settings.\nNote that the actual window pixel size can change, either by device constraints\nor user input.",
900
+ "returnvalues": [
901
+ {
902
+ "name": "width",
903
+ "doc": "specified window width (number)",
904
+ "types": ["number"]
905
+ }
906
+ ],
907
+ "parameters": [],
908
+ "examples": "Get the width of the window.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_width</span><span class=\"p\">()</span>\n</code></pre></div>",
909
+ "replaces": "",
910
+ "error": "",
911
+ "tparams": [],
912
+ "members": [],
913
+ "notes": [],
914
+ "language": ""
915
+ },
916
+ {
917
+ "type": "FUNCTION",
918
+ "name": "render.get_height",
919
+ "brief": "gets the window height, as specified for the project",
920
+ "description": "Returns the logical window height that is set in the \"game.project\" settings.\nNote that the actual window pixel size can change, either by device constraints\nor user input.",
921
+ "returnvalues": [
922
+ {
923
+ "name": "height",
924
+ "doc": "specified window height",
925
+ "types": ["number"]
926
+ }
927
+ ],
928
+ "parameters": [],
929
+ "examples": "Get the height of the window\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">h</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_height</span><span class=\"p\">()</span>\n</code></pre></div>",
930
+ "replaces": "",
931
+ "error": "",
932
+ "tparams": [],
933
+ "members": [],
934
+ "notes": [],
935
+ "language": ""
936
+ },
937
+ {
938
+ "type": "FUNCTION",
939
+ "name": "render.get_window_width",
940
+ "brief": "gets the actual window width",
941
+ "description": "Returns the actual physical window width.\nNote that this value might differ from the logical width that is set in the\n\"game.project\" settings.",
942
+ "returnvalues": [
943
+ {
944
+ "name": "width",
945
+ "doc": "actual window width",
946
+ "types": ["number"]
947
+ }
948
+ ],
949
+ "parameters": [],
950
+ "examples": "Get the actual width of the window\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">()</span>\n</code></pre></div>",
951
+ "replaces": "",
952
+ "error": "",
953
+ "tparams": [],
954
+ "members": [],
955
+ "notes": [],
956
+ "language": ""
957
+ },
958
+ {
959
+ "type": "FUNCTION",
960
+ "name": "render.get_window_height",
961
+ "brief": "gets the actual window height",
962
+ "description": "Returns the actual physical window height.\nNote that this value might differ from the logical height that is set in the\n\"game.project\" settings.",
963
+ "returnvalues": [
964
+ {
965
+ "name": "height",
966
+ "doc": "actual window height",
967
+ "types": ["number"]
968
+ }
969
+ ],
970
+ "parameters": [],
971
+ "examples": "Get the actual height of the window\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">h</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">()</span>\n</code></pre></div>",
972
+ "replaces": "",
973
+ "error": "",
974
+ "tparams": [],
975
+ "members": [],
976
+ "notes": [],
977
+ "language": ""
978
+ },
979
+ {
980
+ "type": "FUNCTION",
981
+ "name": "render.predicate",
982
+ "brief": "creates a new render predicate",
983
+ "description": "This function returns a new render predicate for objects with materials matching\nthe provided material tags. The provided tags are combined into a bit mask\nfor the predicate. If multiple tags are provided, the predicate matches materials\nwith all tags ANDed together.\nThe current limit to the number of tags that can be defined is <code>64</code>.",
984
+ "returnvalues": [
985
+ {
986
+ "name": "predicate",
987
+ "doc": "new predicate",
988
+ "types": ["number"]
989
+ }
990
+ ],
991
+ "parameters": [
992
+ {
993
+ "name": "tags",
994
+ "doc": "table of tags that the predicate should match. The tags can be of either hash or string type",
995
+ "types": ["table"],
996
+ "is_optional": "False"
997
+ }
998
+ ],
999
+ "examples": "Create a new render predicate containing all visual objects that\nhave a material with material tags \"opaque\" AND \"smoke\".\n<div class=\"codehilite\"><pre><span></span><code>local p = render.predicate({hash(&quot;opaque&quot;), hash(&quot;smoke&quot;)})\n</code></pre></div>",
1000
+ "replaces": "",
1001
+ "error": "",
1002
+ "tparams": [],
1003
+ "members": [],
1004
+ "notes": [],
1005
+ "language": ""
1006
+ },
1007
+ {
1008
+ "type": "FUNCTION",
1009
+ "name": "render.enable_material",
1010
+ "brief": "enables a material",
1011
+ "description": "If another material was already enabled, it will be automatically disabled\nand the specified material is used instead.\nThe name of the material must be specified in the \".render\" resource set\nin the \"game.project\" setting.",
1012
+ "returnvalues": [],
1013
+ "parameters": [
1014
+ {
1015
+ "name": "material_id",
1016
+ "doc": "material id to enable",
1017
+ "types": ["string", "hash"],
1018
+ "is_optional": "False"
1019
+ }
1020
+ ],
1021
+ "examples": "Enable material named \"glow\", then draw my_pred with it.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_material</span><span class=\"p\">(</span><span class=\"s2\">&quot;glow&quot;</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">disable_material</span><span class=\"p\">()</span>\n</code></pre></div>",
1022
+ "replaces": "",
1023
+ "error": "",
1024
+ "tparams": [],
1025
+ "members": [],
1026
+ "notes": [],
1027
+ "language": ""
1028
+ },
1029
+ {
1030
+ "type": "FUNCTION",
1031
+ "name": "render.disable_material",
1032
+ "brief": "disables the currently enabled material",
1033
+ "description": "If a material is currently enabled, disable it.\nThe name of the material must be specified in the \".render\" resource set\nin the \"game.project\" setting.",
1034
+ "returnvalues": [],
1035
+ "parameters": [],
1036
+ "examples": "Enable material named \"glow\", then draw my_pred with it.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_material</span><span class=\"p\">(</span><span class=\"s2\">&quot;glow&quot;</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">disable_material</span><span class=\"p\">()</span>\n</code></pre></div>",
1037
+ "replaces": "",
1038
+ "error": "",
1039
+ "tparams": [],
1040
+ "members": [],
1041
+ "notes": [],
1042
+ "language": ""
1043
+ },
1044
+ {
1045
+ "type": "FUNCTION",
1046
+ "name": "render.set_camera",
1047
+ "brief": "sets the current render camera to be used for rendering",
1048
+ "description": "Sets the current render camera to be used for rendering. If a render camera\nhas been set by the render script, the renderer will be using its projection and view matrix\nduring rendering. If a projection and/or view matrix has been set by the render script,\nthey will not be used until the current render camera has been reset by calling <code>render.set_camera()</code>.\nIf the 'use_frustum' flag in the options table has been set to true, the renderer will automatically use the\ncamera frustum for frustum culling regardless of what frustum is being passed into the render.draw() function.\nNote that the frustum plane option in render.draw can still be used together with the camera.",
1049
+ "returnvalues": [],
1050
+ "parameters": [
1051
+ {
1052
+ "name": "camera",
1053
+ "doc": "camera id to use, or nil to reset",
1054
+ "types": ["url", "number", "nil"],
1055
+ "is_optional": "False"
1056
+ },
1057
+ {
1058
+ "name": "options",
1059
+ "doc": "optional table with properties:\n<dl>\n<dt><code>use_frustum</code></dt>\n<dd><span class=\"type\">boolean</span> If true, the renderer will use the cameras view-projection matrix for frustum culling (default: false)</dd>\n</dl>",
1060
+ "types": ["table"],
1061
+ "is_optional": "True"
1062
+ }
1063
+ ],
1064
+ "examples": "Set the current camera to be used for rendering\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_camera</span><span class=\"p\">(</span><span class=\"s2\">&quot;main:/my_go#camera&quot;</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_camera</span><span class=\"p\">(</span><span class=\"kc\">nil</span><span class=\"p\">)</span>\n</code></pre></div>\n\nUse the camera frustum for frustum culling together with a specific frustum plane option for the draw command\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- The camera frustum will take precedence over the frustum plane option in render.draw</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_camera</span><span class=\"p\">(</span><span class=\"s2\">&quot;main:/my_go#camera&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">use_frustum</span> <span class=\"o\">=</span> <span class=\"kc\">true</span> <span class=\"p\">})</span>\n<span class=\"c1\">-- However, we can still customize the frustum planes regardless of the camera option!</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">draw</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_pred</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">frustum_planes</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">FRUSTUM_PLANES_ALL</span> <span class=\"p\">})</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_camera</span><span class=\"p\">()</span>\n</code></pre></div>",
1065
+ "replaces": "",
1066
+ "error": "",
1067
+ "tparams": [],
1068
+ "members": [],
1069
+ "notes": [],
1070
+ "language": ""
1071
+ },
1072
+ {
1073
+ "type": "FUNCTION",
1074
+ "name": "render.set_compute",
1075
+ "brief": "set the current compute program",
1076
+ "description": "The name of the compute program must be specified in the \".render\" resource set\nin the \"game.project\" setting. If nil (or no arguments) are passed to this function,\nthe current compute program will instead be disabled.",
1077
+ "returnvalues": [],
1078
+ "parameters": [
1079
+ {
1080
+ "name": "compute",
1081
+ "doc": "compute id to use, or nil to disable",
1082
+ "types": ["string", "hash", "nil"],
1083
+ "is_optional": "False"
1084
+ }
1085
+ ],
1086
+ "examples": "Enable compute program named \"fractals\", then dispatch it.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_compute</span><span class=\"p\">(</span><span class=\"s2\">&quot;fractals&quot;</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">backing_texture</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">dispatch_compute</span><span class=\"p\">(</span><span class=\"mi\">128</span><span class=\"p\">,</span> <span class=\"mi\">128</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_compute</span><span class=\"p\">()</span>\n</code></pre></div>",
1087
+ "replaces": "",
1088
+ "error": "",
1089
+ "tparams": [],
1090
+ "members": [],
1091
+ "notes": [],
1092
+ "language": ""
1093
+ },
1094
+ {
1095
+ "type": "FUNCTION",
1096
+ "name": "render.dispatch_compute",
1097
+ "brief": "dispatches the currently enabled compute program",
1098
+ "description": "Dispatches the currently enabled compute program. The dispatch call takes three arguments x,y,z which constitutes\nthe 'global working group' of the compute dispatch. Together with the 'local working group' specified in the compute shader\nas a layout qualifier, these two sets of parameters forms the number of invocations the compute shader will execute.\nAn optional constant buffer can be provided to override the default constants. If no constants buffer is provided, a default\nsystem constants buffer is used containing constants as defined in the compute program.",
1099
+ "returnvalues": [],
1100
+ "parameters": [
1101
+ {
1102
+ "name": "x",
1103
+ "doc": "global work group size X",
1104
+ "types": ["number"],
1105
+ "is_optional": "False"
1106
+ },
1107
+ {
1108
+ "name": "y",
1109
+ "doc": "global work group size Y",
1110
+ "types": ["number"],
1111
+ "is_optional": "False"
1112
+ },
1113
+ {
1114
+ "name": "z",
1115
+ "doc": "global work group size Z",
1116
+ "types": ["number"],
1117
+ "is_optional": "False"
1118
+ },
1119
+ {
1120
+ "name": "options",
1121
+ "doc": "optional table with properties:\n<dl>\n<dt><code>constants</code></dt>\n<dd><span class=\"type\">constant_buffer</span> optional constants to use while rendering</dd>\n</dl>",
1122
+ "types": ["table"],
1123
+ "is_optional": "True"
1124
+ }
1125
+ ],
1126
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"kd\">local</span> <span class=\"n\">color_params</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">format</span> <span class=\"o\">=</span> <span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">TEXTURE_FORMAT_RGBA</span><span class=\"p\">,</span>\n <span class=\"n\">width</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_width</span><span class=\"p\">(),</span>\n <span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">get_window_height</span><span class=\"p\">()}</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">scene_rt</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">render_target</span><span class=\"p\">({[</span><span class=\"n\">graphics</span><span class=\"p\">.</span><span class=\"n\">BUFFER_TYPE_COLOR0_BIT</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">color_params</span><span class=\"p\">})</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_compute</span><span class=\"p\">(</span><span class=\"s2\">&quot;bloom&quot;</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">backing_texture</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">enable_texture</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">scene_rt</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">dispatch_compute</span><span class=\"p\">(</span><span class=\"mi\">128</span><span class=\"p\">,</span> <span class=\"mi\">128</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_compute</span><span class=\"p\">()</span>\n<span class=\"kr\">end</span>\n</code></pre></div>\n\nDispatch a compute program with a constant buffer:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">constant_buffer</span><span class=\"p\">()</span>\n<span class=\"n\">constants</span><span class=\"p\">.</span><span class=\"n\">tint</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector4</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n<span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">dispatch_compute</span><span class=\"p\">(</span><span class=\"mi\">32</span><span class=\"p\">,</span> <span class=\"mi\">32</span><span class=\"p\">,</span> <span class=\"mi\">32</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">constants</span> <span class=\"o\">=</span> <span class=\"n\">constants</span><span class=\"p\">})</span>\n</code></pre></div>",
1127
+ "replaces": "",
1128
+ "error": "",
1129
+ "tparams": [],
1130
+ "members": [],
1131
+ "notes": [],
1132
+ "language": ""
1133
+ },
1134
+ {
1135
+ "type": "FUNCTION",
1136
+ "name": "render.set_listener",
1137
+ "brief": "set render's event listener",
1138
+ "description": "Set or remove listener. Currenly only only two type of events can arrived:\n<code>render.CONTEXT_EVENT_CONTEXT_LOST</code> - when rendering context lost. Rending paused and all graphics resources become invalid.\n<code>render.CONTEXT_EVENT_CONTEXT_RESTORED</code> - when rendering context was restored. Rendering still paused and graphics resources still\ninvalid but can be reloaded.",
1139
+ "returnvalues": [],
1140
+ "parameters": [
1141
+ {
1142
+ "name": "callback",
1143
+ "doc": "A callback that receives all render related events.\nPass <code>nil</code> if want to remove listener.\n<dl>\n<dt><code>self</code></dt>\n<dd><span class=\"type\">object</span> The render script</dd>\n<dt><code>event_type</code></dt>\n<dd><span class=\"type\">string</span> Rendering event. Possible values: <code>render.CONTEXT_EVENT_CONTEXT_LOST</code>, <code>render.CONTEXT_EVENT_CONTEXT_RESTORED</code></dd>\n</dl>",
1144
+ "types": ["function(self, event_type)", "nil"],
1145
+ "is_optional": "False"
1146
+ }
1147
+ ],
1148
+ "examples": "Set listener and handle render context events.\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">--- custom.render_script</span>\n<span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">set_listener</span><span class=\"p\">(</span><span class=\"kr\">function</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">event_type</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">event_type</span> <span class=\"o\">==</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">CONTEXT_EVENT_CONTEXT_LOST</span> <span class=\"kr\">then</span>\n <span class=\"c1\">--- Some stuff when rendering context is lost</span>\n <span class=\"kr\">elseif</span> <span class=\"n\">event_type</span> <span class=\"o\">==</span> <span class=\"n\">render</span><span class=\"p\">.</span><span class=\"n\">CONTEXT_EVENT_CONTEXT_RESTORED</span> <span class=\"kr\">then</span>\n <span class=\"c1\">--- Start reload resources, reload game, etc.</span>\n <span class=\"kr\">end</span>\n <span class=\"kr\">end</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1149
+ "replaces": "",
1150
+ "error": "",
1151
+ "tparams": [],
1152
+ "members": [],
1153
+ "notes": [],
1154
+ "language": ""
1155
+ }
1156
+ ],
1157
+ "info": {
1158
+ "namespace": "render",
1159
+ "name": "Render",
1160
+ "brief": "Rendering API documentation",
1161
+ "description": "Rendering functions, messages and constants. The \"render\" namespace is\naccessible only from render scripts.\n\nThe rendering API was originally built on top of OpenGL ES 2.0, and it uses a subset of the\nOpenGL computer graphics rendering API for rendering 2D and 3D computer\ngraphics. Our current target is OpenGLES 3.0 with fallbacks to 2.0 on some platforms.\n\n[icon:attention] It is possible to create materials and write shaders that\nrequire features not in OpenGL ES 2.0, but those will not work cross platform.",
1162
+ "path": "engine/render/src/render/render_script.cpp",
1163
+ "file": "",
1164
+ "notes": [],
1165
+ "language": "Lua"
1166
+ }
1167
+ }