mouseX/mouseY and surfaceTouchEvent
in
Android Processing
•
3 years ago
The Processing for Android wiki states that I'll need super.surfaceTouchEvent() to get proper mouseX/mouseY variables.Currently, my code is reading mouseX/mouseY at the start of the mousePressed(), mouseDragged() and mouseReleased() functions. So do I essentially call super.surfaceTouchEvent in each of these? I mostly just store mouseX/mouseY until mouseReleased occurs. Here's my declaration of surfaceTouchEvent():
EDIT: Note that the touch/cursor position is working as is, without using surfaceTouchEvent.
Much thanks,
Gary
- public boolean surfaceTouchEvent(MotionEvent event) {
- float xoff = mouseX;
- float yoff = mouseY;
- return super.surfaceTouchEvent(event);
- }
EDIT: Note that the touch/cursor position is working as is, without using surfaceTouchEvent.
Much thanks,
Gary
1