Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: View move when zoomed  (Read 2457 times)

0 Members and 1 Guest are viewing this topic.

Mörkö

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
View move when zoomed
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: View move when zoomed
« Reply #1 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) ?
Laurent Gomila - SFML developer

Mörkö

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: View move when zoomed
« Reply #2 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: View move when zoomed
« Reply #3 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).
Laurent Gomila - SFML developer

 

anything