Hi,
Is there any way to highlight important words in a subtitle ?
Thanks.
Nishant
Highlighting subtitle text
Re: Highlighting subtitle text
Hi Nishant,
Yes, you can use emphasis markup tags:
Or you can use rich text:
If you use emphasis tags, on the Dialogue Manager tick Display Settings > Subtitle Settings > Rich Text Emphases. You can customize the appearance of the emphasis tags on the Dialogue Editor's Database tab.
Yes, you can use emphasis markup tags:
Code: Select all
This is [em1]IMPORTANT[/em1] text.
Code: Select all
This is <b><color=yellow>IMPORTANT</color></b> text.
Re: Highlighting subtitle text
Perfect ... just what I wanted ...
Thanks
Thanks
Re: Highlighting subtitle text
Another question regarding this. Can I somehow change the highlight color on runtime ? Thing is my UI supports many themes of different colors and I want the highlighted color to be relative to the selected theme.
Re: Highlighting subtitle text
Here are two ideas:
Option 1: Change the master database's EmphasisSettings at runtime. This is a 4-element array. For example:
One thing to note: The dialogue database is an asset file in the project. For efficiency, in playmode the Dialogue System doesn't instantiate a duplicate copy of the Initial Database assigned to the Dialogue Manager. It uses the asset directly. If you change the emphasis settings, the asset file will be changed. So make sure to initialize the emphasis settings before using them in case a previous run of the game left them with different values.
Option 2: Use [lua] or [var] markup tags. For example, say you've stored the current theme's color in a dialogue database variable named themeColor. You can use this rich text code in your Dialogue Text:
Option 1: Change the master database's EmphasisSettings at runtime. This is a 4-element array. For example:
Code: Select all
DialogueManager.MasterDatabase.emphasisSettings[0].color = Color.blue; // emphasisSettings[0] corresponds to [em1]
Option 2: Use [lua] or [var] markup tags. For example, say you've stored the current theme's color in a dialogue database variable named themeColor. You can use this rich text code in your Dialogue Text:
- Dialogue Text: "This is <color=[var=themeColor]>IMPORTANT</color> text."
- Dialogue Text: "This is <color=blue>IMPORTANT</color> text."