summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-09-17 10:40:50 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-09-17 10:40:50 -0300
commitf304c9f93a4c0f01e884064e8e7a2f293d5486f6 (patch)
tree2e4c12834dca9ebe9c2b609bc9cbc05d8afeac3f /scene/2d
parent023dcd50f90071c1aff07d890904597704be781d (diff)
parent568be61b0985d4abb1b6ca7ffcec7f79447d3514 (diff)
Merge pull request #588 from marynate/PR-fix-touchscreenbutton-input
Fixed touchscreen was processing input in editor
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/screen_button.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp
index 92d6954d97..b606634819 100644
--- a/scene/2d/screen_button.cpp
+++ b/scene/2d/screen_button.cpp
@@ -92,7 +92,10 @@ void TouchScreenButton::_notification(int p_what) {
if (!get_scene()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility==VISIBILITY_TOUCHSCREEN_ONLY)
return;
update();
- set_process_input(true);
+
+ if (!get_scene()->is_editor_hint())
+ set_process_input(true);
+
if (action.operator String()!="" && InputMap::get_singleton()->has_action(action)) {
action_id=InputMap::get_singleton()->get_action_id(action);
} else {
@@ -170,7 +173,8 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
}
} else {
- touched=Rect2(Point2(),texture->get_size()).has_point(coord);
+ if (texture.is_valid())
+ touched=Rect2(Point2(),texture->get_size()).has_point(coord);
}