How to get a perfect square frame?

Hello I currently have a gui which I want to be a square because I think it looks best that way. I put its size on scale so it can fit other devices.

Here my square is:
image

this is in roblox studio, however when I change the screen size my square becomes squished:
image

how would I make it so that the gui changes with the screen size but it does not stretch and bend, keeping its square shape

2 Likes

Use the AspectRatio object, it keeps your UI the same shape no matter the screen size.

3 Likes

I dont know how though,. ewfjiopgioewhjpowegopewg

It’s easy. You just add a UIAspectRatioConstraint to the parent of the object you want the aspect ratio on.

So just add the UIAspectRatioConstraint to the button as a child.

2 Likes

Adding on to what @WinnersTakesAll said, If you divide the Absolute X size by the Absolute Y size, and set the aspectratio to your result, it should scale perfectly and maintain a perfect square size on all screen sizes. I believe if you get decimals in your answer, you only need the first 2 or 3 decimal digits

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.