Generic Touch Events with bounding box
Any way to get a bounding box or min & max x & y with touch events?
ie - if somebody touches a large portion of the screen as a single touch event it would be helpful to know the start & end of the x & y.
I'm primarily interested in the Android platform.
4 Answers
-
Yes, but it depends. Most components have touchstart, touchmove & touchend events. You would need to listen for these events and track them to do what you need.
Hope this points you in the right direction, but if not, I can help you for your situation.
-
Hi Clint,
I've tried this - but the result isn't what I'd expect it to be.
It appears the end event appears to give the top/left of the box - rather than the bottom right (assuming that x & y are pixels).Using a simple example of checking for the size of a fingerprint on the screen with meaty fingers :):
{"width":5.029895782470703,"height":4.52215576171875}
-
I do not believe you can get the size of a touch. I have done multi-touch apps on other devices and this is a very hard thing to do and its not reliable.
-
Muti-touch is another issue but I would imagine that having a bounding box would help - where the top left and bottom right would be each finger.