Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Solved] TextLabel Text getting cut off?

Asked by 3 years ago
Edited by theking48989987 3 years ago

I have a GUI showing text of a person talking, and some of the words get cut out (trailing off the screen) for no apparent reason. I checked my code about 3000 times and I am yet to find any error.

Code:

local dialogueGui = game.StarterGui.dialogueGui
local textLabel = script.Parent

local function dialogueText(object,text)
    for i = 1,#text,1 do
        object.Text = string.sub(text,1,i)
        wait(0.025)
    end
end

local userInputService = game:GetService("UserInputService")

dialogueText(textLabel, "I am unsure of why some of the words get cut off.")

When I run the code, it shows this:

https://ibb.co/kQ7FmNM

"I am unsure of why some of the words g (the rest of "get" trails off the screen) cut off."

Thank you for your help!

0
Make sure the Scale value on the X, and Y part of the text label is set to 1, and the Offset values (both X, and Y) are set to 0. matiss112233 258 — 3y
0
I fixed it by just moving it to the left, apparently in studio it is offset to the right a little bit, but I fixed it. thank you wolffdonnaven 12 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Apparently in Studio all the GUIs are offset to the right by a little bit, because the offsets were both 0, but when I ran the game it was moved to the right. I fixed this by simply moving the GUI to the left.

Ad

Answer this question