How to make a single TextLabel have two different colored texts?

Hello. It has came to my attention that some ROBLOX games have TextLabels that either have two different colored texts or I’m just seeing this wrong and there are in fact 2 different TextLabels. Here is an example of what I am talking about in the Default Chat:

Dev1
It doesn’t only appear here though. In some games I have visited which I cannot name off the top of my head also use this. Can someone please explain to me whether this is in fact One TextLabel having 2 different colored texts inside or it’s Two separate TextLabels. :face_with_monocle:

I am pretty sure its just 2 different ones. If I am wrong you can look in the source code of the module and see how it works

1 Like

You’re correct. There’s currently no way to set more than one color for a given TextLabel.

The best way would be to create an abstraction of a TextLabel that can accept different colors, and then your system can properly put many TextLabels together with various colors.

If you don’t need to worry about text wrapping, this is fairly easy to do by offsetting based on the TextBounds property.

8 Likes

This would be a great feature I’ve been wanting this to be added for a long time

2 Likes

Yeah I think there’s a few feature requests for it. Would be nice to have some general markdown support too.

1 Like