Published
- 1 min read
sfml local mouse position
The solution for this is noted below
sfml local mouse position
Solution
// get the current mouse position in the window
sf::Vector2i pixelPos = sf::Mouse::getPosition(window);
// convert it to world coordinates
sf::Vector2f worldPos = window.mapPixelToCoords(pixelPos);
Try other methods by searching on the site. That is if this doesn’t work