How to make swype for mobile in godot?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Florix
:warning: Old Version Published before Godot 3 was released.

I would like to have an object that can go only left, right, up and down. But it can have only one correct direction and i would like to move it with touch movement. How can I achieve this? Maybe like a get pos of mouse? Thanks