Canvas Sort Order

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
NicoMozes
Posts: 24
Joined: Sun Jun 05, 2022 4:18 am

Canvas Sort Order

Post by NicoMozes »

Hi Toni,

I hope you are doing well.

I have a question about canvases and overriding UI.
My Dialogue System canvas has a priority of 10.
I have a different Canvas, lets call it Info Canvas, that has other info not relating to the Dialogue System, such as rss display and buttons. This one has a sort order of 20, so it appears above the dialogue canvas.

One of my dialogues is a tutorial dialogue, this has an Override UI component, and I would like it to have a higher sort order so it appears above all my buttons, while all the other Dialogue UIs I have, still appear under the Info Canvas.

The question is, is there a way to link the override UI to an override Sort Order? I thought about Dialogue System Events and changing the Sort Order OnConversationStart(), but perhaps there is an easier way?

Thanks in advance.
Nico
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Canvas Sort Order

Post by Tony Li »

Hi Nico,

You can put the tutorial dialogue UI in its own canvas with a higher sort order (e.g., sort order 30).

If the canvas and dialogue UI are in the scene, you can assign the dialogue UI to the Override Dialogue UI component.

If it's a prefab, you can make the canvas the top level of the prefab and assign the prefab to Override Dialogue UI.
NicoMozes
Posts: 24
Joined: Sun Jun 05, 2022 4:18 am

Re: Canvas Sort Order

Post by NicoMozes »

Worked like a charm!

Thanks Toni!
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Canvas Sort Order

Post by Tony Li »

Glad to help!
Post Reply