diff options
| author | O01eg <o01eg@yandex.ru> | 2020-11-28 13:08:17 +0300 |
|---|---|---|
| committer | O01eg <o01eg@yandex.ru> | 2021-02-07 00:13:58 +0300 |
| commit | 279d63d6c53a40ab92a0357661b837e5232a5331 (patch) | |
| tree | 16a99e0f9f8df68f3590986a92eff65f5615ca11 /test/src/init.cpp | |
| parent | c55ef5adcfa5a608fa69e53c69ba49de495de53a (diff) | |
| download | redot-cpp-279d63d6c53a40ab92a0357661b837e5232a5331.tar.gz | |
Run script test
Diffstat (limited to 'test/src/init.cpp')
| -rw-r--r-- | test/src/init.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/src/init.cpp b/test/src/init.cpp index 47d4fda..3eedb05 100644 --- a/test/src/init.cpp +++ b/test/src/init.cpp @@ -10,7 +10,10 @@ public: SimpleClass() {} /** `_init` must exist as it is called by Godot. */ - void _init() {} + void _init() { + _name = String("SimpleClass"); + _value = 0; + } void test_void_method() { Godot::print("This is test"); @@ -30,10 +33,10 @@ public: * The line below is equivalent to the following GDScript export: * export var _name = "SimpleClass" **/ - register_property<SimpleClass, String>("base/name", &SimpleClass::_name, String("SimpleClass")); + register_property<SimpleClass, String>("name", &SimpleClass::_name, String("SimpleClass")); /** Alternatively, with getter and setter methods: */ - register_property<SimpleClass, int>("base/value", &SimpleClass::set_value, &SimpleClass::get_value, 0); + register_property<SimpleClass, int>("value", &SimpleClass::set_value, &SimpleClass::get_value, 0); /** Registering a signal: **/ register_signal<SimpleClass>("signal_name0"); // windows: error C2668: 'godot::register_signal': ambiguous call to overloaded function |
