SFML community forums

Bindings - other languages => Python => Topic started by: internofdeath on August 15, 2013, 06:33:35 pm

Title: [Solved] resizing window throws off mouse coords
Post by: internofdeath on August 15, 2013, 06:33:35 pm
When I try to get the mouse coordinates local to my sf.RenderWindow using sf.Mouse.get_position(window), it behaves fine until the window is resized.
Title: Re: resizing window throws off mouse coords
Post by: G. on August 15, 2013, 07:53:54 pm
The window is resized so the view pixel doesn't correspond to real pixels anymore. (unless you also resize the view)
You have to use mapPixelToCoords (it's a RenderWindow method), take a look at the last paragraph of the view tutorial. (or the doc, if there isn't any python tutorial (I have no idea))