SFML community forums

Help => General => Topic started by: to2g on February 09, 2015, 04:01:43 pm

Title: Window Position Bug
Post 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
Title: Re: Window Position Bug
Post by: GLS on February 09, 2015, 04:22:07 pm
this is really a bug?
may be you need to handle the resize event?
Title: AW: Window Position Bug
Post by: eXpl0it3r on February 09, 2015, 04:23:32 pm
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.
Title: Re: Window Position Bug
Post by: Laurent on February 09, 2015, 04:39:26 pm
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.
Title: Re: Window Position Bug
Post by: to2g on February 09, 2015, 04:44:59 pm
//
Title: Re: Window Position Bug
Post by: eXpl0it3r on February 09, 2015, 10:22:13 pm
It's neither minimal nor compilable.