keep it simple, basically i want to achieve a system that work like MaxVisibleGraphemes
did but it had a fade in/out animation on the text when the value changes
I’m assuming you mean it behaves almost exactly like the MaxVisibleGraphemes thing, but the letters fade in as they are added, rather than simple existing.
While the solution I provide may not be the best, it should function as intended.
RichText allows for per letter stylising (ensure you turn RichText on for the textlabel), including changing the transparency of text. If you use that, you may be able to achieve the fade.
For example:
local TextLabel = script.Parent
local Cycles = 8 -- Change to increase smoothness (affects time it takes per letter though)
function UpdateText(Text)
TextLabel.MaxVisibleGraphemes = 0
for index = 1, #Text do
TextLabel.MaxVisibleGraphemes = index
for cycle = 1, Cycles do -- Can't really use a tween unfortunately, as variables, such as X = 5, can not be tweened
local Transparency = 1 - (cycle / Cycles)
script.Parent.Text = string.sub(Text, 0, index-1) .. "<font transparency = \"" .. Transparency .. "\">" .. string.sub(Text, index) .. "</font>"
task.wait()
end
end
end
UpdateText("The quick brown fox jumped over the lazy dog")
The code above gives the following result:
thank you so much, i’ve think like this but doesnt know how to implement one!!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.