Maintaining Gui Objects to always be a Square

No, I’m not using UIAspectRatioConstraint it’s basically not what I want because of these effects

It does maintain the Gui Objs as a Square but just look at it, it solves one problem and creates a new problem so no, DO NOT even mention it.


I’m asking for Tips & Tricks and Advance Gui Designers use to figure out the perfect Ratio to Maintain the Gui Obj size.


I almost pulled my head off because I resized it soo many times and it’s either too Fat or too Thin and it’s really getting on my nerves, In studio there is also a White bar at the bottom of the Screen which makes Resizing even more difficult to do.:exploding_head:

The problem is it looks perfectly fine on my Screen in studio and then when I play the game it’s either too thin or too fat again. :sob:

Please help me I’m going to be insane because of this… :crazy_face:

3 Likes

Have you tried setting the SizeConstraint Property to be RelativeXX or RelativeYY instead of the default RelativeXY.

This Post might also help you.

4 Likes

Yes I forgot to mention that it also creates a new problem…

Relative XX Effect

I don’t think I have to show you what Relative YY does.

2 Likes

RelativeXX only scales along the X Axis and RelativeYY only scales along the Y axis. And RelativeXY does both.

Make sure you’ve set it to what you want it to scale along by using the Constraint. And make sure its parent Frame/Button/Textbox isn’t affecting the size of it too too much. Because the parent does largely affect the size and scaling.

Edit: Eg. From experimenting a Square Frame set to RelativeYY will scale smaller, when its parent Frame which is set to RelativeXX is made smaller along the X Axis. Works Vice-Versa as well.

5 Likes

I read the thread and It seems like I have to choose between Relative XX or YY

I think I’ll just go for XY because even if it’s not a Square it’s so much better than having weird side effects.


If you use Offset when X is = Y however it will always be a square no matter what but the problem is I have no idea how to convert Offset to Scale.

Until someone provides a Script or Plugin, I’ll just suck it up :persevere:

I’m sure someone will figure out your problem. They always do!

2 Likes

Well, only thing you can really do is: Wait and see.

3 Likes

Speaking of offset to scale plugins, here’s this one:

I use it on a daily basis for GUI work. A good thing about it too, is it can convert from scale to offset and offset to scale. Its pretty nifty and I recommend it. :slight_smile:

1 Like

Thank you! this is indeed useful but I already have a similar plugin that can do the same.(It allows you to Drag Guis and Resize them)

I am hoping for someone to post a script that can convert Offset to Scale and Scale to Offset so that I can use it in game.

Are you looking for something like this:

Screen-Recording-2020-03-01-at-4
It resizes the GUI element but keeps it square.

Sorry for the bad video quality :wink:

It uses the size constraint of a frame to make sure it always is a square. RelativeXX works best when the X size of the screen is bigger than the Y size, and vise versa, which is why the objects get so messed up when you resize it like in this picture:


I made a script that gets the size of the user’s screen using Viewport Size, then determined whether it should use RelativeXX or Relative YY. The script I made is available here:
https://www.roblox.com/library/4746370113/GUI-Square-Size-Helper

*Note: Make sure the X size is the same as the Y size!
Screen Shot 2020-03-01 at 4.39.49 PM

Hope this helps!
LoveTheBears101

This is my first comment, so please reply if it’s unclear!

Edit:
Sorry! I meant to reply to @RuizuKun_Dev, but hit the wrong button :upside_down_face:

10 Likes