Does anyone know if this is possible?

I’m trying to make a system that will detect when text is not in the label and if its not it will replace the last 3 visible characters with dots
Here is an example

Without System:
“Hi, my name is Billy Bill Bob the third”

With System:
“Hi my name is Billy B…”

Does anyone have ideas or services that I could use that will help me make something like this?

1 Like

TextTruncate = true in properties does this.

1 Like

I got an idea. How about every time you change the TextLabel text you can use do an if statement on
the number of characters if it’s lowered than the desired amount. Then, you can use string.sub to cut pieces of the string to put in to to text. Then, you can just do .."..."

Example:

if string.sub(1,#labelChars) >= 20 then
    local newstring = string.sub(1,#labelChars-3) --Subtract 3 for the dots
    textLabel.Text = newstring.."..."
end

Yes, however it is not customizable to your liking. You can adjust how many characters until it does the … thing and it does not work for text scaled.

??? This isn’t needed, truncating is meant only when text doesn’t fit in the GUI. There is no point in truncating the text when it fits perfectly fine in the GUI.

Obviously, scaling the text down is an alternative for truncating the text.

Plus, this is very inefficient compared to just chaning one property once.

Sorry, I tested once and I am a total failure. Not experienced in the GUI works and glad to know something.

1 Like

Omg thank you so much, I have seen TextTruncate way to many times and never thought to use them. Thank you for bring it to my attention!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.