SFML community forums

Help => Graphics => Topic started by: Mörkö on March 06, 2016, 07:33:45 am

Title: View move when zoomed
Post by: Mörkö on March 06, 2016, 07:33:45 am
How can I make a view move the same amount regardless of zoom? For example, if I zoom out and move, the view then moves by the same amount it would by default, but I want to make it move by the greater amount relative to the zoom instead.

I hope the question is clear, otherwise I can elaborate if needed.
Title: Re: View move when zoomed
Post by: Laurent on March 06, 2016, 10:35:16 am
Quote
I want to make it move by the greater amount relative to the zoom
move(offset * zoom) ?
Title: Re: View move when zoomed
Post by: Mörkö on March 06, 2016, 10:52:31 am
Is it possible to derive this factor from sf::Window? Preferably I would not separately keep track of a separate such variable, but rather assign a zoom (in response to scroll) and calculate the factor when needed.
Title: Re: View move when zoomed
Post by: Laurent on March 06, 2016, 02:35:05 pm
The zoom is not a real thing, all it does is to change the size of the view by the given factor. So you can't get it back unless you store something (either the zoom itself, or the original size).