summaryrefslogtreecommitdiff
path: root/scene/2d/touch_screen_button.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/touch_screen_button.cpp')
-rw-r--r--scene/2d/touch_screen_button.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp
index ff186b01f2..9a68c17269 100644
--- a/scene/2d/touch_screen_button.cpp
+++ b/scene/2d/touch_screen_button.cpp
@@ -134,8 +134,8 @@ void TouchScreenButton::_notification(int p_what) {
draw_set_transform_matrix(get_canvas_transform().translated(pos));
shape->draw(get_canvas_item(), draw_col);
}
-
} break;
+
case NOTIFICATION_ENTER_TREE: {
if (!Engine::get_singleton()->is_editor_hint() && !!DisplayServer::get_singleton()->screen_is_touchscreen(DisplayServer::get_singleton()->window_get_current_screen(get_viewport()->get_window_id())) && visibility == VISIBILITY_TOUCHSCREEN_ONLY) {
return;
@@ -145,13 +145,14 @@ void TouchScreenButton::_notification(int p_what) {
if (!Engine::get_singleton()->is_editor_hint()) {
set_process_input(is_visible_in_tree());
}
-
} break;
+
case NOTIFICATION_EXIT_TREE: {
if (is_pressed()) {
_release(true);
}
} break;
+
case NOTIFICATION_VISIBILITY_CHANGED: {
if (Engine::get_singleton()->is_editor_hint()) {
break;
@@ -165,6 +166,7 @@ void TouchScreenButton::_notification(int p_what) {
}
}
} break;
+
case NOTIFICATION_PAUSED: {
if (is_pressed()) {
_release();