Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: converting from mouse coords to draw coords when using views  (Read 1501 times)

0 Members and 1 Guest are viewing this topic.

furrydice

  • Newbie
  • *
  • Posts: 9
    • View Profile
converting from mouse coords to draw coords when using views
« on: January 03, 2011, 02:03:43 pm »
Hi,

Wondering if anyone could help, I have an app with a board that is drawn to screen, then displayed in the app window using a view. I then want to be able to click on the screen, and calulate what part of the board was clicked on.

The view zooming/moving is working great, and I can pick up the mouse coordinates when clicking, but it is selecting the wrong part of the board. I'm guessing this is because I have to take into account the view zoom and movement values.

Could anyone tell me how to convert from the mouse click coords to the sprite coords taking into account the view settings?

Many thanks if you have some tips  :) ...

furrydice

  • Newbie
  • *
  • Posts: 9
    • View Profile
converting from mouse coords to draw coords when using views
« Reply #1 on: January 03, 2011, 02:30:04 pm »
sorry, just found the ConvertCoords method in RenderWindow....

problem solved.. :) !