lua_api.txt 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  1. .. contents::
  2. Math
  3. ====
  4. Vector3
  5. -------
  6. **Vector3** (x, y, z) : Vector3
  7. Constructor.
  8. **x** (v) : float
  9. Returns the x value of the vector.
  10. **y** (v) : float
  11. Returns the y value of the vector.
  12. **z** (v) : float
  13. Returns the z value of the vector.
  14. **.x** : float
  15. Returns/assigns the x value of the vector.
  16. **.y** : float
  17. Returns/assigns the y value of the vector.
  18. **.z** : float
  19. Returns/assigns the z value of the vector.
  20. **set_x** (v, x)
  21. Sets the value of the x value of the vector.
  22. **set_y** (v, y)
  23. Sets the value of the y value of the vector.
  24. **set_z** (v, z)
  25. Sets the value of the z value of the vector.
  26. **values** (v) : float, float, float
  27. Returns the x, y and z values of the vector.
  28. **add** (a, b) : Vector3
  29. Adds the vector *a* to *b* and returns the result.
  30. **subtract** (a, b) : Vector3
  31. Subtracts the vector *b* from *a* and returns the result.
  32. **multiply** (a, k) : Vector3
  33. Multiplies the vector *a* by the scalar *k* and returns the result.
  34. **dot** (a, b) : float
  35. Returns the dot product between the vectors *a* and *b*.
  36. **cross** (a, b) : Vector3
  37. Returns the cross product between the vectors *a* and *b*.
  38. **equal** (a, b) : bool
  39. Returns true whether the vectors *a* and *b* are equal.
  40. **length** (a) : float
  41. Returns the lenght of *a*.
  42. **length_squared** (a) : float
  43. Returns the squared length of *a*.
  44. **set_length** (a, len)
  45. Sets the lenght of *a* to *len*.
  46. **normalize** (a) : Vector3
  47. Normalizes *a* and returns the result.
  48. **distance** (a, b) : float
  49. Returns the distance between the points *a* and *b*.
  50. **distance_squared** (a, b) : float
  51. Returns the squared distance between the points *a* and *b*.
  52. **angle** (a, b) : float
  53. Returns the angle between the vectors *a* and *b*.
  54. **max** (a, b) : Vector3
  55. Returns a vector that contains the largest value for each component from *a* and *b*.
  56. **min** (a, b) : Vector3
  57. Returns a vector that contains the smallest value for each component from *a* and *b*.
  58. **lerp** (a, b, t) : Vector3
  59. Returns the linearly interpolated vector between *a* and *b* at time *t* in [0, 1].
  60. **forward** () : Vector3
  61. **backward** () : Vector3
  62. **left** () : Vector3
  63. **right** () : Vector3
  64. **up** () : Vector3
  65. **down** () : Vector3
  66. Returns the corresponding semantic axis.
  67. **zero** () : Vector3
  68. Returns a vector with all values set to zero.
  69. **to_string** (v) : string
  70. Returns a string representing the vector *v*.
  71. Vector3Box
  72. ----------
  73. **Vector3Box** ()
  74. Creates a new Vector3Box.
  75. **Vector3Box** (v)
  76. Creates a new Vector3Box from the Vector3 *v*.
  77. **Vector3Box** (x, y, z)
  78. Creates a new Vector3Box from components.
  79. **store** (v)
  80. Stores the Vector3 *v* in the box.
  81. **store** (x, y, z)
  82. Stores Vector3(x, y, z) in the box.
  83. **unbox** () : Vector3
  84. Returns the stored vector from the box.
  85. Quaternion
  86. ----------
  87. **Quaternion** (v, w) : Quaternion
  88. Constructor.
  89. **negate** (q) : Quaternion
  90. Negates the quaternion *q* and returns the result.
  91. **identity** () : Quaternion
  92. Returns the identity quaternion.
  93. **multiply** (a, b) : Quaternion
  94. Multiplies the quaternions *a* and *b*. (i.e. rotates first by *a* then by *b*).
  95. **multiply_by_scalar** (a, k) : Quaternion
  96. Multiplies the quaternion *a* by the scalar *k*.
  97. **length** (q) : float
  98. Returns the length of *q*.
  99. **normalize** (q) : Quaternion
  100. Normalizes the quaternion *q* and returns the result.
  101. **conjugate** (q) : Quaternion
  102. Returns the conjugate of quaternion *q*.
  103. **inverse** (q) : Quaternion
  104. Returns the inverse of quaternion *q*.
  105. **power** (q, exp) : Quaternion
  106. Returns the quaternion *q* raised to the power of *exp*.
  107. **elements** (q) : x, y, z, w
  108. Returns the elements of the quaternion.
  109. **look** (dir, [up]) : Quaternion
  110. Returns the quaternion describing the rotation needed to face towards *dir*.
  111. If *up* is not specified, Vector3.up() is used.
  112. **right** (q) : Vector3
  113. Returns the right axis of the rotation described by *q*.
  114. **up** (q) : Vector3
  115. Returns the up axis of the rotation described by *q*.
  116. **forward** (q) : Vector3
  117. Returns the forward axis of the rotation described by *q*.
  118. QuaternionBox
  119. -------------
  120. **QuaternionBox** ()
  121. Creates a new QuaternionBox.
  122. **QuaternionBox** (q)
  123. Creates a new QuaternionBox from the Quaternion *q*.
  124. **QuaternionBox** (x, y, z, w)
  125. Creates a new QuaternionBox from elements.
  126. **store(q)** ()
  127. Stores the Quaternion *q* in the box.
  128. **store** (x, y, z, w)
  129. Stores Quaternion(x, y, z, w) in the box.
  130. **unbox** () : Quaternion
  131. Returns the stored quaternion from the box.
  132. Matrix4x4
  133. ---------
  134. **Matrix4x4** (m0, m1, ..., m15) : Matrix4x4
  135. Constructor.
  136. **from_quaternion** (q) : Matrix4x4
  137. Returns a new matrix from *q*.
  138. **from_translation** (t) : Matrix4x4
  139. Returns a new matrix from *t*.
  140. **from_quaternion_translation** (q, t) : Matrix4x4
  141. Returns a new matrix from *q* and *t*.
  142. **from_axes** (x, y, z, t) : Matrix4x4
  143. Returns a new matrix from *x*, *y*, *z* and *t*.
  144. **copy** (m) : Matrix4x4
  145. Returns a copy of the matrix *m*.
  146. **add** (a, b) : Matrix4x4
  147. Adds the matrix *a* to *b* and returns the result.
  148. **subtract** (a, b) : Matrix4x4
  149. Subtracts the matrix *b* from *a* and returns the result.
  150. **multiply** (a, b) : Matrix4x4
  151. Multiplies the matrix *a* by *b* and returns the result. (i.e. transforms first by *a* then by *b*)
  152. **transpose** (m) : Matrix4x4
  153. Transposes the matrix *m* and returns the result.
  154. **determinant** (m) : float
  155. Returns the determinant of the matrix *m*.
  156. **invert** (m) : Matrix4x4
  157. Inverts the matrix *m* and returns the result.
  158. **x** (m) : Vector3
  159. Returns the x asis of the matrix *m*.
  160. **y** (m) : Vector3
  161. Returns the y asis of the matrix *m*.
  162. **z** (m) : Vector3
  163. Returns the z asis of the matrix *m*.
  164. **set_x** (m, x)
  165. Sets the x axis of the matrix *m*.
  166. **set_y** (m, y)
  167. Sets the y axis of the matrix *m*.
  168. **set_z** (m, z)
  169. Sets the z axis of the matrix *m*.
  170. **rotation** (m) : Quaternion
  171. Returns the rotation portion of the matrix *m*.
  172. **set_rotation** (m, r)
  173. Sets the rotation portion of the matrix *m*.
  174. **translation** (m, a) : Vector3
  175. Returns the translation portion of the matrix *m*.
  176. **set_translation** (m, t)
  177. Sets the translation portion of the matrix *m*.
  178. **identity** ()
  179. Returns the identity matrix.
  180. **transform** (m, v) : Vector3
  181. Transforms the vector *v* by the matrix *m* and returns the result.
  182. **to_string** (m) : string
  183. Returns a string representing the matrix *m*.
  184. Matrix4x4Box
  185. ------------
  186. **Matrix4x4Box** (m)
  187. Creates a new Matrix4x4Box from the Matrix4x4 *m*.
  188. **store** (m)
  189. Stores the Matrix4x4 *m* in the box.
  190. **unbox** () : Matrix4x4
  191. Returns the stored matrix from the box.
  192. Math
  193. ----
  194. **ray_plane_intersection** (from, dir, point, normal) : float
  195. Returns the distance along ray (from, dir) to intersection point with plane defined by
  196. *point* and *normal* or -1.0 if no intersection.
  197. **ray_disc_intersection** (from, dir, center, radius, normal) : float
  198. Returns the distance along ray (from, dir) to intersection point with disc defined by
  199. *center*, *radius* and *normal* or -1.0 if no intersection.
  200. **ray_sphere_intersection** (from, dir, center, radius) : float
  201. Returns the distance along ray (from, dir) to intersection point with sphere defined by
  202. *center* and *radius* or -1.0 if no intersection.
  203. **ray_obb_intersection** (from, dir, tm, extents) : float
  204. Returns the distance along ray (from, dir) to intersection point with the oriented
  205. bounding box (tm, extents) or -1.0 if no intersection.
  206. World
  207. =====
  208. **spawn_unit** (world, name, [position, rotation]) : Unit
  209. Spawns a new instance of the unit *name* at the given *position* and *rotation*.
  210. **destroy_unit** (world, unit)
  211. Destroys the given *unit*.
  212. **num_units** (world) : int
  213. Returns the number of units in the *world*.
  214. **units** (world) : Table
  215. Returns all the the units in the world in a table.
  216. **update_animations** (world, dt)
  217. Update all animations with *dt*.
  218. **update_scene** (world, dt)
  219. Updates the scene with *dt*.
  220. **update** (world, dt)
  221. Updates the world with *dt*.
  222. **play_sound** (world, name, [loop, volume, position, range]) : SoundInstanceId
  223. Plays the sound with the given *name* at the given *position*, with the given
  224. *volume* and *range*. *loop* controls whether the sound must loop or not.
  225. **stop_sound** (world, id)
  226. Stops the sound with the given *id*.
  227. **link_sound** (world, id, unit, node)
  228. Links the sound *id* to the *node* of the given *unit*.
  229. After this call, the sound *id* will follow the unit *unit*.
  230. **set_listener_pose** (world, pose)
  231. Sets the *pose* of the listener.
  232. **set_sound_position** (world, position)
  233. Sets the *position* of the sound *id*.
  234. **set_sound_range** (world, range)
  235. Sets the *range* of the sound *id*.
  236. **set_sound_volume** (world, volume)
  237. Sets the *volume* of the sound *id*.
  238. **create_window_gui** (world) : Gui
  239. Creates a new window-space Gui of size *width* and *height*.
  240. **destroy_gui** (world, id)
  241. Destroys the gui with the given *id*.
  242. **create_debug_line** (world, depth_test) : DebugLine
  243. Creates a new DebugLine. *depth_test* controls whether to
  244. enable depth test when rendering the lines.
  245. **destroy_debug_line** (world, line)
  246. Destroys the debug *line*.
  247. **load_level** (world, name) : Level
  248. Loads the level *name* into the world.
  249. **physics_world** (world) : PhysicsWorld
  250. Returns the physics sub-world.
  251. **sound_world** (world) : SoundWorld
  252. Returns the sound sub-world.
  253. Unit
  254. ----
  255. **local_position** (unit) : Vector3
  256. Returns the local position of the unit.
  257. **local_rotation** (unit) : Quaternion
  258. Returns the local rotation of the unit.
  259. **local_scale** (unit) : Vector3
  260. Returns the local scale of the unit.
  261. **local_pose** (unit) : Matrix4x4
  262. Returns the local pose of the unit.
  263. **world_position** (unit) : Vector3
  264. Returns the world position of the unit.
  265. **world_rotation** (unit) : Quaternion
  266. Returns the world rotation of the unit.
  267. **world_pose** (unit) : Matrix4x4
  268. Returns the world pose of the unit.
  269. **set_local_position** (unit, position)
  270. Sets the local position of the unit.
  271. **set_local_rotation** (unit, rotation)
  272. Sets the local rotation of the unit.
  273. **set_local_scale** (unit, scale)
  274. Sets the local scale of the unit.
  275. **set_local_pose** (unit, n, pose)
  276. Sets the local pose of the unit.
  277. **camera** (unit, name)
  278. Returns the camera *name*.
  279. **material** (unit, name)
  280. Returns the material *name*.
  281. **mesh** (unit, name)
  282. Returns the mesh *name*.
  283. **sprite** (unit, name)
  284. Returns the sprite *name*.
  285. **actor** (unit, name)
  286. Returns the actor *name*.
  287. **controller** (unit, name)
  288. Returns the controller *name*.
  289. **is_a** (unit, type)
  290. Returns whether the unit is of the given *type*.
  291. **play_sprite_animation** (unit, name, loop)
  292. Plays the sprite animation *name*.
  293. **stop_sprite_animation** (unit)
  294. Stops the current playing animation.
  295. Camera
  296. ------
  297. **set_projection_type** (camera, type)
  298. Sets the projection type of the camera.
  299. **projection_type** (camera) : int
  300. Returns the projection type of the camera.
  301. **fov** (camera) : float
  302. Returns the field-of-view of the camera in degrees.
  303. **set_fov** (camera, degrees)
  304. Sets the field-of-view of the camera in degrees.
  305. **aspect** (camera) : float
  306. Returns the aspect ratio of the camera. (Perspective projection only.)
  307. **set_aspect** (camera)
  308. Sets the aspect ratio of the camera. (Perspective projection only.)
  309. **near_clip_distance** (camera) : float
  310. Returns the near clip distance of the camera.
  311. **set_near_clip_distance** (camera, near)
  312. Sets the near clip distance of the camera.
  313. **far_clip_distance** (camera) : float
  314. Returns the far clip distance of the camera.
  315. **set_far_clip_distance** (camera, far)
  316. Sets the far clip distance of the camera.
  317. **set_orthographic_metrics** (camera, left, right, bottom, top)
  318. Sets the coordinates for orthographic clipping planes. (Orthographic projection only.)
  319. **set_viewport_metrics** (camera, x, y, width, height)
  320. Sets the coordinates for the camera viewport in pixels.
  321. **screen_to_world** (camera, pos) : Vector3
  322. Returns *pos* from screen-space to world-space coordinates.
  323. **world_to_screen** (camera, pos) : Vector3
  324. Returns *pos* from world-space to screen-space coordinates.
  325. Sprite
  326. ------
  327. **set_frame** (sprite, num)
  328. Sets the frame of the sprite.
  329. **set_depth** (sprite, depth)
  330. Sets the depth of the sprite.
  331. Sprites with higher depth values are drawn in front of sprites
  332. whith lower depth values.
  333. Mesh
  334. ----
  335. **local_position** (mesh) : Vector3
  336. Returns the local position of the mesh.
  337. **local_rotation** (mesh) : Quaternion
  338. Returns the local rotation of the mesh.
  339. **local_pose** (mesh) : Matrix4x4
  340. Returns the local pose of the mesh.
  341. **set_local_position** (mesh, unit, position)
  342. Sets the local position of the mesh.
  343. **set_local_rotation** (mesh, unit, rotation)
  344. Sets the local rotation of the mesh.
  345. **set_local_pose** (mesh, unit, pose)
  346. Sets the local pose of the mesh.
  347. Material
  348. --------
  349. **set_float** (material, variable, value)
  350. Sets the material variable to the given value.
  351. **set_vector2** (material, variable, value)
  352. Sets the material variable to the given value.
  353. **set_vector3** (material, variable, value)
  354. Sets the material variable to the given value.
  355. Gui
  356. ---
  357. resolution
  358. TODO
  359. move
  360. TODO
  361. screen_to_gui
  362. TODO
  363. draw_rectangle
  364. TODO
  365. draw_image
  366. TODO
  367. draw_image_uv
  368. TODO
  369. draw_text
  370. TODO
  371. PhysicsWorld
  372. =============
  373. **gravity** (physics_world) : Vector3
  374. Returns the gravity.
  375. **set_gravity** (physics_world, gravity)
  376. Sets the gravity.
  377. **make_raycast**
  378. TODO
  379. **overlap_test**
  380. TODO
  381. Controller
  382. ----------
  383. **move** (controller, position)
  384. Moves the controller to *position*.
  385. **position** (controller) : Vector3
  386. Returns the position of the controller.
  387. **collides_up** (controller) : bool
  388. Returns whether the contoller collides upwards.
  389. **collides_down** (controller) : bool
  390. Returns whether the controller collides downwards.
  391. **collides_sides** (controller) : bool
  392. Returns whether the controller collides sidewards.
  393. Actor
  394. -----
  395. **world_position** (actor) : Vector3
  396. Returns the world position of the actor.
  397. **world_rotation** (actor) : Quaternion
  398. Returns the world rotation of the actor.
  399. **world_pose** (actor) : Matrix4x4
  400. Returns the world pose of the actor.
  401. **teleport_world_position** (actor, position)
  402. Teleports the actor to the given world position.
  403. **teleport_world_rotation** (actor, rotation)
  404. Teleports the actor to the given world rotation.
  405. **teleport_world_pose** (actor, pose)
  406. Teleports the actor to the given world pose.
  407. **center_of_mass** (actor) : Vector3
  408. Returns the center of mass of the actor.
  409. **enable_gravity** (actor)
  410. Enables gravity for the actor.
  411. **disable_gravity** (actor)
  412. Disables gravity for the actor.
  413. **enable_collision** (actor)
  414. Enables collision detection for the actor.
  415. **disable_collision** (actor)
  416. Disables collision detection for the actor.
  417. **set_collision_filter** (actor, name)
  418. Sets the collision filter of the actor.
  419. **set_kinematic** (actor, kinematic)
  420. Sets whether the actor is kinematic or not.
  421. Note that this call has no effect on static actors.
  422. **move** (actor, position)
  423. Moves the actor to *pos*
  424. Note that this call only affects nonkinematic actors.
  425. **is_static** (actor) : bool
  426. Returns whether the actor is static.
  427. **is_dynamic** (actor) bool
  428. Returns whether the actor is dynamic.
  429. **is_kinematic** (actor) : bool
  430. Returns whether the actor is kinematic (keyframed).
  431. **is_nonkinematic** (actor) : bool
  432. Returns whether the actor is nonkinematic (i.e. dynamic and not kinematic).
  433. **linear_damping** (actor) : float
  434. Returns the linear damping of the actor.
  435. **set_linear_damping** (actor, damping)
  436. Sets the linear damping of the actor.
  437. **angular_damping** (actor) : float
  438. Returns the angular damping of the actor.
  439. **set_angular_damping** (actor, rate)
  440. Sets the angular damping of the actor.
  441. **linear_velocity** (actor) : Vector3
  442. Returns the linear velocity of the actor.
  443. **set_linear_velocity** (actor, velocity)
  444. Sets the linear velocity of the actor.
  445. Note that this call only affects nonkinematic actors.
  446. **angular_velocity** (actor) : Vector3
  447. Returns the angular velocity of the actor.
  448. **set_angular_velocity** (actor, velocity)
  449. Sets the angular velocity of the actor.
  450. Note that this call only affects nonkinematic actors.
  451. **add_impulse** (actor, impulse)
  452. Adds a linear impulse (acting along the center of mass) to the actor.
  453. Note that this call only affects nonkinematic actors.
  454. **add_impulse_at** (actor, impulse, position)
  455. Adds a linear impulse (acting along the world position *pos*) to the actor.
  456. Note that this call only affects nonkinematic actors.
  457. **add_torque_impulse** (actor, impulse)
  458. Adds a torque impulse to the actor.
  459. **push** (actor, velocity, mass)
  460. Pushes the actor as if it was hit by a point object with the given *mass*
  461. travelling at the given *velocity*.
  462. Note that this call only affects nonkinematic actors.
  463. **push_at** (actor, velocity, mass, position)
  464. Like push() but applies the force at the world position *pos*.
  465. Note that this call only affects nonkinematic actors.
  466. **is_sleeping** (actor) : bool
  467. Returns whether the actor is sleeping.
  468. **wake_up** (actor)
  469. Wakes the actor up.
  470. **unit** (actor) : Unit
  471. Returns the unit that owns the actor or nil;
  472. SoundWorld
  473. ===========
  474. **stop_all** (sound_world)
  475. Stops all the sounds in the world.
  476. **pause_all** (sound_world)
  477. Pauses all the sounds in the world
  478. **resume_all** (sound_world)
  479. Resumes all previously paused sounds in the world.
  480. **is_playing** (sound_world, id) : bool
  481. Returns wheter the sound *id* is playing.
  482. ResourcePackage
  483. ================
  484. **load** (package)
  485. Loads all the resources in the package.
  486. Note that the resources are not immediately available after the call is made,
  487. instead, you have to poll for completion with has_loaded().
  488. **unload** (package)
  489. Unloads all the resources in the package.
  490. **flush** (package)
  491. Waits until the package has been loaded.
  492. **has_loaded** (package) : bool
  493. Returns whether the package has been loaded.
  494. Device
  495. ======
  496. **platform** () : string
  497. Returns a string identifying what platform the engine is running on.
  498. It can be either ``android``, ``linux`` or ``windows``
  499. **architecture** () : string
  500. Returns a string identifying what architecture the engine is running on.
  501. **version** () : string
  502. Returns a string identifying the engine version.
  503. **last_delta_time** () : float
  504. Returns the time in seconds needed to render the last frame
  505. **quit** ()
  506. Quits the application.
  507. **resolution** () : Table
  508. Returns the main window resolution.
  509. **create_world** () : World
  510. Creates a new world.
  511. **destroy_world** (world)
  512. Destroys the given *world*.
  513. **render_world** (world, camera)
  514. Renders the given *world* from the point of view of the given *camera*.
  515. **create_resource_package** (name) : ResourcePackage
  516. Returns the resource package with the given *package_name* name.
  517. **destroy_resource_package** (package)
  518. Destroy a previously created resource *package*.
  519. Note that to unload the resources loaded by the package, you have to call
  520. ResourcePackage.unload() first.
  521. **console_send** (table)
  522. Sends the given lua *table* to clients connected to the engine.
  523. Note that the current version only supports explicitly escaped strings as key/value pairs.
  524. **can_get** (type, name) : bool
  525. Returns whether the resource (type, name) is loaded.
  526. When resource autoload is enabled it always returns true.
  527. **enable_resource_autoload** (enable)
  528. Sets whether resources should be automatically loaded when accessed.
  529. DebugLine
  530. =========
  531. **add_line** (debug_line, start, end, color)
  532. Adds a line from *start* to *end* with the given *color*.
  533. **add_axes** (debug_line, tm, length)
  534. Adds lines for each axis with the given *length*.
  535. **add_circle** (debug_line, center, radius, normal, color, [segments = 36])
  536. Adds a circle at *center* with the given *radius* and *normal* vector.
  537. **add_cone** (debug_line, from, to, radius, color, [segments = 36])
  538. Adds a cone with the base centered at *from* and the tip at *to*.
  539. **add_sphere** (debug_line, center, radius, color, [segments = 36])
  540. Adds a sphere at *center* with the given *radius*.
  541. **add_obb** (debug_line, tm, extents, color)
  542. Adds an orientd bounding box. *tm* describes the position and orientation of
  543. the box. *extents* describes the size of the box along the axis.
  544. **reset** (debug_line)
  545. Resets all the lines.
  546. **submit** (debug_line)
  547. Submits the lines to renderer for drawing.
  548. Input
  549. =====
  550. Keyboard
  551. --------
  552. **name** () : string
  553. Returns the name of the input device.
  554. **connected** () : bool
  555. Returns whether the input device is connected and functioning.
  556. **num_buttons** () : int
  557. Returns the number of buttons of the input device.
  558. **num_axes** () : int
  559. Returns the number of axes of the input device.
  560. **pressed** (id) : bool
  561. Returns whether the button *id* is pressed in the current frame.
  562. **released** (id) : bool
  563. Returns whether the button *id* is released in the current frame.
  564. **any_pressed** () : bool
  565. Returns wheter any button is pressed in the current frame.
  566. **any_released** () : bool
  567. Returns whether any button is released in the current frame.
  568. **button_id** (name) : int
  569. Returns the *id* of the button *name*.
  570. Keyboard Button Names
  571. ~~~~~~~~~~~~~~~~~~~~~
  572. * ``tab``, ``enter``, ``escape``, ``space``, ``backspace``
  573. * ``num_lock``, ``numpad_enter``, ``numpad_.``, ``numpad_*``, ``numpad_+``, ``numpad_-``, ``numpad_/``, ``numpad_0``, ``numpad_1``, ``numpad_2``, ``numpad_3``, ``numpad_4``, ``numpad_5``, ``numpad_6``, ``numpad_7``, ``numpad_8``, ``numpad_9``
  574. * ``f1``, ``f2``, ``f3``, ``f4``, ``f5``, ``f6``, ``f7``, ``f8``, ``f9``, ``f10``, ``f11``, ``f12``
  575. * ``home``, ``left``, ``up``, ``right``, ``down``, ``page_up``, ``page_down``, ``delete``, ``end``
  576. * ``left_ctrl``, ``right_ctrl``, ``left_shift``, ``right_shift``, ``caps_lock``, ``left_alt``, ``right_alt``, ``left_super``, ``right_super``
  577. * ``0``, ``1``, ``2``, ``3``, ``4``, ``5``, ``6``, ``7``, ``8``, ``9``
  578. * ``a``, ``b``, ``c``, ``d``, ``e``, ``f``, ``g``, ``h``, ``i``, ``j``, ``k``, ``l``, ``m``, ``n``, ``o``, ``p``, ``q``, ``r``, ``s``, ``t``, ``u``, ``v``, ``w``, ``x``, ``y``, ``z``
  579. Keyboard Axis Names
  580. ~~~~~~~~~~~~~~~~~~~
  581. None.
  582. Mouse
  583. -----
  584. **name** () : string
  585. Returns the name of the input device.
  586. **connected** () : bool
  587. Returns whether the input device is connected and functioning.
  588. **num_buttons** () : int
  589. Returns the number of buttons of the input device.
  590. **num_axes** () : int
  591. Returns the number of axes of the input device.
  592. **pressed** (id) : bool
  593. Returns whether the button *id* is pressed in the current frame.
  594. **released** (id) : bool
  595. Returns whether the button *id* is released in the current frame.
  596. **any_pressed** () : bool
  597. Returns wheter any button is pressed in the current frame.
  598. **any_released** () : bool
  599. Returns whether any button is released in the current frame.
  600. **axis** (id) : Vector3
  601. Returns the value of the axis *id*.
  602. The returned vector holds x and y coordinates of the pointer
  603. in window-space.
  604. **button_id** (name) : int
  605. Returns the *id* of the button *name*.
  606. **axis_id** (name) : int
  607. Returns the *id* of the axis *name*.
  608. Mouse Button Names
  609. ~~~~~~~~~~~~~~~~~~
  610. ``left``, ``middle``, ``right``, ``extra_1``, ``extra_2``
  611. Mouse Axis Names
  612. ~~~~~~~~~~~~~~~~
  613. * ``cursor``: Returns the cursor position (x, y) in screen coordinates.
  614. * ``cursor_delta``: Returns the delta of the cursor position (x, y) since last frame.
  615. * ``wheel``: Returns the movement of the mouse wheel in the y axis. Positive values of y mean upward scrolling, negative values mean downward scrolling.
  616. Touch
  617. -----
  618. **name** () : string
  619. Returns the name of the input device.
  620. **connected** () : bool
  621. Returns whether the input device is connected and functioning.
  622. **num_buttons** () : int
  623. Returns the number of buttons of the input device.
  624. **num_axes** () : int
  625. Returns the number of axes of the input device.
  626. **pressed** (id) : bool
  627. Returns whether the button *id* is pressed in the current frame.
  628. **released** (id) : bool
  629. Returns whether the button *id* is released in the current frame.
  630. **any_pressed** () : bool
  631. Returns wheter any button is pressed in the current frame.
  632. **any_released** () : bool
  633. Returns whether any button is released in the current frame.
  634. **axis** (id) : Vector3
  635. Returns the value of the axis *id*.
  636. The returned vector holds x and y coordinates of the pointer
  637. in window-space.
  638. Pad1, Pad2, Pad3, Pad4
  639. ----------------------
  640. **name** () : string
  641. Returns the name of the input device.
  642. **connected** () : bool
  643. Returns whether the input device is connected and functioning.
  644. **num_buttons** () : int
  645. Returns the number of buttons of the input device.
  646. **num_axes** () : int
  647. Returns the number of axes of the input device.
  648. **pressed** (id) : bool
  649. Returns whether the button *id* is pressed in the current frame.
  650. **released** (id) : bool
  651. Returns whether the button *id* is released in the current frame.
  652. **any_pressed** () : bool
  653. Returns wheter any button is pressed in the current frame.
  654. **any_released** () : bool
  655. Returns whether any button is released in the current frame.
  656. **axis** (id) : Vector3
  657. Returns the value of the axis *id*.
  658. The returned vector holds values in the range [-1;+1]
  659. **button_id** (name) : int
  660. Returns the *id* of the button *name*.
  661. **axis_id** (name) : int
  662. Returns the *id* of the axis *name*.
  663. Pad Button Names
  664. ~~~~~~~~~~~~~~~~
  665. * ``up``, ``down``, ``left``, ``right``
  666. * ``start``, ``back``, ``guide``
  667. * ``left_thumb``, ``right_thumb``
  668. * ``left_shoulder``, ``right_shoulder``
  669. * ``a``, ``b``, ``x``, ``y``
  670. Pad Axis Names
  671. ~~~~~~~~~~~~~~
  672. * ``left``, ``right``: Returns the direction (x, y) of the left or right thumbstick [-1; +1]. The z component represents the left or right trigger [0; +1].
  673. Window
  674. ======
  675. **show** ()
  676. Shows the window.
  677. **hide** ()
  678. Hides the window.
  679. **resize** (width, height)
  680. Resizes the window to *width* and *height*.
  681. **move** (x, y)
  682. Moves the window to *x* and *y*.
  683. **minimize** ()
  684. Minimizes the window.
  685. **restore** ()
  686. Restores the window.
  687. **is_resizable** () : bool
  688. Returns whether the window is resizable.
  689. **set_resizable** (resizable)
  690. Sets whether the window is resizable.
  691. **title** () : string
  692. Returns the title of the window.
  693. **set_title** (title)
  694. Sets the title of the window.