ID:2183526
 
Applies to:
Status: Open

Issue hasn't been assigned a status value.
Preserve aspect ratio X-Y of a Window when resize.



client/verb/onResize()
set hidden = 1
var/i = findtext(winget(src, "default", "size"), "x")
var/texto = winget(src, "default", "size")
winset(src, "default", "size = [text2num(copytext(texto, i+1))*1.5]x[text2num(copytext(texto, i+1))]")


I used this code to keep the "1.5"x"1" ratio of my game, although don't be fine when maximized 16:9



You know the thing I hate most about how windows programs do window management?

This.

Programs should not be telling the WM where to put their windows or trying to override the WM.

If you do this, and I load your game on my system, guess what happens? Your game fights my WM. and it looks horrible (every frame the WM sizes the window correctly, then the program sizes it "correctly"). Resize your BYOND map display and letterbox it, don't fight the WM for window sizing to enforce window aspect ratios.

If you do it right, you'll also not have issues when maximising the window on a 16:9 screen, because your game will just letterbox to 3:2.

-1 to this FR from me, we don't need more programs trying to size themselves. The user (or their config) knows what they want, let them do it.
I dunno, I don't see a problem with allowing for some snapping.
YURIRAMOS wrote:
Preserve aspect ratio X-Y of a Window when resize.



client/verb/onResize()
> set hidden = 1
> var/i = findtext(winget(src, "default", "size"), "x")
> var/texto = winget(src, "default", "size")
> winset(src, "default", "size = [text2num(copytext(texto, i+1))*1.5]x[text2num(copytext(texto, i+1))]")


I used this code to keep the "1.5"x"1" ratio of my game, although don't be fine when maximized 16:9




I think you can fix this by using the anchor setting in the Interface editor. Actually I'm 100% sure you can get the result you want by placing the elements the way you want them to look like then set all element's anchor to Auto.