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

Author Topic: [SOLVED] Zoom Factor/Scale for the sf::View  (Read 2778 times)

0 Members and 1 Guest are viewing this topic.

man'O'war

  • Newbie
  • *
  • Posts: 46
  • What needs to be done is done by those capable.
    • View Profile
[SOLVED] Zoom Factor/Scale for the sf::View
« on: March 22, 2014, 11:13:03 am »
Hello.

I'm wondering if it is possible to get the current zoom factor of a sf::View.
because i'm using a mouse-drag system and i need the zoom Factor/scale to fit the movement properly.

Coriadly
Dr.Crow
« Last Edit: March 22, 2014, 02:20:50 pm by Dr.Crow »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Zoom Factor/Scale for the sf::View
« Reply #1 on: March 22, 2014, 11:16:02 am »
No, but you can easily track the factor yourself.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Zoom Factor/Scale for the sf::View
« Reply #2 on: March 22, 2014, 12:22:30 pm »
Unlike the scale of sf::Transformable objects, sf::View's zoom factor is not a separate attribute. It merely scales the view rectangle, so zoom(factors) is just a shortcut for setSize(getSize() * factors), with * being component-wise multiplication.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

man'O'war

  • Newbie
  • *
  • Posts: 46
  • What needs to be done is done by those capable.
    • View Profile
Re: Zoom Factor/Scale for the sf::View
« Reply #3 on: March 22, 2014, 02:20:24 pm »
Indeed, sounds clear now.
Thank you for your help.