I have problem with resizing my frame




my problem is that mainframe does not resize correctly to fit the option container frame
heres the script

local distance=math.abs(script.Parent.AbsolutePosition.Y-script.Parent.Parent.AbsolutePosition.Y)+script.Parent.AbsoluteSize.Y
local finale=math.abs(distance-script.Parent.Parent.AbsoluteSize.Y)
script.Parent:GetPropertyChangedSignal('Text'):Connect(function()
	script.Parent.Size=UDim2.fromOffset(script.Parent.AbsoluteSize.X,game:GetService('TextService'):GetTextSize(script.Parent.Text,script.Parent.TextSize,Enum.Font.Michroma,Vector2.new(script.Parent.AbsoluteSize.X,math.huge)).Y+10)
	script.Parent.Parent.Size=UDim2.fromOffset(script.Parent.Parent.AbsoluteSize.X,(math.abs(script.Parent.AbsolutePosition.Y-script.Parent.Parent.AbsolutePosition.Y)+script.Parent.AbsoluteSize.Y)+script.Parent.Frame.AbsoluteSize.Y)

end)
script.Parent.Text='test\n\n\n\n\n\n\n\n\n\n\test\n\n\n\ntest\n\n\ntest'
1 Like

That’s a lot of parents.

Anyway, this is a prime example of overcomplication. Can’t you just use UDim.Scale?

1 Like

Not really, because i don’t even know how can i convert offset to scale

1 Like

i guess i managed to fix the actual problem , heres the fixed code i guess

script.Parent:GetPropertyChangedSignal('Text'):Connect(function()
	script.Parent.Size=UDim2.fromOffset(script.Parent.AbsoluteSize.X,game:GetService('TextService'):GetTextSize(script.Parent.Text,script.Parent.TextSize,Enum.Font.Michroma,Vector2.new(script.Parent.AbsoluteSize.X,math.huge)).Y+10)
	script.Parent.Parent.Size=script.Parent.Parent.Frame.Size +UDim2.fromOffset(0,game:GetService('TextService'):GetTextSize(script.Parent.Text,script.Parent.TextSize,Enum.Font.Michroma,Vector2.new(script.Parent.AbsoluteSize.X,math.huge)).Y+10)
end)
script.Parent.Text='Notification\nPlayer, a valuble thing for me, what do you think about her?choose wisely from the given options '
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.