From 04c749a1f034c0b2256fdca0ca2675f696b490e8 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 13 Jan 2017 10:45:50 -0300 Subject: New API for visibility in both CanvasItem and Spatial visible (property) - access set_visible(bool) is_visible() is_visible_in_tree() - true when visible and parents visible show() hide() - for convenience --- scene/2d/canvas_modulate.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scene/2d/canvas_modulate.cpp') diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp index 583f03eab..138589651 100644 --- a/scene/2d/canvas_modulate.cpp +++ b/scene/2d/canvas_modulate.cpp @@ -33,7 +33,7 @@ void CanvasModulate::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_CANVAS) { - if (is_visible()) { + if (is_visible_in_tree()) { VS::get_singleton()->canvas_set_modulate(get_canvas(),color); add_to_group("_canvas_modulate_"+itos(get_canvas().get_id())); } @@ -42,13 +42,13 @@ void CanvasModulate::_notification(int p_what) { } else if (p_what==NOTIFICATION_EXIT_CANVAS) { - if (is_visible()) { + if (is_visible_in_tree()) { VS::get_singleton()->canvas_set_modulate(get_canvas(),Color(1,1,1,1)); remove_from_group("_canvas_modulate_"+itos(get_canvas().get_id())); } } else if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { - if (is_visible()) { + if (is_visible_in_tree()) { VS::get_singleton()->canvas_set_modulate(get_canvas(),color); add_to_group("_canvas_modulate_"+itos(get_canvas().get_id())); } else { @@ -83,7 +83,7 @@ Color CanvasModulate::get_color() const { String CanvasModulate::get_configuration_warning() const { - if (!is_visible() || !is_inside_tree()) + if (!is_visible_in_tree() || !is_inside_tree()) return String(); List nodes; -- cgit v1.2.3-70-g09d2