aboutsummaryrefslogtreecommitdiff
path: root/scene/2d/canvas_item.cpp
diff options
context:
space:
mode:
authorromulox_x2015-11-26 13:44:06 -0800
committerromulox_x2015-11-26 13:44:06 -0800
commit0b4830f3bebaaec75cecf48253068d35bb344859 (patch)
tree3cedd3d30289913a9a6292c787c8ea9b7f3d1592 /scene/2d/canvas_item.cpp
parenta1059e3e3e54e9921c0426c8a5c9faf595175cf0 (diff)
downloadgodot-0b4830f3bebaaec75cecf48253068d35bb344859.tar.gz
godot-0b4830f3bebaaec75cecf48253068d35bb344859.tar.zst
godot-0b4830f3bebaaec75cecf48253068d35bb344859.zip
Added set_hidden method to Spatial and CanvasItem
Diffstat (limited to 'scene/2d/canvas_item.cpp')
-rw-r--r--scene/2d/canvas_item.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp
index 357aaa225..abd532c15 100644
--- a/scene/2d/canvas_item.cpp
+++ b/scene/2d/canvas_item.cpp
@@ -309,6 +309,15 @@ void CanvasItem::hide() {
_change_notify("visibility/visible");
}
+void CanvasItem::set_hidden(bool p_hidden) {
+
+ if (hidden == p_hidden) {
+ return;
+ }
+
+ _set_visible_(!p_hidden);
+}
+
Variant CanvasItem::edit_get_state() const {
@@ -1043,6 +1052,7 @@ void CanvasItem::_bind_methods() {
ObjectTypeDB::bind_method(_MD("is_hidden"),&CanvasItem::is_hidden);
ObjectTypeDB::bind_method(_MD("show"),&CanvasItem::show);
ObjectTypeDB::bind_method(_MD("hide"),&CanvasItem::hide);
+ ObjectTypeDB::bind_method(_MD("set_hidden","hidden"),&CanvasItem::set_hidden);
ObjectTypeDB::bind_method(_MD("update"),&CanvasItem::update);