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

Author Topic: Window changing position  (Read 2288 times)

0 Members and 1 Guest are viewing this topic.

Munchor

  • Newbie
  • *
  • Posts: 16
    • View Profile
Window changing position
« on: January 12, 2013, 06:52:37 pm »
  window.create(sf::VideoMode(800, 640, 1), title.c_str(), sf::Style::Titlebar | sf::Style::Close);
  window.setFramerateLimit(60);
  window.setPosition(sf::Vector2i(sf::VideoMode::getDesktopMode().width / 2 - 400,
                                  sf::VideoMode::getDesktopMode().height / 2 - 320));
 

That's the code with the which I create my window. The window opens on (0, 0) and then jumps to the center of the screen.

Is there a way to make it open on the center right at the start? I don't really like the window "bouncing" position.

Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Window changing position
« Reply #1 on: January 12, 2013, 07:13:13 pm »
No, sorry.
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10820
    • View Profile
    • development blog
    • Email
Re: Window changing position
« Reply #2 on: January 12, 2013, 07:14:45 pm »
What happens if you set the position before creating the window?
If that doesn't work, then you probably can't do anything about it.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Window changing position
« Reply #3 on: January 12, 2013, 07:21:12 pm »
Doing anything before creating the window is a no-op.
Laurent Gomila - SFML developer