Answer the question
In order to leave comments, you need to log in
How to properly handle touch on android?
Hello.
I recently made my first android game that uses drawing. But it still has a lot of mistakes. I'll deal with the logic myself, but I'm creating android interfaces for the first time.
Judging by the reviews, there are problems with recognizing clicks:
1) one wrote that “draws two cm higher”
2) the other wrote that it draws extra lines (I think due to false clicks)
I checked only on the emulator, and errors such did not observe.
In the application, I use my own class inherited from View, in which the processing of clicks is carried out using the overloaded onTouchEvent () method, in which I implemented the processing only: down, up, move, cancel, I receive and process only X, Y from the parameters.
What could I forget to take into account when processing clicks? I suspect that some of the problems arise due to the high CPU costs for redrawing (I figured out the redrawing) , but not all.
Link to the game The game was posted on Google Play . If you want to test, and tell me what is wrong and what can be fixed, I will be grateful. While there are too many shortcomings, I even wanted to either postpone the release for another week, or write the version number 0.99.
ps Is there an easy way to correctly handle screen rotation?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question