Download

Enforcing minimum width and height for resizable game window

Is there a way to enforce a minimum size for the game window when set to windowed mode?

I’ve tried calling GetSizeLimits().SetMaxWidth() and SetMaxHeight() on the SWindow of the game viewport window, but to no effect.

I’ve also tried binding to the OnViewportResized event in FViewport and then calling the resize() function with clamped values which gets the job done but produces an ugly visual stutter when resizing the window.

Any pointers?

Did you try building your project and then resize it ? Or you are doing in the editor ?

Yes, and I am able to resize the window down to I think 16 x 16 or some ridiculously small size

I found the solution. It was simply just to specify MinWindowWidth and MinWindowHeight under [/Script/EngineSettings.GeneralProjectSettings] in DefaultGame.ini

Thanks for sharing the solution! :slight_smile: