Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to draw buttons using OpenGL I have added a Gesture Listener for the GLSurface View now i have motionevent when ever the user touches. My question is how can i convert motionevent.getx and motionevent.gety (which are in pixel range )to window or Object coordinates of the view?

share|improve this question
Screen space coordinates are represented in pixels based on the width/height resolution of the device, and are most likely returned as normalized values. I'm a little confused with what you mean by window or object coordinates. – Evan Feb 11 '13 at 19:17
thank you for your reply evan have found the answer will post it after couple of hrs as i cannt answer my own question until 8hrs passed. My question anyways was when ever i touch on GLSurfaceview i get coordinates in the form of Motionevent which give x and Y values in pixels. But i need those converted in terms of the coordinates which we pass while drawing on GLSurfaceview. – deepu Feb 11 '13 at 21:02
@deepu Mind posting your solution? – dbro Feb 3 '14 at 20:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.