Module LuaScriptInstance

Script instance metatable, the Lua side of a Lua script instance.

These are created when a PluginScript is instanced and are only directly accessible in the script's functions as the self parameter or gotten from Objects using GD.get_lua_instance.

typedef struct {
  godot_object *__owner;
  lps_lua_script *__script;
  lps_lua_object __data;
} lps_script_instance;

Functions

__concat (a, b) Concatenates values.
__index (key) Try indexing __owner, then __data, then __script.
__newindex (key, value) Calls Object:set if key is the name of a property known to base class, rawset otherwise.
__tostring () Returns a Lua string representation of __owner, as per Object:to_string.
rawget (index) Get a value from __data, bypassing the check for getters.
rawset (index, value) Sets a value on the __data, bypassing the check for setters.

Fields

__data LuaObject that references an internal table for holding arbitrary data.
__owner Object that this script instance is attached to.
__script LuaScript for instance, the one returned by the Lua script when loading it as a PluginScript.


Functions

__concat (a, b)
Concatenates values.

Parameters:

  • a First value, stringified with GD.str
  • b First value, stringified with GD.str

Returns:

    String
__index (key)
Try indexing __owner, then __data, then __script.

Parameters:

  • key

Returns:

See also:

__newindex (key, value)
Calls Object:set if key is the name of a property known to base class, rawset otherwise.

Parameters:

  • key
  • value
__tostring ()
Returns a Lua string representation of __owner, as per Object:to_string.

Returns:

    string
rawget (index)
Get a value from __data, bypassing the check for getters.

Parameters:

  • index

Returns:

rawset (index, value)
Sets a value on the __data, bypassing the check for setters.

Parameters:

  • index
  • value

Fields

__data
LuaObject that references an internal table for holding arbitrary data.
  • __data LuaObject
__owner
Object that this script instance is attached to. This is the Godot side of the instance.
__script
LuaScript for instance, the one returned by the Lua script when loading it as a PluginScript. Note that calling Object:get_script will return an Object rather than this wrapper.
  • __script LuaScript
generated by LDoc 1.4.6 Last updated 2023-01-04 08:52:34