D
D
di_gangsta2017-07-15 16:08:06
Android
di_gangsta, 2017-07-15 16:08:06

How to create a virtual joystick to move a game character?

How do experienced developers implement this? There was an idea to create a rectangular panel, the principle of which is similar to the panel for the cursor on a laptop. But in this case it is not very convenient.
Here we are talking about a dynamic button that is held down. Is it really possible to implement something like this using a regular Button, or is it better to use some other component?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Varakosov, 2017-07-16
@di_gangsta

For example, you can use any View and onTouchListener. The onTouch() event receives a MotionEvent that contains comprehensive information about the user's actions. It remains to process the data with an RF filter, calculate the vector and use it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question