summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/demo/main.gd1
-rw-r--r--test/src/example.cpp5
-rw-r--r--test/src/example.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/test/demo/main.gd b/test/demo/main.gd
index a0c8bff..48aa686 100644
--- a/test/demo/main.gd
+++ b/test/demo/main.gd
@@ -19,6 +19,7 @@ func _ready():
prints(" returned", $Example.return_something("some string"))
prints(" returned const", $Example.return_something_const())
prints(" returned ref", $Example.return_extended_ref())
+ prints(" returned ", $Example.get_v4())
prints("VarArg method calls")
var ref = ExampleRef.new()
diff --git a/test/src/example.cpp b/test/src/example.cpp
index 68eeb2a..992f29c 100644
--- a/test/src/example.cpp
+++ b/test/src/example.cpp
@@ -101,6 +101,7 @@ void Example::_bind_methods() {
ADD_SUBGROUP("Test subgroup", "group_subgroup_");
ClassDB::bind_method(D_METHOD("get_custom_position"), &Example::get_custom_position);
+ ClassDB::bind_method(D_METHOD("get_v4"), &Example::get_v4);
ClassDB::bind_method(D_METHOD("set_custom_position", "position"), &Example::set_custom_position);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "group_subgroup_custom_position"), "set_custom_position", "get_custom_position");
@@ -205,6 +206,10 @@ Vector2 Example::get_custom_position() const {
return custom_position;
}
+Vector4 Example::get_v4() const {
+ return Vector4(1.2, 3.4, 5.6, 7.8);
+}
+
// Virtual function override.
bool Example::_has_point(const Vector2 &point) const {
Label *label = get_node<Label>("Label");
diff --git a/test/src/example.h b/test/src/example.h
index 35bc7c8..ca87f74 100644
--- a/test/src/example.h
+++ b/test/src/example.h
@@ -98,6 +98,7 @@ public:
// Property.
void set_custom_position(const Vector2 &pos);
Vector2 get_custom_position() const;
+ Vector4 get_v4() const;
// Static method.
static int test_static(int p_a, int p_b);