Alright. The title says most of it but to clarify, gui.AbsoluteSize.Y is not returning the same value as shown in the Properties window. I want to achieve an automatic sizing container for a few frames.
I have set AutomaticSize to Y and the Size to 0 on the Y axis on all of the Frames and TextLabels in the container. If this does matter, I am creating a clone of another object, then adding a transition into the screen.
With no text in the text boxes, the size is automatically set to 97 for the container. With 2 lines, the absolute size is 115, however, the script returns 97 as if there was default text. Running a separate script after the creation of the GUI returns the valid Absolute Value.
This is the script on the client side: Note: the gui
variable is a Frame in which the clones and templates are stored.
spawn(function ()
local alert = gui["Notice Open Template"]:Clone()
alert.Name = "Notice Open Clone"
alert.Parent = gui
alert.Visible = true
alert.Container.Core.Title.Text = "Personal Message from " .. data.Player.Name
alert.Container.Core.Body.TextBox.Text = data.Content
alert.Size = UDim2.new(0, 500, 0, alert.Container.AbsoluteSize.Y)
for i,v in ipairs(gui:GetChildren()) do
if v.Name == "Notice Open Clone" then
v.LayoutOrder += 1
v.Container:TweenPosition(UDim2.new(0, 0, -(v.LayoutOrder - 1), -(v.LayoutOrder - 1) * 10), 'Out', 'Quint', 0.3, true)
end
end
alert.Size = UDim2.new(0, 500, 0, alert.Container.AbsoluteSize.Y)
end)
This is my first forum topic post, so please tell me what I should keep in mind for future posts. Thank you in advance for the help!