Unsure of how to "attach" one UI element to another

So I’m making a new gui for my game and I came across an issue, I have no idea if it’s even possible to attach an element to another properly with UI constraints that affect the size in the direction of the frame.

All I can think of doing is making a giant frame that goes from the top right side of the screen down to the bottom right, inserting a UIListLayout and having the frames with everything go inside it. The only issue with this would be that it could be pretty messy and everything outside of the main frame, likely below it would be overlapped on smaller screens and make it harder to add anything new.

Here’s a few screenshots of the issue:


1920 x 1080 : image
It’s perfectly fine on this resolution.


1024 x 768 : image
Now on this resolution, the statistics frame is smaller which makes a bigger gap between that and the colored images below it. This is because of the UIAspectRatioConstraint.


1024 x 768 : image
When I remove the UIAspectRatioConstraint it sizes properly on the Y scale, but then causes the issue of needing the aspect ratio again or it will become stretched on some resolutions like in the image below.


TL;DR: Is there any way I can have the behavior of setting the colored buttons a parent of the statistics UI and changing the position to be below it without it actually being a parent?

Please let me know if you have any ideas on how you fixed it (if you ever had this issue) or how I could go about making the colored buttons attach properly.

Hey there,

As I UI designer I had wondered this myself a long time ago. Sadly ROBLOX has still not implemented grouping for UI elements. The best thing to do is just multi-select the elements then scale them from there. This has also been discussed here: Article

-Cap

1 Like

I’m afraid this isn’t about alpha masks, I’m trying to always keep a certain distance from the buttons to the statistics frame.

Oh sorry. Just woke up and didn’t read it fully.

Don’t know if there is.

1 Like

Your solution with a UIListLayout is probably the best way, and the correct way to do this. An alternative might be to parent the statistics panel, and buttons to a container frame which has the UIAspectRatioConstraint in it.

2 Likes