diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-08-05 17:55:43 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-05 17:55:43 -0300 |
commit | 435bedd9ef58817926bb0e7df9586e1d137b761b (patch) | |
tree | 59d2481db7928cb4b963686c039f1239d35c5686 | |
parent | 52649f10380d64e4d979fffe5f000b3d3609d549 (diff) | |
parent | e82270e8d05dec7d7c679455f30c3ea5d634120c (diff) |
Merge pull request #10116 from neikeq/prop_method_ambiguities
Renames properties and methods to avoid ambiguities
-rw-r--r-- | scene/2d/node_2d.cpp | 4 | ||||
-rw-r--r-- | scene/2d/node_2d.h | 2 | ||||
-rw-r--r-- | scene/gui/base_button.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 0acc85681d..82efe1d7fb 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -243,7 +243,7 @@ void Node2D::global_translate(const Vector2 &p_amount) { set_global_position(get_global_position() + p_amount); } -void Node2D::scale(const Size2 &p_amount) { +void Node2D::apply_scale(const Size2 &p_amount) { set_scale(get_scale() * p_amount); } @@ -429,7 +429,7 @@ void Node2D::_bind_methods() { ClassDB::bind_method(D_METHOD("move_local_y", "delta", "scaled"), &Node2D::move_y, DEFVAL(false)); ClassDB::bind_method(D_METHOD("translate", "offset"), &Node2D::translate); ClassDB::bind_method(D_METHOD("global_translate", "offset"), &Node2D::global_translate); - ClassDB::bind_method(D_METHOD("scale", "ratio"), &Node2D::scale); + ClassDB::bind_method(D_METHOD("apply_scale", "ratio"), &Node2D::apply_scale); ClassDB::bind_method(D_METHOD("set_global_position", "pos"), &Node2D::set_global_position); ClassDB::bind_method(D_METHOD("get_global_position"), &Node2D::get_global_position); diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h index 5b3a28d5c3..df9a05ff79 100644 --- a/scene/2d/node_2d.h +++ b/scene/2d/node_2d.h @@ -78,7 +78,7 @@ public: void move_y(float p_delta, bool p_scaled = false); void translate(const Vector2 &p_amount); void global_translate(const Vector2 &p_amount); - void scale(const Size2 &p_amount); + void apply_scale(const Size2 &p_amount); Point2 get_position() const; float get_rotation() const; diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 9a5f55698e..4d55d8df75 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -508,7 +508,7 @@ void BaseButton::_bind_methods() { ADD_SIGNAL(MethodInfo("toggled", PropertyInfo(Variant::BOOL, "pressed"))); ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "toggle_mode"), "set_toggle_mode", "is_toggle_mode"); - ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "is_pressed"), "set_pressed", "is_pressed"); + ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed"); ADD_PROPERTYNO(PropertyInfo(Variant::INT, "action_mode", PROPERTY_HINT_ENUM, "Button Press,Button Release"), "set_action_mode", "get_action_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "enabled_focus_mode", PROPERTY_HINT_ENUM, "None,Click,All"), "set_enabled_focus_mode", "get_enabled_focus_mode"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shortcut", PROPERTY_HINT_RESOURCE_TYPE, "ShortCut"), "set_shortcut", "get_shortcut"); |