Sfml Local Mouse Position

[Solved] Sfml Local Mouse Position | Cpp - Code Explorer | yomemimo.com
Question : sfml local mouse position

Answered by : wout-hurxkens

// 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);

Source : https://www.sfml-dev.org/tutorials/2.5/graphics-view.php#coordinates-conversions | Last Update : Mon, 18 Jul 22

Answers related to sfml local mouse position

Code Explorer Popular Question For Cpp