zQ86
(zQ86)
July 23, 2019, 9:38pm
1
So I’m trying to make this update log GUI which shows the latest logs via datastore functions, and there’s a table with information (multiple labels inside of a scrollingframe). I wrote a simple script to make it work correctly, but the scaling is off.
When you add more TextLabels, it stretches further.
I’ve added a TextSizeConstraint which makes it look better, but it has huge spaces inbetween.
Script:
local List = script.Parent:WaitForChild("UIListLayout")
function CanSize()
script.Parent.CanvasSize = UDim2.new(0, 0, 0, List.AbsoluteContentSize.Y)
end
script.Parent.ChildAdded:Connect(CanSize)
script.Parent.ChildRemoved:Connect(CanSize)
Is there any way I could fix this?
DevVince
(DevVince)
July 23, 2019, 9:47pm
2
This isn’t really a scripting question; however, can be scripted if you wanted it to be.
You can achieve the same outcome by simply using a UIGridLayout for the correction of this issue.
zQ86
(zQ86)
July 23, 2019, 9:49pm
3
Wrong. This is indeed a scripting question. That’s why the script is there.
Using a grid layout still gives me the same results.
The script is so I can scale the logs correctly.
More than 10 labels:
DevVince
(DevVince)
July 23, 2019, 9:52pm
4
If you use the UIGridLayout object you can simply use this to correct the gap issue.
UI.CanvasSize = UDim2.new(0,0,0,UIGridLayout.AbsoluteContentSize.Y)
It appears you’re using scale and not offset on the Y axis for the TextBox.
zQ86
(zQ86)
July 23, 2019, 9:52pm
5
That’s indeed what I did. The script is linked in the OP.
DevVince
(DevVince)
July 23, 2019, 9:59pm
6
I can’t see the background of the TextBox but if you could let me know if the size is using scale or offset it would help me understand your issue.
zQ86
(zQ86)
July 23, 2019, 10:00pm
7
I’m using offset. Please read the script if you have not already.
DevVince
(DevVince)
July 23, 2019, 10:01pm
8
Please take a moment and read what I said…
I’m referring to TextBox.
zQ86
(zQ86)
July 23, 2019, 10:03pm
9
What TextBox? I’m unsure what you’re talking about. Is this something I need? Because I’m using TextLabels.
The TextLabel is using Scale, the CanvasSize on the ScrollingFrame is using offset, to explain further.
DevVince
(DevVince)
July 23, 2019, 10:03pm
10
Yeah TextLabels, just tell me if the size is using offset or scale on the Y axis.
try using this:
script.Parent.CanvasSize = UDim2.new(0,0,math.floor(#List .Parent:GetChildren()/6),0)
1 Like
zQ86
(zQ86)
July 23, 2019, 10:05pm
12
That’s not the problem, currently. The scaling on the text is off. Please look at the images.
zQ86
(zQ86)
July 23, 2019, 10:05pm
13
^ TextLabel
Y axis for CanvasSize is offset.
DevVince
(DevVince)
July 23, 2019, 10:06pm
14
Great, change the Y to offset not scale.
zQ86
(zQ86)
July 23, 2019, 10:07pm
15
What exactly are you wanting me to do with the Y offset?
DevVince
(DevVince)
July 23, 2019, 10:08pm
16
Your text has big gaps because it’s going off Y size.
As you add more it add more overall scale, in turn the Y is scaled.
(Needs to be offset.)
1 Like
are you using UIListLayout or UIGridLayout?
zQ86
(zQ86)
July 23, 2019, 10:09pm
18
That makes more sense. Thank you for the help.
DevVince
(DevVince)
July 23, 2019, 10:09pm
19
Pretty sure they aren’t there isn’t a red explanation next to the size photo they posted.
zQ86
(zQ86)
July 23, 2019, 10:11pm
20
I am using a UIListLayout for the GUI.