Is there any way in sfml version 2 that I can get objects in a graphics window to retain there relative positions and sizes when the window is resized? I have tried looking in the documentation for version 2 but with no luck.
As an example suppose the window is 800x600 and there is a line running right across the window at 3/4 of the way down (i.e at y=450). If the window is then made larger say 1280x1024 how would I keep the line in the same relative position (i.e all the way across 1280 and 3/4 of the y setting down)
Normally the view will be stretched according to the window, this implies that a line may become thicker. To avoid this whilst keeping it at a relative position, you'll need to write some code:
First resize the view to the current window size with this:
Thanks guys for your suggestions, I will try them out.
What I was toying with, at first, was to get the current window video mode height and width, then set positions of items like shapes as fractions of these figures instead of absolute numbers.
To try to explain:
Taking the hypothetical example of 800 x 600 window. If I wanted to set a starting point to 80,60 for instance, instead of typing in these numbers I could set it at (width/10, height/10) and, presumably, when resizing the window, they would stay in the proportionate place.