Auto-bind virtual method overrides

This commit is contained in:
George Marques
2021-08-19 20:03:11 -03:00
committed by Bastiaan Olij
parent b3a4a2cf93
commit a0634cca3f
7 changed files with 224 additions and 273 deletions

View File

@@ -36,9 +36,6 @@ void Example::_bind_methods() {
BIND_ENUM_CONSTANT(ANSWER_TO_EVERYTHING);
BIND_CONSTANT(CONSTANT_WITHOUT_ENUM);
// Virtual function override.
BIND_VIRTUAL_METHOD(_has_point);
}
// Methods.
@@ -83,7 +80,7 @@ Vector2 Example::get_custom_position() const {
}
// Virtual function override.
bool Example::_has_point(const Vector2 &point) {
bool Example::_has_point(const Vector2 &point) const {
Label *label = get_node<Label>("Label");
label->set_text("Got point: " + Variant(point).stringify());