Module GD

Godot enumerations and functions, available globally as the GD table.

Godot global constants from godot_get_global_constants are also available, like OK, ERR_ALREADY_EXISTS, TYPE_NIL, KEY_A, BUTTON_LEFT, JOY_START, HALIGN_CENTER and MIDI_MESSAGE_NOTE_OFF.

Functions

get_lua_instance (object) Returns the Lua script instance associated with an Object, if it has a Lua Script attached.
load (path) Loads a Resource by path, similar to GDScript's load
print (...) Print a message to Godot's Output panel, with values separated by tabs
print_error (...) Print an error to Godot's Output panel, with values separated by tabs
print_warning (...) Print a warning to Godot's Output panel, with values separated by tabs
str (value) Convert any value to a godot_string.
yield ([object[, signal_name]]) Yield the current running Lua thread, returning a wrapper Object with the lps_coroutine.lua script attached.

Fields

CallError Enumerations.CallError
Error Enumerations.Error
PropertyHint Enumerations.PropertyHint
PropertyUsage Enumerations.PropertyUsage
RPCMode Enumerations.RPCMode
VariantType Enumerations.VariantType
_VERSION Project version: 0.5.1
api (const godot_gdnative_core_api_struct *) GDNative core API 1.0
api_1_1 (const godot_gdnative_core_1_1_api_struct *) GDNative core API 1.1
api_1_2 (const godot_gdnative_core_1_2_api_struct *) GDNative core API 1.2
gdnativelibrary (Object) GDNativeLibrary instance


Functions

get_lua_instance (object)
Returns the Lua script instance associated with an Object, if it has a Lua Script attached.

Parameters:

Returns:

    LuaScriptInstance

Or

    nil If Object has no Lua Script attached
load (path)
Loads a Resource by path, similar to GDScript's load

Parameters:

  • path
print (...)
Print a message to Godot's Output panel, with values separated by tabs

Parameters:

  • ...
print_error (...)
Print an error to Godot's Output panel, with values separated by tabs

Parameters:

  • ...
print_warning (...)
Print a warning to Godot's Output panel, with values separated by tabs

Parameters:

  • ...
str (value)
Convert any value to a godot_string. If value is already a godot_string, return it unmodified. Otherwise, constructs a Variant and calls as_string on it.

Parameters:

  • value Value to be stringified

Returns:

    String
yield ([object[, signal_name]])
Yield the current running Lua thread, returning a wrapper Object with the lps_coroutine.lua script attached. If an object and signal_name are passed, this coroutine will resume automatically when object emits the signal. If the same coroutine yields more than once, the same object will be returned. This is similar to GDScript's yield.

Parameters:

Returns:

    Value passed to coroutine object's resume call, if any

See also:

Usage:

    -- self is a Node
    GD.yield(self:get_tree():create_timer(2), "timeout")
    print('2 seconds have passed!')

Fields

CallError
Enumerations.CallError
Error
Enumerations.Error
PropertyHint
Enumerations.PropertyHint
PropertyUsage
Enumerations.PropertyUsage
RPCMode
Enumerations.RPCMode
VariantType
Enumerations.VariantType
_VERSION
Project version: 0.5.1
api
(const godot_gdnative_core_api_struct *) GDNative core API 1.0
api_1_1
(const godot_gdnative_core_1_1_api_struct *) GDNative core API 1.1
api_1_2
(const godot_gdnative_core_1_2_api_struct *) GDNative core API 1.2
gdnativelibrary
(Object) GDNativeLibrary instance
generated by LDoc 1.4.6 Last updated 2023-01-04 08:52:34