#TextService issue

1 messages · Page 1 of 1 (latest)

wide coral
#

currently im making a dialouge and im so stuck at why the TextService is making it smaller than the dialouge box..

#

the issue

local function getCharBounds(char, font, textSize)
    return TextService:GetTextSize(char, textSize, font, Vector2.new(math.huge, math.huge))
end
            local size = getCharBounds(char, template.Font, template.TextSize)
            local width = size.X
            local height = size.Y

            label.Size = UDim2.new(0, width, 0, height)
            print(template.Size.Y)
#

i seriously dont know why it's doing this.

#

used to be like this, but had weird spacing.

wicked kettle
#

well first and foremost https://create.roblox.com/docs/reference/engine/classes/TextService#GetTextSize

Developers are recommended to add a pixel of padding to the result to ensure no text is cut off.
but more importantly it just looks like your inner frame isn't using 1,1 for its scale, your code looks like it auto scales the labels to fit the parent so that part seems fine

The TextService is a service internally responsible for handling the display
of text in the game.

#

so therefore the parent isn't sized correct seems the most logical cause

wide coral
#

Solved the problem, it was due to the TextSize and TextScale affecting it.

#

The TextSize was actually the one being measured, not including TextScale aswell