UI Text Size Not Being The Same For All UI

I recently got in developing a plugin to speed up my game development for a project I am working on, and I found the UI Text Size on the Plugin isn’t the same for all UI Text Boxes.

Here is an example:
PluginExampleTest1

The UI Text Button Code:

local testButton = Instance.new("TextButton")
testButton.BorderSizePixel = 0
testButton.TextSize = 20
testButton.TextColor3 = Color3.new(1,0.2,0.4)
testButton.AnchorPoint = Vector2.new(0.5,0)
testButton.Size = UDim2.new(1,0,0.5,0)
testButton.Position = UDim2.new(0.5,0,0,0)
testButton.SizeConstraint = Enum.SizeConstraint.RelativeXY
testButton.Text = "Button1"
testButton.Parent = WindowWidget

local testButton2 = Instance.new("TextButton")
testButton2.BorderSizePixel = 0
testButton2TextSize = 20
testButton2.TextColor3 = Color3.new(1,0.2,0.4)
testButton2.AnchorPoint = Vector2.new(0.5,0.5)
testButton2.Size = UDim2.new(1,0,0.5,0)
testButton2.Position = UDim2.new(0.5,0,0.75,0)
testButton2.SizeConstraint = Enum.SizeConstraint.RelativeXY
testButton2.Text = "Button2"
testButton2.Parent = WindowWidget

I am unsure if I missed something, or if this is a bug, help will be very appreciated.

1 Like

Is the TextScaled property enabled on either textbox? This property overrides TextSize.

1 Like

Hello, there is no TextScaled property applied, this appears to only happen on UI that is done through code, where normal UI text seems to not be affected.

1 Like

My apologies, upon second glance it looks like you forgot the period between testButton2 and TextSize. Your making a variable titled “testButton2TextSize” instead so it isn’t throwing an error. Hopefully this helps!

1 Like

It’s ok, thank you, I always dislike when its these small things that I miss :grinning_face_with_smiling_eyes:
Thank you very much!

1 Like

Happens to all of us! :laughing: No worries.

1 Like