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

Author Topic: RESOLVED - Resizing window without having its content stretched?  (Read 3553 times)

0 Members and 1 Guest are viewing this topic.

marCOmics

  • Newbie
  • *
  • Posts: 7
  • Gaming is fun. Game Dev even more!
    • View Profile
Hallo again SFML community,

I ran into another problem. I made a project that starts in a window where multiple mini games are displayed, from which you can choose from which to start. Depending on the the game which is selected I wanted to resize the existing window through using the .setSize(sf::Vector2()) function.
But everything gets stretched with it, is there a way to prevent this (Except opening up a whole new window and shutting the old one down)?

Thanks in advance, I hope this wasn't asked already.
« Last Edit: June 12, 2017, 10:51:07 pm by marCOmics »
2B || !2B, that is the question!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Resizing window without having its content stretched?
« Reply #1 on: June 11, 2017, 06:23:48 pm »
Quote
I hope this wasn't asked already
Almost every week ;)

And since the answer is in the official tutorials, you really have no excuse :P
https://www.sfml-dev.org/tutorials/2.4/graphics-view.php#showing-more-when-the-window-is-resized
Laurent Gomila - SFML developer

marCOmics

  • Newbie
  • *
  • Posts: 7
  • Gaming is fun. Game Dev even more!
    • View Profile
Re: Resizing window without having its content stretched?
« Reply #2 on: June 11, 2017, 09:03:14 pm »
Oh, then I'm sorry. I searched in the RendererWindow docu (https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1Window.php#ab94ea32f22d15c0df11588e319de2546) but couldn't found it, my fault..

But thanks for the quick answer!!
2B || !2B, that is the question!

 

anything