virtual-joystick-android icon indicating copy to clipboard operation
virtual-joystick-android copied to clipboard

Things to consider

Open vermeshel opened this issue 6 years ago • 1 comments

I have used your library in building my controller app, and it is quite amazing. That being said, there are two things that I am uncertain about in your library.

The first is how you handle the very first touch event on the joystick. If I have selected the joystick to always be fixed to the center and I touch the joystick the first time at 320 degrees and a strength of 20, I would imagine the joystick should still read in 0, 0 because that was my first ever touch event, and should not register it as I have not yet shifted the joystick at all. However, that event is read in and processed. The reason I bring this up is if you have a dead band on the joystick so that there is no movement within a certain strength, then by touching the joystick the very first time greater than the created dead band will register the motion.

The second thing to consider is I have been trying to use the isActivated() function you have supplied, however it seems to me that it is never returning true. I assumed it would be true if I am moving the joystick around, thus activating it, but perhaps I am wrong in the interpretation of what that function returns. I am looking for a way to register when a user has touched your joystick and then also when a user has let go of the joystick.

Please let me know your thoughts, thanks!

vermeshel avatar May 10 '18 13:05 vermeshel

I handled the first issue by implementing onTouchListener (Action Down) and mIsFirstInput variable, then using that variable to just ignore the first input

Mahmoud-S-Ali avatar Jan 09 '20 16:01 Mahmoud-S-Ali