How to deal with Ref<> and how to handle real nodes with GDNative?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By byjove

Hello, the title sums up everything.

I want to instance my UI into the main level of game via an AutoLoaded class I made in C++, but when I use these code lines…

ResourceLoader* rs = ResourceLoader::get_singleton();
m_mainMenu = rs->load("path_to_file");

… I only get a Ref and nothing else. I can’t create anything. My knowledge is probably not advanced enough, but despite the multiple searches I made, I can’t find how to deal with custom nodes (or more technically, “scenes”) and instancing them via GDNative.

I also don’t understand why the ResourceLoader gives me a Ref<> object when I’m asking it to load a resource. The Godot documentaiton doesn’t seem to explain a lot of things about how nodes are handled in GDNative when they aren’t native to the engine.

Thanks in advance.