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

Author Topic: [SOLVED]Resizing the Window  (Read 3321 times)

0 Members and 1 Guest are viewing this topic.

lockandstrike

  • Newbie
  • *
  • Posts: 32
    • View Profile
[SOLVED]Resizing the Window
« 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?
« Last Edit: January 25, 2014, 07:30:16 pm by lockandstrike »

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Resizing the Window
« Reply #1 on: January 24, 2014, 12:21:36 am »
Handle the resized event and then resize your view to match the new window size  ;)
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Lignum

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Resizing the Window
« Reply #2 on: January 24, 2014, 12:22:14 am »
Looking at the documentation, setSize(sf::Vector2u size) is probably what you're looking for.

EDIT: Seeing zsbzsb's post, you're most likely better off with setView.

lockandstrike

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Resizing the Window
« Reply #3 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.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Resizing the Window
« Reply #4 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
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

lockandstrike

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Resizing the Window
« Reply #5 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.