britzl / defold-input

Simplify input related operations such as gesture detection, input mapping and clicking/dragging game objects
MIT License
111 stars 26 forks source link

OnScreen: Changing analog stick position to where a user touches #37

Closed ProgrammingLife closed 6 months ago

ProgrammingLife commented 7 months ago

What's the simpliest way to change analog position to a place where a user just touched?

britzl commented 7 months ago

I recommend that you start from this example:

https://github.com/britzl/defold-input/blob/master/examples/onscreen_gui/controls.gui_script

And then modify on_input so that you move the analog stick if the input wasn't handled and then call onscreen.on_input() again.