virtualx-engine/modules/gdnative/doc_classes/GDNativeLibrary.xml

51 lines
3.4 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8" ?>
<class name="GDNativeLibrary" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
2019-10-06 04:53:08 +02:00
An external library containing functions or script classes to use in Godot.
</brief_description>
<description>
2019-10-06 04:53:08 +02:00
A GDNative library can implement [NativeScript]s, global functions to call with the [GDNative] class, or low-level engine extensions through interfaces such as [ARVRInterfaceGDNative]. The library must be compiled for each platform and architecture that the project will run on.
</description>
<tutorials>
2022-01-24 11:29:20 +01:00
<link>$DOCS_URL/tutorials/scripting/gdnative/gdnative_c_example.html</link>
<link>$DOCS_URL/tutorials/scripting/gdnative/gdnative_cpp_example.html</link>
</tutorials>
<methods>
2017-11-15 20:35:18 +01:00
<method name="get_current_dependencies" qualifiers="const">
<return type="PoolStringArray" />
2017-11-15 20:35:18 +01:00
<description>
2019-10-06 04:53:08 +02:00
Returns paths to all dependency libraries for the current platform and architecture.
2017-11-15 20:35:18 +01:00
</description>
</method>
<method name="get_current_library_path" qualifiers="const">
<return type="String" />
<description>
2019-10-06 04:53:08 +02:00
Returns the path to the dynamic library file for the current platform and architecture.
</description>
</method>
</methods>
<members>
<member name="config_file" type="ConfigFile" setter="set_config_file" getter="get_config_file">
2019-10-06 04:53:08 +02:00
This resource in INI-style [ConfigFile] format, as in [code].gdnlib[/code] files.
2018-04-10 10:12:42 +02:00
</member>
<member name="load_once" type="bool" setter="set_load_once" getter="should_load_once" default="true">
2019-10-06 04:53:08 +02:00
If [code]true[/code], Godot loads only one copy of the library and each script that references the library will share static data like static or global variables.
If [code]false[/code], Godot loads a separate copy of the library into memory for each script that references it.
2017-11-15 20:35:18 +01:00
</member>
<member name="reloadable" type="bool" setter="set_reloadable" getter="is_reloadable" default="true">
2019-10-06 04:53:08 +02:00
If [code]true[/code], 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.
[b]Note:[/b] If the library defines tool scripts that run inside the editor, [code]reloadable[/code] must be [code]false[/code]. Otherwise, the editor will attempt to unload the tool scripts while they're in use and crash.
2018-01-07 01:37:45 +01:00
</member>
<member name="singleton" type="bool" setter="set_singleton" getter="is_singleton" default="false">
If [code]true[/code], Godot loads the library at startup rather than the first time a script uses the library, calling [code]{prefix}gdnative_singleton[/code] after initializing the library (where [code]{prefix}[/code] is the value of [member symbol_prefix]). The library remains loaded as long as Godot is running.
2019-10-06 04:53:08 +02:00
[b]Note:[/b] A singleton library cannot be [member reloadable].
2017-11-15 20:35:18 +01:00
</member>
<member name="symbol_prefix" type="String" setter="set_symbol_prefix" getter="get_symbol_prefix" default="&quot;godot_&quot;">
2019-10-06 04:53:08 +02:00
The prefix this library's entry point functions begin with. For example, a GDNativeLibrary would declare its [code]gdnative_init[/code] function as [code]godot_gdnative_init[/code] by default.
On platforms that require statically linking libraries (currently only iOS), each library must have a different [code]symbol_prefix[/code].
</member>
</members>
<constants>
</constants>
</class>