tutorials/scripting/gdextension/gdextension_cpp_example #36
Replies: 15 comments 32 replies
-
Here is how to create Visual Studio solution to build, code and debug GDExtension |
Beta Was this translation helpful? Give feedback.
-
Quick correction... take out
|
Beta Was this translation helpful? Give feedback.
-
do i need my project to be inside GD extension for this to work? or do i have to repeat the same process in a different folder (for ex i want to have my project inside an external drive)? |
Beta Was this translation helpful? Give feedback.
-
How do I connect a signal from Godot(ex: area_entered) to my C++ source code? |
Beta Was this translation helpful? Give feedback.
-
Do I have to use the same compiler that was used to compile Godot? Or does GDExtension work with any C++ compiler? |
Beta Was this translation helpful? Give feedback.
-
Where is register_class called? It is not mentioned anywhere else in this page, except GDREGISTER_CLASS(GDExample) in register_types.cpp . |
Beta Was this translation helpful? Give feedback.
-
Running into an issue where .hpp files don't get created at all - been following the guide word for word for godot 4.3 linux and it has nothing on this at all. |
Beta Was this translation helpful? Give feedback.
-
What's the proper way to extend
|
Beta Was this translation helpful? Give feedback.
-
I've gone through this tutorial step by step a few times with different versions but I keep getting this error:
versions of godot I've tried
|
Beta Was this translation helpful? Give feedback.
-
Hi, I am having problems with the properties and the signal. I fully followed the tutorial and I get no errors and the sprite is moving according to the However, none of the properties or signals added in All properties of the parent nodes are shown in the inspector, however none of the new properties show up there. This is how my void GDExample::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_amplitude"), &GDExample::get_amplitude);
ClassDB::bind_method(D_METHOD("set_amplitude", "p_amplitude"), &GDExample::set_amplitude);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "amplitude"), "set_amplitude", "get_amplitude");
ClassDB::bind_method(D_METHOD("get_speed"), &GDExample::get_speed);
ClassDB::bind_method(D_METHOD("set_speed", "p_speed"), &GDExample::set_speed);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_speed", "get_speed");
ADD_SIGNAL(MethodInfo("position_changed", PropertyInfo(Variant::OBJECT, "node"), PropertyInfo(Variant::VECTOR2, "new_pos")));
} This is the info about my system and the version
Anyone have an idea what I am missing? |
Beta Was this translation helpful? Give feedback.
-
Hi, is there a way to hot-reload newly compiled changes made to a GDExtension source file? Currently, I have to close and re-open the editor in order for the changes to be visible. (macOS, C++) |
Beta Was this translation helpful? Give feedback.
-
If you are seeing scons failures like the below, make sure you do not only have Visual Studio Preview installed. Scons seems to have issues with the preview toolchain. Just install regular, non-preview, Visual Studio toolchain.
|
Beta Was this translation helpful? Give feedback.
-
i can't find the sprite2d.hpp header. |
Beta Was this translation helpful? Give feedback.
-
I don't understand why the code to move the sprite executes in the editor and not just when the scene is running. How do I change that? |
Beta Was this translation helpful? Give feedback.
-
Could someone explain when I need to use Ref<> in gdextensions and why? I was trying to generate a mesh using surfacetool in a gdextension, and I figured through trial and error that I needed to return a Ref instead of a Mesh for it to work. But I don't understand why, and I couldn't find resources explaining that. |
Beta Was this translation helpful? Give feedback.
-
tutorials/scripting/gdextension/gdextension_cpp_example
Introduction: The C++ bindings for GDExtension are built on top of the C GDExtension API and provide a nicer way to "extend" nodes and other built-in classes in Godot using C++. This new system all...
https://docs.godotengine.org/en/latest/tutorials/scripting/gdextension/gdextension_cpp_example.html
Beta Was this translation helpful? Give feedback.
All reactions