SFML community forums

Help => General => Topic started by: Jeffrey on July 27, 2012, 09:43:37 am

Title: Square stretched in SFML 2 with Screen mode at 3/2
Post by: Jeffrey on July 27, 2012, 09:43:37 am
So I have set the screen mode to be 900 width and 600 height. Now when I define a texture of an image of 50px per 50px and I set it to be the texture of a sprite which has 50 width and 50 height I see that the rectangle is stretched: the height is less than the width. While if I set the screen to be 600x600, then it is ok. Why is that? How can I change this?
Title: Re: Square stretched in SFML 2 with Screen mode at 3/2
Post by: Nexus on July 27, 2012, 09:45:39 am
What view did you specify? Can you show a minimal and complete code?
Title: Re: Square stretched in SFML 2 with Screen mode at 3/2
Post by: Jeffrey on July 27, 2012, 09:52:21 am
The code is all messed up right now, and I have few classes so it's pretty hard to group it. But I can answer all your questions. I have set a view sf::View with default constructor and just set a center for it.
Title: Re: Square stretched in SFML 2 with Screen mode at 3/2
Post by: Jeffrey on July 27, 2012, 10:03:48 am
Solved. It was all about setting the correct width and height of the view camera.