Fix GDNative C example

(cherry picked from commit 3635d341e2)
This commit is contained in:
skyace65
2021-05-05 21:46:43 -04:00
committed by Rémi Verschelde
parent 4a5fcf25d1
commit bfa3a21dc9
2 changed files with 4 additions and 4 deletions

View File

@@ -228,7 +228,7 @@ library and communicates back to the engine what objects we make available.
godot_instance_destroy_func destroy = { NULL, NULL, NULL };
destroy.destroy_func = &simple_destructor;
nativescript_api->godot_nativescript_register_class(p_handle, "Simple", "Reference",
nativescript_api->godot_nativescript_register_class(p_handle, "SIMPLE", "Reference",
create, destroy);
godot_instance_method get_data = { NULL, NULL, NULL };
@@ -236,7 +236,7 @@ library and communicates back to the engine what objects we make available.
godot_method_attributes attributes = { GODOT_METHOD_RPC_MODE_DISABLED };
nativescript_api->godot_nativescript_register_method(p_handle, "Simple", "get_data",
nativescript_api->godot_nativescript_register_method(p_handle, "SIMPLE", "get_data",
attributes, get_data);
}
@@ -495,7 +495,7 @@ Creating the NativeScript (``.gdns``) file
------------------------------------------
With our ``.gdnlib`` file we've told Godot how to load our library, now we need
to tell it about our "Simple" object class. We do this by creating a
to tell it about our "SIMPLE" object class. We do this by creating a
:ref:`NativeScript <class_NativeScript>` resource file with ``.gdns`` extension.
Like done for the GDNativeLibrary resource, click the button to create a new
@@ -504,7 +504,7 @@ resource in the Inspector and select ``NativeScript``:
.. image:: img/nativescript_resource.png
The inspector will show a few properties that we need to fill. As *Class Name*
we enter "Simple" which is the object class name that we declared in our C
we enter "SIMPLE" which is the object class name that we declared in our C
source when calling ``godot_nativescript_register_class``. We also need to
select our ``.gdnlib`` file by clicking on *Library* and selecting *Load*:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB