Adding images and variables to Alert Message

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Saper
Posts: 52
Joined: Tue Jan 12, 2021 11:25 am

Adding images and variables to Alert Message

Post by Saper »

Hi

I would like to know if there is a possibility to add image to alert message in Alert Panel, for example:
- You acquired potion "x" (potion image)
- You acquired book "x" (book image)
"x" is number of acquired objects by player.
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adding images and variables to Alert Message

Post by Tony Li »

Hi,

The easy way is to use TextMesh Pro (see TextMesh Pro Support) and <sprite> tags. You can also use [var=variable] markup tags in your alert text as well as \n for newlines. For example, you show a message like this:

You now have [var=numHealthPotions] health potions.\n<sprite name="health">


Alternatively, if you don't mind some programming, you can make a subclass of StandardDialogueUI and override the ShowAlert() method to show additional UI elements such as images.
Post Reply