Page 1 of 1

Adding images and variables to Alert Message

Posted: Mon Jul 04, 2022 10:11 am
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.

Re: Adding images and variables to Alert Message

Posted: Mon Jul 04, 2022 10:39 am
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.