system
November 18, 2017, 10:30am
1
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
Daniel Mircea
Old Version
Published before Godot 3 was released.
I’m working on a mobile game. I’m having a hard time telling apart taps from touch screen buttons from regular ones from the remaining screen.
Is there a way to prevent event propagation for touch events for filter them somehow?
I tried setting a custom action name on the TouchScreenButton nodes and tried to filter them with event.is_action
to no avail.
system
November 18, 2017, 10:49am
4
Reply From:
brunosxs
I’d go the easy route, creating two different states, deactivating the game logic while the ui is on… or at least deactivating key objects that could get in the way.
This won’t work because the ui is always visible.
Daniel Mircea | 2017-11-18 10:52
system
November 19, 2017, 5:25pm
5
Reply From:
MrMonk
You can set input event as “handled” so it doesn’t trigger anything else by calling
SceneTree.set_input_as_handled()
but it seems that is not working well on android… I disable input on other nodes when I detect a touch on UI.