Page 1 of 1
Color Change
Posted: Sun May 25, 2025 6:37 am
by jrose1184
Hi,
Is there a feature where i can change the color of some words in a dialouge to highlight its important.
Also can i add images to the text so for instance i have a instruction of what the player needs to do i.e press B would like to swap B to a keyboard button image.
Thanks
Re: Color Change
Posted: Sun May 25, 2025 8:26 am
by Tony Li
Hi,
You can use emphasis ([em#] ... [/em#])
markup tags or
rich text tags to change color. I recommend emphasis markup tags because you can customize their appearance in the Dialogue Editor's Database > Database Properties > Emphasis Settings section. This way if you decide you want to use a different color you can change it there and the change will apply everywhere you've used the emphasis tag. If you use rich text tags, on the other hand, you'll have to manually go through each instance of the tag and update the color. (You can use the Dialogue Editor's Global Search & Replace feature, but it's still not as easy as emphasis tags.)
If you do use rich text tags for some things, I recommend using TextMesh Pro (see
TextMesh Pro Support). You can also use TextMesh Pro
<sprite> tags to include images in your dialogue text. You can use variables with the sprite tags to change which sprite to show based on the player's input device. For example, say you have two sprites: "B_button" and "E_key". You'd normally use a tag such as:
but if you use a variable you can use:
Code: Select all
<sprite name="[var=InteractInput]">
and then set the value of Variable["InteractInput"] to either "B_button" or "E_key". For example, if you do this in C# code, it might look like:
Code: Select all
DialogueLua.SetVariable("InteractInput", "E_key");
Re: Color Change
Posted: Tue May 27, 2025 5:03 am
by jrose1184
Thank you
Re: Color Change
Posted: Tue May 27, 2025 8:34 am
by Tony Li
Glad to help!