GUI scaling problems

Hey whats up

I have been trying to make an inventory system using UI list layout and scrolling frame and I would like to adjust the canvas size of the scrolling frame depending on the number of items the player is carrying, but when I make an icon for an item the scale of the icon is based on the scrolling frame’s canvas size and the problem is that i want to be able to freely change the canvas size without changing the icon size

I tried messing around in studio but no solution found

TLDR: How do I scale a label in a scrolling GUI based on a size other than canvas size/position

Also if there are any advanced guides to roblox GUIs id appreciate if you shared them so I wouldn’t have to make stupid topics like this one

2 Likes

I use offset for the items in a Gui because it’s an easy way out, but to compensate I’ll use scale or something for container frames. I find scale doesn’t ever work for my needs, but I’m no UI Designer.

In terms of dynamically expanding the scroll bar to how many items are present in your bag, simply set the Y Offset of the CanvasSize to the Y of the UIListLayout’s AbsoluteContentSize whenever an update to the items is performed.

3 Likes

My icons need to be pretty precisely scaled so I dont think that will work unfortunately. Right now im pretty sure the only solution I have is to change the scale of the icons based on the change in the scale of the scroll frame or to scale based on the player’s screen resolution with scripts

Thanks for the help anyway

2 Likes

Maybe try using UIAspectRatioConstraints. If your button is square it will always make sure that the button remains square.

I recommend using the ‘Add Constraint’ Function from ZacBytes’ Plugin:

4 Likes

I found the solution after some messing around in studio, thanks for the plugin tho @Nova_MrRoyal im sure itll help with future UI design :slight_smile:

1 Like

Can u tell us your solution please, so future players don’t need to mess around in studio too :slight_smile:

Actually an update real quick, I wrote a script that changed the icon’s scale based on the size of the scroll frame but after using the plugin you gave earlier i can say its a more effective solution

(Although it wouldnt work as well on aspect ratios that are way different than what you set on the constraint)

1 Like