3. you can setup a view and convert relative coordinates to your game coords ( they will always be the same on any resolution)
m_window.setView(m_view);
m_window.convertCoords( m_position );
Can anyone post a link to some sample code for SFML2 that handles different screen sizes?
My object is to create the initial craps table in a 1024 x 768 window. Rectangles within that display will define the PassLine, NoPassLine, Field, Come, Don'tCome, etc. areas. When the player mouse clicks in the PassLine rectangle, I can figure out that's where he clicked by the top-left and bottom-right corner coordinates though I haven't actually written any code yet.
But if I display the craps table at a larger resolution but in the same aspect ratio, the coordinates of the PassLine rectange will change.
Being a beginner in C++ and SFML, it sure would be infinitely helpful to see some sample code of how to handle this situation. It's not for lack of trying since I've spent many, many hours searching the web trying to figure out how to do this and for some sample SFML2 code to do this.
I could calculate the new coordinates of the PassLine rectangle myself by using ratios of the total display size, but I would like to use SFML2 provided solutions instead of reinventing the wheel.
Thanks for any help on this,
Raptor