GDNativeLibrary
An external library containing functions or script classes to use in Godot.
A GDNative library can implement s, global functions to call with the GDNative class, or low-level engine extensions through interfaces such as . The library must be compiled for each platform and architecture that the project will run on.
Tutorials
Methods
PoolStringArray | ( ) const |
String | ( ) const |
- ConfigFile config_file
This resource in INI-style format, as in .gdnlib
files.
Default | true |
Setter | set_load_once(value) |
Getter | should_load_once() |
If false
, Godot loads a separate copy of the library into memory for each script that references it.
- bool reloadable
If true
, the editor will temporarily unload the library whenever the user switches away from the editor window, allowing the user to recompile the library without restarting Godot.
Note: If the library defines tool scripts that run inside the editor, reloadable
must be false
. Otherwise, the editor will attempt to unload the tool scripts while they’re in use and crash.
- singleton
Default | |
Setter | set_singleton(value) |
Getter | is_singleton() |
Note: A singleton library cannot be reloadable.
- symbol_prefix
The prefix this library’s entry point functions begin with. For example, a GDNativeLibrary would declare its gdnative_init
function as by default.
On platforms that require statically linking libraries (currently only iOS), each library must have a different symbol_prefix
.
Method Descriptions
- PoolStringArray get_current_dependencies ( ) const
Returns the path to the dynamic library file for the current platform and architecture.