Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[Solved] TextLabel Text getting cut off?

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!

2 comments

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.

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

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.