|
@@ -228,7 +228,7 @@ library and communicates back to the engine what objects we make available.
|
|
godot_instance_destroy_func destroy = { NULL, NULL, NULL };
|
|
godot_instance_destroy_func destroy = { NULL, NULL, NULL };
|
|
destroy.destroy_func = &simple_destructor;
|
|
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);
|
|
create, destroy);
|
|
|
|
|
|
godot_instance_method get_data = { NULL, NULL, NULL };
|
|
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 };
|
|
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);
|
|
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
|
|
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.
|
|
:ref:`NativeScript <class_NativeScript>` resource file with ``.gdns`` extension.
|
|
|
|
|
|
Like done for the GDNativeLibrary resource, click the button to create a new
|
|
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
|
|
.. image:: img/nativescript_resource.png
|
|
|
|
|
|
The inspector will show a few properties that we need to fill. As *Class Name*
|
|
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
|
|
source when calling ``godot_nativescript_register_class``. We also need to
|
|
select our ``.gdnlib`` file by clicking on *Library* and selecting *Load*:
|
|
select our ``.gdnlib`` file by clicking on *Library* and selecting *Load*:
|
|
|
|
|