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

Author Topic: Square stretched in SFML 2 with Screen mode at 3/2  (Read 1394 times)

0 Members and 1 Guest are viewing this topic.

Jeffrey

  • Newbie
  • *
  • Posts: 36
    • View Profile
Square stretched in SFML 2 with Screen mode at 3/2
« 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?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Square stretched in SFML 2 with Screen mode at 3/2
« Reply #1 on: July 27, 2012, 09:45:39 am »
What view did you specify? Can you show a minimal and complete code?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Jeffrey

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Square stretched in SFML 2 with Screen mode at 3/2
« Reply #2 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.

Jeffrey

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Square stretched in SFML 2 with Screen mode at 3/2
« Reply #3 on: July 27, 2012, 10:03:48 am »
Solved. It was all about setting the correct width and height of the view camera.

 

anything