ImageLabel not properly scaling with AutomaticSize'd Frame

I’m making a ui that is supposed to scale with each thing inside of the frame, which on other occasions has worked fine, but this time this ui has a border inside of it and its acting really strange.

It’s supposed to scale with the frame but it isn’t. I’ve tried tinkering with it for a little bit but to no avail. Any ideas?

The layout looks like this with the automatic sized frames being afflictionTab and the Frame within it. The borders size is all 1 for scale with .5 for position and anchoring.

image

image

Do you have any padding in uilistlayout?
Do you scale the frames or offset them?

The padding for the listlayout is 0.01,0. And the frames are scaled other than the Y axis for the affliction frames.

So you mean you want the tabHolder to scale to it’s children?
I think you’ll have to script it because there is no built-in ui part that could do that.
Its pretty simple though, you get the absoluteContent of the UIListLayout, convert that to scaled size, and add that size to the tabHolder size udim2

local UIListContent = path.to.UIListLayout.AbsoluteContentSize.Y
local tabHolder = path.to.tabHolder
local tabParentSize = path.to.scrollingFrame.AbsoluteSize.Y

local YScale = UIListContent / tabParentSize

tabHolder.Size = udim2.new(tabHolder.Size.X.Scale,0,YScale,0)

you might need to also update the position but it should work though, if its offset then I think you can fix it by decrementing the Y Position of tabHolder by the YScale :+1:

Sorry if i worded it a little wrong but i meant the border isn’t scaling properly, the frame is scaling properly just not the border.

(BORDER, child of afflictionTab)
image
(FRAME, afflictionTab)
image

Oh, my mistake there, so I make this hickup once in a while, check if the image “type/scaling” is set to stretch or to fit? Because if its set to fit, then It’ll only fill up to the X and no longer keep filling (because X is shorter than Y axis), if its set to stretch, then it should fill up to the Y axis.

No worries, i make that mistake too sometimes lol. The border is set to stretch, i just now tried changing the types and it didn’t seem to make much of a difference.

Did you try manually stretching it out and then scaling it back down?

Ok that seemed to work. I don’t know why out of all things that would work but thanks man.

1 Like

No problem, I’m glad you’ve got it working :+1: (btw good UI, looks like an interesting game)

1 Like