So here’s what I’ve got going on
I’ve got 2 frames, a textlabel and (sometimes) an imagelabel
The “file” structure is
Frame 1
Frame 2
TextLabel
ImageLabel (sometimes)
The TextLabel contains user text and the ImageLabel may sometimes be a different size
Assume we have a variable called isImage which defines whether or not the ImageLabel exists or not
When isImage is true, I want the bottom part of both frames to line up with the bottom of the ImageLabel padding
When it is not true, I want both frames to line up with the bottom of the TextLabel + padding
Oh yeah totally there is a way using AutomaticSize and SizeConstraint
Frame 1
TextLabel
ImageLabel (sometimes)
For the sake of simplicity, I’ll use this setup with just one frame (but it can easily be adjusted to more parents).
(The green outline is the UIStroke applied on Frame 1)
Where the changes on the parent frame are: AutomaticCanvasSize = Enum.AutomaticSize.XY Size = UDim2.fromScale(1, 0) AnchorPoint = Vector2.new(0.5, 0) Position = UDim2.fromScale(0.5, 0)
Where the changes on the ImageLabel are: AutomaticCanvasSize = Enum.AutomaticSize.X SizeConstraint = Enum.SizeConstraint.RelativeXX Size = UDim2.fromScale(1, 0.4) --Whatever size you want
Where the changes on the TextLabel are: AutomaticCanvasSize = Enum.AutomaticSize.X SizeConstraint = Enum.SizeConstraint.RelativeXX Size = UDim2.fromScale(1, 0.4) --Whatever size you want
Ahh so you want to add more characters into the TextLabel and thats what makes the Frame increase? Not an increase in the Size property for the TextLabel?