I have been making a game on Android and I wanted to know how to make multiple touches on the screen. For example I created two buttons. The first is for running and the second is for jumping. I wanted to know how to run and jump at the same time because you normally cant have 2 different mouseX and mouseY positions at the same time right? I hope you understand what I mean, thank you
You can use touches. With touches.length you can get how many touches are on your display and with touches[i].x and touches[i].y you can get the position of the touch i.
Warning: touches[i] does not return a PVector. It returns a pointer (processing.event.TouchEvent.Pointer) but you can just convert it with PVector v = new PVector(touches[0].x, touches[0].y).
Here a basic program to test this: