summaryrefslogtreecommitdiff
path: root/scene/2d/node_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/node_2d.cpp')
-rw-r--r--scene/2d/node_2d.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp
index 2a305512af..e133f86ef7 100644
--- a/scene/2d/node_2d.cpp
+++ b/scene/2d/node_2d.cpp
@@ -329,13 +329,13 @@ void Node2D::set_global_transform(const Transform2D &p_transform) {
set_transform(p_transform);
}
-void Node2D::set_z(int p_z) {
+void Node2D::set_z_index(int p_z) {
ERR_FAIL_COND(p_z < VS::CANVAS_ITEM_Z_MIN);
ERR_FAIL_COND(p_z > VS::CANVAS_ITEM_Z_MAX);
- z = p_z;
- VS::get_singleton()->canvas_item_set_z(get_canvas_item(), z);
- _change_notify("z");
+ z_index = p_z;
+ VS::get_singleton()->canvas_item_set_z_index(get_canvas_item(), z_index);
+ _change_notify("z_index");
}
void Node2D::set_z_as_relative(bool p_enabled) {
@@ -351,9 +351,9 @@ bool Node2D::is_z_relative() const {
return z_relative;
}
-int Node2D::get_z() const {
+int Node2D::get_z_index() const {
- return z;
+ return z_index;
}
Transform2D Node2D::get_relative_transform_to_parent(const Node *p_parent) const {
@@ -427,8 +427,8 @@ void Node2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("to_local", "global_point"), &Node2D::to_local);
ClassDB::bind_method(D_METHOD("to_global", "local_point"), &Node2D::to_global);
- ClassDB::bind_method(D_METHOD("set_z", "z"), &Node2D::set_z);
- ClassDB::bind_method(D_METHOD("get_z"), &Node2D::get_z);
+ ClassDB::bind_method(D_METHOD("set_z_index", "z_index"), &Node2D::set_z_index);
+ ClassDB::bind_method(D_METHOD("get_z_index"), &Node2D::get_z_index);
ClassDB::bind_method(D_METHOD("set_z_as_relative", "enable"), &Node2D::set_z_as_relative);
ClassDB::bind_method(D_METHOD("is_z_relative"), &Node2D::is_z_relative);
@@ -448,8 +448,8 @@ void Node2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_scale", PROPERTY_HINT_NONE, "", 0), "set_global_scale", "get_global_scale");
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "global_transform", PROPERTY_HINT_NONE, "", 0), "set_global_transform", "get_global_transform");
- ADD_GROUP("Z", "");
- ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "z", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z", "get_z");
+ ADD_GROUP("Z Index", "");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "z_index", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_index", "get_z_index");
ADD_PROPERTYNO(PropertyInfo(Variant::BOOL, "z_as_relative"), "set_z_as_relative", "is_z_relative");
}
@@ -458,6 +458,6 @@ Node2D::Node2D() {
angle = 0;
_scale = Vector2(1, 1);
_xform_dirty = false;
- z = 0;
+ z_index = 0;
z_relative = true;
}