SFML community forums

Help => Graphics => Topic started by: thisismyroad on July 29, 2014, 04:09:33 pm

Title: Invert y-axis of View and rotation
Post by: thisismyroad 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!
Title: Re: Invert y-axis of View and rotation
Post by: Laurent 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.
Title: Re: Invert y-axis of View and rotation
Post by: thisismyroad on July 29, 2014, 05:50:22 pm
Awesome -- just what I wanted to know! Thanks very much for your time!  :D