Typing text with color in RichText

I want certain parts of my text with different colors, simple enough. But, the problem is that this text is being typed letter by letter, so basically when I do:

'Today, you will be playing <font color="rgb(255,125,0)">Test</font>'

It types it out one by one until it’s complete which would turn it into the color I want. But I just want it to show the text with color, not type out the code one by one…

Example:

It types: <,f,o,n,t,c… etc, and when it’s done typing that entire color code, only then it turns orange which is kind of annoying, can someone please help

You can tween the TextLabel’s MaxVisibleGraphemes to the length of the text

4 Likes

This has the added benefit of preventing words from jumping from an end of one row to the start of the next as text wraps.

1 Like

Please mark @neweve2323’s post as the solution. But, here is the code to do what he said:

local label = path.to.TextLabel
local len = #label.ContentText
label.MaxVisibleGraphemes = 0

local showtween = game.TweenService:Create(label, TweenInfo.new(len * 0.025, Enum.EasingStyle.Linear), {MaxVisibleGraphemes = len})
-- later:
showtween:Play()
2 Likes

I don’t understand, all this does is limit the amount of text on the text label…

Edit: Nvm, I think I understand, the text should already be put in the label and all I’d do is tween the texts with what you told me

1 Like

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