Timeline for returning correct multiTouch id
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 25, 2012 at 0:15 | history | bounty ended | Green_qaue | ||
Sep 25, 2012 at 0:12 | vote | accept | Green_qaue | ||
Sep 25, 2012 at 23:36 | |||||
Sep 25, 2012 at 0:10 | comment | added | Green_qaue | let us continue this discussion in chat | |
Sep 25, 2012 at 0:08 | comment | added | Green_qaue |
btw, this method is called update(MotionEvent event) . In my game-loop all I call is update(null) for this method. with the class set as my GameViews onTouchListener . Does it matter that I'm not doing it like you with all dem fancy variables maybe?
|
|
Sep 25, 2012 at 0:07 | comment | added | ADB | That warning is because I was using a deprecated constant. Instead of ACTION_POINTER_ID_SHIFT it should be ACTION_POINTER_INDEX_SHIFT. I have update the answer to use the proper constant | |
Sep 25, 2012 at 0:06 | history | edited | ADB | CC BY-SA 3.0 |
modified the original poster's code
|
Sep 25, 2012 at 0:04 | comment | added | Green_qaue |
it wants me to add this line: @SuppressWarnings("deprecation") before I initiate the pid -variable. I notice your using pid in your getX() and getY() . When I do in the code from my question it dosnt work. =/ God this sucks.
|
|
Sep 24, 2012 at 23:45 | comment | added | ADB | @Max: I don't know about the warning unfortunately. Can you tell us which one it is? | |
Sep 24, 2012 at 23:44 | comment | added | ADB | @Max: the sendTouchToGameEngine is simply a call to add this event to my game engine queue to be processed during the next update. If you don't use a queue to poll your input event, you run the risk of your calling function messing with the state of the game engine in unexpected ways, since the TouchEvent comes from the UI thread and, presumably, your game engine update runs in a different thread | |
Sep 24, 2012 at 19:33 | comment | added | Green_qaue |
added updated code, as you can see I dont really know what to do with pid , and the loop is still there, wont work without it, since I need to get i .
|
|
Sep 24, 2012 at 19:26 | comment | added | Green_qaue |
also when I use this line: int pid = action >> MotionEvent.ACTION_POINTER_ID_SHIFT; eclipse tells me to add a supressWarning, is that normal? Sorry for all the questions after such a detailed answer. MotionEvent is very new to me, and cant understand the logic for some reason
|
|
Sep 24, 2012 at 18:53 | comment | added | Green_qaue |
thanks for this great answer, really clears a couple of things up. Could you just explain what this line sendTouchToGameEngine(pid, actionCode, (int)event.getX(pid), (int)event.getY(pid)); does and when u call it?
|
|
Sep 24, 2012 at 18:26 | history | answered | ADB | CC BY-SA 3.0 |