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

Author Topic: Invert y-axis of View and rotation  (Read 1728 times)

0 Members and 1 Guest are viewing this topic.

thisismyroad

  • Newbie
  • *
  • Posts: 2
    • View Profile
Invert y-axis of View and rotation
« on: July 29, 2014, 04:09:33 pm »
Hi!

Just a quick question; is there a way to invert a View vertically (e.g. View::setSize(width, -height)) but still have the getTransform() function return a Transform that is rotated the same way it would have been when having a non-negative height value?

I know you can achieve this through using Sprites and/or VertexArrays + transformations but am just curious if this is possible with the View class. I'm currently a complete scrub when it comes to matrix math so please forgive me if I asked something incredibly stupid!

Thanks!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Invert y-axis of View and rotation
« Reply #1 on: July 29, 2014, 04:37:31 pm »
Yes you can do it with a rect(0, height, width, -height) but everything will be upside down.
Laurent Gomila - SFML developer

thisismyroad

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Invert y-axis of View and rotation
« Reply #2 on: July 29, 2014, 05:50:22 pm »
Awesome -- just what I wanted to know! Thanks very much for your time!  :D