Force centering if the window is too big

Got a cool idea that should be in R'n'D? Let's hear it!

Moderators: Flumminator, Zomis

Post Reply
User avatar
Eizzoux
Posts: 571
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Force centering if the window is too big

Post by Eizzoux »

I think such feature was a thing at some point before, but the thing is, my levelset is just slightly smaller than my actual resolution - 1600x900 (100% scale) levelset on a 1920x1080 screen. The idea is every time I open the game, it gets slightly dipped outside of the screen because it centers around original game's size (672x560). I think that if the window should be centered around it's own center if it's bigger, but just small enough to fit in the boundaries of windows screen.

This is how it looks every time I open it.
This is how it looks every time I open it.
asd1.png (261.83 KiB) Viewed 13457 times


This is how it looks while I drag it back into the screen border (it obviously gets fixed afterwards)
This is how it looks while I drag it back into the screen border (it obviously gets fixed afterwards)
asd2.png (200.63 KiB) Viewed 13457 times
𒈟
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Force centering if the window is too big

Post by Holger »

Indeed this was handled differently in earlier versions: When changing the window size due to custom artwork with different window viewport size, the window was closed and re-opened again, being centered on the desktop again. This had the potentially negative or unwanted side effect that if you placed the window in some corner by intention, it will move back to the center again when changing its size. So it will now just keep its current (x,y) position after resizing, which is probably (or apparently) unwanted in the case you described.

So maybe I should make the code behave more intelligently, checking if the window will partially be invisible after the resize, but would fit to the screen when changing its position, then just adjust the screen position just enough to have it fully visible again, without having the user to move the window manually.
Post Reply