So i have this project i'm working on, and the problem is some people like to resize the window so it only takes half their screen. but, whenever the window is resized, it squashes every single element in the game. button become flattened, text becomes unreadable, and i can't seem to figure out how to tell the game to make sure it's buttons stay the same size. here's a visual.

normal:

stretched:

here's the tree structure i'm using, because i suspect it may be a factor:

now, i've tried to set a minimum size here:

but these settings don't seem to be respected, and i can't for the life of me figure out why in my google searches for some reason.

It looks like you're using the ignore stretch aspect, which causes distortion when the project window is resized to a different aspect ratio. To resolve this, set the stretch mode to 2d and stretch aspect to expand in the Project Settings. See the multiple resolutions documentation for more information.

@Calinou said: It looks like you're using the ignore stretch aspect, which causes distortion when the project window is resized to a different aspect ratio. To resolve this, set the stretch mode to 2d and stretch aspect to expand in the Project Settings. See the multiple resolutions documentation for more information.

well, sure but like, then this happens:

i'll check the documentation you sent in depth and if i can find an answer i'll provide it.

maybe reframing the question a bit can help. I have no idea how to lock an elements size. i can't create, for example, a side bar, that never has a minimum width of 250 pixels, and if it gets sized down, will actually respect that minimum width that i set. it certainly isn't the Min Size property. that doesn't seem to have that functionality. in fact i'm hard pressed to find any functionality that setting actually has.

for example:

there's no way that's 259 pixels.

okay, i believe i found the answer. it only took me weeks xP

apparently, in this kind of setup, the stretch mode should be disabled entirely. it appears that the min size property is completely overridden by the scaling mode when the window is resized. with so many panels and buttons and such, it's best to take another approach that allows more control.

you can use anchors and margins to get the elements to stick to a certain side, and then use the min size to keep things from stretching too far. i think.

apparently, in this kind of setup, the stretch mode should be disabled entirely. it appears that the min size property is completely overridden by the scaling mode when the window is resized. with so many panels and buttons and such, it's best to take another approach that allows more control.

The stretch mode does not override controls' Min Size property, but it affects the scaling of all 2D elements. At larger window sizes than the base window size, everything will appear to be larger, which means that minimum sizes will appear to be larger on screen. However, the logical minimum size remains identical to what would have been used if you used the disabled stretch mode instead.

a year later