I have a problem related to the position and size of objects within a scrolling frame.
How do I fix it?
Studio
InGame
My localscript:
for i, Frame in pairs(SettingsFrame.SettingsBackg.ScrollingFrame:GetChildren()) do
if Frame:IsA("Frame") then Frame:Destroy() end
end
for iterator, set in pairs(SettingsModule) do
print(iterator,set)
local SettingHandler = script.SettingHandler:Clone() SettingHandler.Name = tostring(iterator) SettingHandler.Parent = SettingsFrame.SettingsBackg.ScrollingFrame
SettingHandler.DesignedToText.Text = iterator
SettingHandler.Description.Text = set.Description
SettingHandler.LayoutOrder = set.LayoutOrder
if SettingsModule[SettingHandler.Name].Enabled == true then
SettingHandler.OnOff.BackgroundColor3 = ON_Color
SettingHandler.OnOff.Text = "On"
else
SettingHandler.OnOff.BackgroundColor3 = OFF_Color
SettingHandler.OnOff.Text = "Off"
end
SettingHandler.OnOff.MouseButton1Click:Connect(function()
SettingsModule[SettingHandler.Name].Enabled = not SettingsModule[SettingHandler.Name].Enabled
print(SettingsModule[SettingHandler.Name].Enabled)
if SettingsModule[SettingHandler.Name].Enabled == true then
SettingHandler.OnOff.BackgroundColor3 = ON_Color
SettingHandler.OnOff.Text = "On"
else
SettingHandler.OnOff.BackgroundColor3 = OFF_Color
SettingHandler.OnOff.Text = "Off"
end
print(SettingHandler.Name)
ToSendFunction = SettingHandler.Name
if ToSendFunction ~= nil then
HandlerModuleSettings[SettingsModule[SettingHandler.Name].funcName](LocalPlayer,ToSendFunction)
ToSendFunction = nil
end
end)
SettingsFrame.SettingsBackg.ScrollingFrame.CanvasSize = UDim2.new(0,0,0,SettingsFrame.SettingsBackg.ScrollingFrame.UIGridLayout.AbsoluteContentSize.Y)