SFML community forums
Help => General => Topic started by: to2g on February 09, 2015, 04:01:43 pm
-
I wrote a simple 2d game with collision, all works fine, but when I resize, move game window or make game fullscreen my players and enemies coordinates are changing and this is makes them out of range of my map, only in windows , on linux all worked fine
-
this is really a bug?
may be you need to handle the resize event?
-
You're not providing any significant information.
Since it's like to be a problem in your code, you shloud provide a minimal and compilable example.
-
When you resize the window, by default the contents are stretched to map the new size. Which means that the default view no longer maps to the window size, and that you must call the mapPixelToCoord / mapCoordToPixel functions whenever you need interaction between the scene and the window (mouse).
Since you give no detail about what you do on resize, how your collisions work, and what exactly happens when the problem occurs, there's nothing more we can say.
-
//
-
It's neither minimal nor compilable.