SFML community forums

Bindings - other languages => DotNet => Topic started by: Falke88 on September 14, 2014, 11:57:17 am

Title: Mouse.GetPosition() relative to View !
Post by: Falke88 on September 14, 2014, 11:57:17 am
Hey Guys!

I just resetted my renderwindow to a view due of fails through different desktop resolutions.

Now the view works fine - but my Mouse Position which is needed to check if it is cointained within some sprite boundaries has a "wrong" value... It still orientates through the relation to the renderwindow - which isnt the same as the sprites positions which use the view position setup I think.


My Question is now - is there an easy method to let the Mouse Position be with the View Positions? Like GetPosition(View view) or something.

If not - please give me a quick hind how to calculate it right so the Mouse Position fits with the view
Title: Re: Mouse.GetPosition() relative to View !
Post by: AlexAUT on September 14, 2014, 12:22:02 pm
This is explained in the view tutorial at http://sfml-dev.org/tutorials/2.1/graphics-view.php#coordinates-conversions


AlexAUT
Title: Re: Mouse.GetPosition() relative to View !
Post by: Falke88 on September 14, 2014, 12:33:01 pm
omg sorry just one step below the last part I've read :D