SFML community forums

Help => Window => Topic started by: lockandstrike on January 24, 2014, 12:04:32 am

Title: [SOLVED]Resizing the Window
Post by: lockandstrike on January 24, 2014, 12:04:32 am
I am using the sf::CircleShape to create hexagons. However I want the user to be able to resize the window but when I do that the hexagons change their size. What can I do to prevent this from happen?
Title: Re: Resizing the Window
Post by: zsbzsb on January 24, 2014, 12:21:36 am
Handle the resized event and then resize your view to match the new window size  ;)
Title: Re: Resizing the Window
Post by: Lignum on January 24, 2014, 12:22:14 am
Looking at the documentation (http://www.sfml-dev.org/documentation/2.1/classsf_1_1RenderWindow.php), setSize(sf::Vector2u size) is probably what you're looking for.

EDIT: Seeing zsbzsb's post, you're most likely better off with setView.
Title: Re: Resizing the Window
Post by: lockandstrike on January 25, 2014, 03:35:17 pm
@zsbzsb Can you give me an example? I tried doing what you said and my screen just goes black.
Title: Re: Resizing the Window
Post by: zsbzsb on January 25, 2014, 06:36:52 pm
@zsbzsb Can you give me an example? I tried doing what you said and my screen just goes black.

Have you ever tried reading the tutorials?   :P

http://www.sfml-dev.org/tutorials/2.1/graphics-view.php#showing-more-when-the-window-is-resized (http://www.sfml-dev.org/tutorials/2.1/graphics-view.php#showing-more-when-the-window-is-resized)
Title: Re: Resizing the Window
Post by: lockandstrike on January 25, 2014, 07:29:45 pm
Sorry. Just never saw it. I always thought in would be in the Window Module section.

Thank you.