|
@@ -54,6 +54,7 @@ void Example::_bind_methods() {
|
|
|
ClassDB::bind_method(D_METHOD("return_something_const"), &Example::return_something_const);
|
|
|
ClassDB::bind_method(D_METHOD("return_extended_ref"), &Example::return_extended_ref);
|
|
|
ClassDB::bind_method(D_METHOD("extended_ref_checks"), &Example::extended_ref_checks);
|
|
|
+ ClassDB::bind_method(D_METHOD("test_array"), &Example::test_array);
|
|
|
|
|
|
{
|
|
|
MethodInfo mi;
|
|
@@ -81,6 +82,14 @@ void Example::_bind_methods() {
|
|
|
BIND_CONSTANT(CONSTANT_WITHOUT_ENUM);
|
|
|
}
|
|
|
|
|
|
+Example::Example() {
|
|
|
+ UtilityFunctions::print("Constructor.");
|
|
|
+}
|
|
|
+
|
|
|
+Example::~Example() {
|
|
|
+ UtilityFunctions::print("Destructor.");
|
|
|
+}
|
|
|
+
|
|
|
// Methods.
|
|
|
void Example::simple_func() {
|
|
|
UtilityFunctions::print("Simple func called.");
|
|
@@ -126,6 +135,16 @@ void Example::emit_custom_signal(const String &name, int value) {
|
|
|
emit_signal("custom_signal", name, value);
|
|
|
}
|
|
|
|
|
|
+Array Example::test_array() const {
|
|
|
+ Array arr;
|
|
|
+
|
|
|
+ arr.resize(2);
|
|
|
+ arr[0] = Variant(1);
|
|
|
+ arr[1] = Variant(2);
|
|
|
+
|
|
|
+ return arr;
|
|
|
+}
|
|
|
+
|
|
|
// Properties.
|
|
|
void Example::set_custom_position(const Vector2 &pos) {
|
|
|
custom_position = pos;
|