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?
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
??? 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.