summaryrefslogtreecommitdiffstats
path: root/test/src/example.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/example.cpp')
-rw-r--r--test/src/example.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/src/example.cpp b/test/src/example.cpp
index 09258f4..890319d 100644
--- a/test/src/example.cpp
+++ b/test/src/example.cpp
@@ -103,6 +103,8 @@ void Example::_bind_methods() {
ClassDB::bind_method(D_METHOD("extended_ref_checks"), &Example::extended_ref_checks);
ClassDB::bind_method(D_METHOD("test_array"), &Example::test_array);
+ ClassDB::bind_method(D_METHOD("test_tarray_arg", "array"), &Example::test_tarray_arg);
+ ClassDB::bind_method(D_METHOD("test_tarray"), &Example::test_tarray);
ClassDB::bind_method(D_METHOD("test_dictionary"), &Example::test_dictionary);
ClassDB::bind_method(D_METHOD("def_args", "a", "b"), &Example::def_args, DEFVAL(100), DEFVAL(200));
@@ -223,6 +225,22 @@ Array Example::test_array() const {
return arr;
}
+void Example::test_tarray_arg(const TypedArray<int64_t> &p_array) {
+ for (int i = 0; i < p_array.size(); i++) {
+ UtilityFunctions::print(p_array[i]);
+ }
+}
+
+TypedArray<Vector2> Example::test_tarray() const {
+ TypedArray<Vector2> arr;
+
+ arr.resize(2);
+ arr[0] = Vector2(1, 2);
+ arr[1] = Vector2(2, 3);
+
+ return arr;
+}
+
Dictionary Example::test_dictionary() const {
Dictionary dict;