Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a gui a square on all screens?

I have tried using Offset but because some screens are bigger, the gui won't be in the same position either.

2 answers

✓ Accepted answer

To get a gui to be the same on all screens, and to make it square you simply need to set the X.Scale, and then set the AbsoluteSize.Y to the same as the AbsoluteSize.X


script.Parent.Size=UDim2.new(0,AbsoluteSize.X,0,AbsoluteSize.X) --This would set the Y size to the same as the X

Before using this script, make sure that the X size is already set on the gui.


Anyways, I hope this cleared things up for you a little bit. Hope I helped as well :P

2 comments

0

But if the screen gets larger in the X direction, the gui will stretch and it won't be a perfect square. Lets say my gui is (0,500,0,500) on my screen, how do I scale that up with larger screens?

0

Ah, I'm sorry I misread your question. Check back on my answer in a min, and I should have it updated.

just saying the correct script from above

script.Parent.Size=UDim2.new(0,AbsoluteSize.X,0,AbsoluteSize.X)

This discussion is preserved as it was. New answers, comments, and votes are closed.