Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
GDNativeLibrary¶
Inherits: Resource < Reference < Object
Una biblioteca externa que contiene funciones o clases de script para usar en Godot.
Descripción¶
A GDNative library can implement NativeScripts, 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.
Tutoriales¶
../tutorials/plugins/gdnative/gdnative-c-example
../tutorials/plugins/gdnative/gdnative-cpp-example
Propiedades¶
|
||
|
||
|
||
|
Métodos¶
get_current_dependencies ( ) const |
|
get_current_library_path ( ) const |
Descripciones de Propiedades¶
ConfigFile config_file
Setter |
set_config_file(value) |
Getter |
get_config_file() |
Este recurso en formato ConfigFile de tipo INI, como en los archivos .gdnlib
.
bool load_once
Default |
|
Setter |
set_load_once(value) |
Getter |
should_load_once() |
Si true
, Godot carga sólo una copia de la biblioteca y cada script que hace referencia a la biblioteca compartirá datos estáticos como variables estáticas o globales.
Si false
, Godot carga una copia separada de la biblioteca en la memoria para cada script que hace referencia a ella.
bool reloadable
Default |
|
Setter |
set_reloadable(value) |
Getter |
is_reloadable() |
Si true
, el editor descargará temporalmente la biblioteca cada vez que el usuario se aleje de la ventana del editor, permitiendo al usuario recompilar la biblioteca sin reiniciar Godot.
Nota: Si la biblioteca define los scripts de herramientas que se ejecutan dentro del editor, recargable
debe ser false
. En caso contrario, el editor intentará descargar los scripts de la herramienta mientras están en uso y se bloqueará.
bool singleton
Default |
|
Setter |
set_singleton(value) |
Getter |
is_singleton() |
Si true
, Godot carga la biblioteca al inicio en lugar de la primera vez que un script utiliza la biblioteca, llamando a {prefix}gdnative_singleton
después de inicializar la biblioteca (donde {prefix}
es el valor de symbol_prefix). La biblioteca permanece cargada mientras Godot esté en funcionamiento.
Nota: Una biblioteca de un solo botón no puede ser reloadable.
String symbol_prefix
Default |
|
Setter |
set_symbol_prefix(value) |
Getter |
get_symbol_prefix() |
El prefijo con el que empiezan las funciones del punto de entrada de esta biblioteca. Por ejemplo, una GDNativeLibrary declararía su función gdnative_init
como godot_gdnative_init
por defecto.
En las plataformas que requieren bibliotecas de enlace estático (actualmente sólo iOS), cada biblioteca debe tener un symbol_prefix
diferente.
Descripciones de Métodos¶
PoolStringArray get_current_dependencies ( ) const
Devuelve los caminos a todas las bibliotecas de dependencia para la plataforma y la arquitectura actuales.
String get_current_library_path ( ) const
Devuelve la ruta del archivo de la biblioteca dinámica para la plataforma y la arquitectura actuales.