Page 1 of 1

Display Placeholder Image When There's No Dialogue

Posted: Wed May 13, 2020 12:29 am
by dhishii
Hi,

Is it possible to enable an image on the dialogue panel when there are no conversation and disable it when the dialogue starts?

Re: Display Placeholder Image When There's No Dialogue

Posted: Wed May 13, 2020 11:38 am
by Tony Li
Hi,

Sure! Add the image to the dialogue panel and leave it enabled. Add a Dialogue System Events component to the Dialogue Manager. Configure the OnConversationStart() event to disable the image. Configure OnConversationEnd() to re-enable it.

If your dialogue UI hides the dialogue panel (that is, if the dialogue panel GameObject is assigned to the Standard Dialogue UI component's Dialogue Panel field), then you must make the image a child of the Standard Dialogue UI GameObject, not the dialogue panel.

Re: Display Placeholder Image When There's No Dialogue

Posted: Thu May 14, 2020 7:45 pm
by dhishii
Hey Tony,
That worked perfectly!
Thanks!

Re: Display Placeholder Image When There's No Dialogue

Posted: Thu May 14, 2020 7:54 pm
by Tony Li
Glad to help! :-)

Re: Display Placeholder Image When There's No Dialogue

Posted: Thu Jun 25, 2020 12:12 am
by dhishii
Hi Tony,
I had another question regarding this. I were to leave the scene and come back, the dialogue will be displayed over the placeholder image. Do you know if there is a way around this?

Re: Display Placeholder Image When There's No Dialogue

Posted: Thu Jun 25, 2020 8:48 am
by Tony Li
Hi,

That suggests that your Dialogue System Events component is on a scene object and the image is on the Dialogue Manager or another persistent object (i.e., an object that survives scene changes). If this is the case, then the Dialogue System Events' reference to the image will be lost when you change scenes. To address this, you'll need to make the image and Dialogue System Events both part of a persistent object or both not part of a persistent object. Either that, or you can write a script to reconnect the reference(s) when the scene loads.

Re: Display Placeholder Image When There's No Dialogue

Posted: Fri Jun 26, 2020 6:02 am
by dhishii
Hi Tony,

That was exactly what we needed. Thank you !

Re: Display Placeholder Image When There's No Dialogue

Posted: Fri Jun 26, 2020 10:01 am
by Tony Li
Glad to help!