Module Globals

Extra global Lua functions and basic types

Functions

_G:__index (key) Search for singleton objects with Engine:has_singleton(key) and classes with ClassDB:class_exists(key).
print (...) Alias for GD.print
setthreadfunc (thread, f) Create or reuse a Lua thread (coroutine) with the given function/callable object
touserdata (value) Return value converted to light userdata with the return of lua_topointer

Scalar types

bool Boolean type godot_bool
float Float type godot_real
int Integer type godot_int


Functions

_G:__index (key)
Search for singleton objects with Engine:has_singleton(key) and classes with ClassDB:class_exists(key). Cache any values found, to avoid future calls. Called when indexing the global table _G with a currently unknown key.

Parameters:

  • key

Returns:

    Object Singleton object, if Engine:has_singleton(key)

Or

    OOP.ClassWrapper Class wrapper, if ClassDB:class_exists(key)

Or

    nil
print (...)
Alias for GD.print

Parameters:

  • ...
setthreadfunc (thread, f)
Create or reuse a Lua thread (coroutine) with the given function/callable object

Parameters:

  • thread thread or nil Thread to be reused. Pass nil to create a new one
  • f function, table or userdata Function or other callable

Returns:

    thread Reused or created thread
touserdata (value)
Return value converted to light userdata with the return of lua_topointer

Parameters:

  • value Value to be converted

Returns:

    Light userdata

Scalar types

bool
Boolean type godot_bool
float
Float type godot_real
int
Integer type godot_int
generated by LDoc 1.4.6 Last updated 2023-01-04 08:52:34