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

Author Topic: How can I resize the window by code?  (Read 1153 times)

0 Members and 1 Guest are viewing this topic.

JasonLeon

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Email
How can I resize the window by code?
« on: May 09, 2025, 07:00:14 pm »
I tried to use window.setSize, but only changed the rendering region.

Is there any way to resize the window not by restarting?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11195
    • View Profile
    • development blog
    • Email
Re: How can I resize the window by code?
« Reply #1 on: May 10, 2025, 01:14:13 am »
Handle the resize event and set the view accordingly: https://www.sfml-dev.org/tutorials/3.0/graphics/view/#using-a-view
Official FAQ: https://www.sfml-dev.org/faq/
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

JasonLeon

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Email
Re: How can I resize the window by code?
« Reply #2 on: May 10, 2025, 06:29:15 pm »
Handle the resize event and set the view accordingly: https://www.sfml-dev.org/tutorials/3.0/graphics/view/#using-a-view
Thank you. I forgot to set view. ;D