SFML community forums

Help => Window => Topic started by: nicktlloyd on April 20, 2016, 07:56:18 pm

Title: sf::Mouse::getPosition slightly off
Post by: nicktlloyd on April 20, 2016, 07:56:18 pm
I'm using:
   sf::Vector2i pixelPos = sf::Mouse::getPosition(*this);
   sf::Vector2f worldPos = this->mapPixelToCoords(pixelPos);
to get the position of mouse clicks within a world. When I draw draw things based on these coordinates, everything is drawing slightly higher than where the mouse actually was. This is consistent no matter how I change the view, it's always off by the same amount. If I resize the window, it's off in both axis' by more, consistently. I know this is somewhat vague, as the code for the window is spread out across three or four classes. I'm just wondering if there is a sample program out there that deals with window resizes so I can see what's going on. Thanks!
Title: Re: sf::Mouse::getPosition slightly off
Post by: eXpl0it3r on April 20, 2016, 08:44:00 pm
Create a minimal example and test with that instead of your work in progress.
Do you change the view?