For Nativescript 1.1/Godot 3.1 Beta1 I can't get the following to work, p_child always ends up null:
Label *nlabel = new Label();
get_parent())->add_child(nlabel, true );
The exact error msg in 1.1/godot beta 1 is:
ERROR: add_child: Parameter ' p_child ' is null.
At: scene/main/node.cpp:1127
Saw in Label.hpp that this:
static void *operator new(size_t);
static void operator delete(void *);
was changed to:
static Label *_new();
Had the following working in Nativescript 1.0/Godot 3.0:
Label *nlabel = new Label();
((Label *)owner->get_parent())->add_child(nlabel, true );
nlabel->set_text("This is a Label node added dynamically from GDNative C++");
nlabel->set_scale(Vector2(2,2));
nlabel->set_name("myLabelAddedFromC++");
What is the correct way to declare and init a Label?
btw this is a script dropped on the sprite from the tutorial for GDNative
http://docs.godotengine.org/en/latest/tutorials/plugins/gdnative/gdnative-cpp-example.html
Any help appreciated! :)
Quote