SFML community forums
Help => Window => Topic started 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?
-
Handle the resized event and then resize your view to match the new window size ;)
-
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.
-
@zsbzsb Can you give me an example? I tried doing what you said and my screen just goes black.
-
@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)
-
Sorry. Just never saw it. I always thought in would be in the Window Module section.
Thank you.