SFML community forums

Help => Window => Topic started by: furrydice on January 03, 2011, 02:03:43 pm

Title: converting from mouse coords to draw coords when using views
Post by: furrydice 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  :) ...
Title: converting from mouse coords to draw coords when using views
Post by: furrydice on January 03, 2011, 02:30:04 pm
sorry, just found the ConvertCoords method in RenderWindow....

problem solved.. :) !