Changing text color for individual lines
Changing text color for individual lines
My question is, how to change text color for individual lines, for example making a line in red color, no matter what actor is saying it. How to add different colors to different menu options?
Re: Changing text color for individual lines
Hi,
There are two ways:
1. You can use rich text codes. Example:
2. Or you can use [em#] emphasis tags. Example:
There are two ways:
1. You can use rich text codes. Example:
- Dialogue Text: "<color=red>[Intimidate the villager.]</color>"
2. Or you can use [em#] emphasis tags. Example:
- Dialogue Text: "[em1][Intimidate the villager.][/em1["
Re: Changing text color for individual lines
Hi Tony
I discovered the emphasis tags through this post. Amazing stuff ! I was about to do something manually and it sounded like an unscalable nightmare. The emphasis tags is a much cleaner solution that's much easier to maintain.
I managed to test it on a few words within a line, however the underline box does not seem to work. Is there anything that needs to be enabled to allow underline to work with emphasis tags?
Thanks !
Dave
I discovered the emphasis tags through this post. Amazing stuff ! I was about to do something manually and it sounded like an unscalable nightmare. The emphasis tags is a much cleaner solution that's much easier to maintain.
I managed to test it on a few words within a line, however the underline box does not seem to work. Is there anything that needs to be enabled to allow underline to work with emphasis tags?
Thanks !
Dave
Re: Changing text color for individual lines
Hi Dave,
Use TextMesh Pro or Super Text Mesh. (See TextMesh Pro Support.) Unity UI Text doesn't support underline.
Use TextMesh Pro or Super Text Mesh. (See TextMesh Pro Support.) Unity UI Text doesn't support underline.
Re: Changing text color for individual lines
Hi,
We are already using TextMeshPro.
I'm attaching the Emphasis settings as well as the TestMeshPro component. Is there anything wrong I'm not seeing?
Thanks again !
Dave
We are already using TextMeshPro.
I'm attaching the Emphasis settings as well as the TestMeshPro component. Is there anything wrong I'm not seeing?
Thanks again !
Dave
- Attachments
-
- emphasis-tags-02.JPG (30.04 KiB) Viewed 2782 times
-
- emphasis-tags.JPG (20.93 KiB) Viewed 2782 times
Re: Changing text color for individual lines
Hi Dave,
Please use this patch:
DS_EmphasisTagPatch_2022-02-17.unitypackage
This is also updated in the upcoming version 2.2.26.
Please use this patch:
DS_EmphasisTagPatch_2022-02-17.unitypackage
This is also updated in the upcoming version 2.2.26.
Re: Changing text color for individual lines
Great,
I'll try that!
Dave
I'll try that!
Dave
Re: Changing text color for individual lines
Works brilliantly !
Thanks again,
Dave
Thanks again,
Dave