OpenPanel() and UI layer/canvas
- Pendergast
- Posts: 38
- Joined: Sun Oct 18, 2020 1:48 pm
OpenPanel() and UI layer/canvas
Hi !
Lately, I've been working on the Dialogue UI for my game and I've had to try a lot of things to customize it for Dialogue System. I've been struggling a lot with sorting the UI layers.
To sort out the gameobject UI, I wanted to use the Canvas component: unfortunately, it prevented the continue button (transparent and extended over the whole screen to switch from dialog on click), so I had to move the gameobjects order. Some elements are no longer in the right panel groups, but the layer order rendering is correct.
However, when the reponse menu panel opens in game, the subtitle panel is still displayed behind the response menu panel. I don't know if this is normal.
So I wanted to use the OpenPanel() command to close my "Dialogue Panel" panel (knowing that my panel menu response is not in it) but it doesn't work cause i can't target the command OpenPanel() on the gameobject i want.
To simplify, my two questions are:
1. Is it possible to sort the order of the UI gameobjects with the Canvas component, without preventing the continue button to work?
2. Is it possible to use the OpenPanel() command to target a particular panel (example: OpenPanel(Dialog Panel,close)) ?
Thank you in advance and sorry if it is not clear, I have a little trouble to express myself in English!
Lately, I've been working on the Dialogue UI for my game and I've had to try a lot of things to customize it for Dialogue System. I've been struggling a lot with sorting the UI layers.
To sort out the gameobject UI, I wanted to use the Canvas component: unfortunately, it prevented the continue button (transparent and extended over the whole screen to switch from dialog on click), so I had to move the gameobjects order. Some elements are no longer in the right panel groups, but the layer order rendering is correct.
However, when the reponse menu panel opens in game, the subtitle panel is still displayed behind the response menu panel. I don't know if this is normal.
So I wanted to use the OpenPanel() command to close my "Dialogue Panel" panel (knowing that my panel menu response is not in it) but it doesn't work cause i can't target the command OpenPanel() on the gameobject i want.
To simplify, my two questions are:
1. Is it possible to sort the order of the UI gameobjects with the Canvas component, without preventing the continue button to work?
2. Is it possible to use the OpenPanel() command to target a particular panel (example: OpenPanel(Dialog Panel,close)) ?
Thank you in advance and sorry if it is not clear, I have a little trouble to express myself in English!
PENDERGAST / NyxNikita
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Re: OpenPanel() and UI layer/canvas
Hi,
If your continue button is inside the subtitle panel in your dialogue UI, you can move it outside of the subtitle panel.
Alternatively, you can connect the response menu panel's OnOpen() UnityEvent to the subtitle panel's StandardUISubtitlePanel.Close method, and leave the subtitle panel's Visibility at its original value.
Move the continue button below the response menu. The screenshot below is based on the VN template:Pendergast wrote: ↑Mon Oct 26, 2020 7:08 am1. Is it possible to sort the order of the UI gameobjects with the Canvas component, without preventing the continue button to work?
If your continue button is inside the subtitle panel in your dialogue UI, you can move it outside of the subtitle panel.
I don't think you will need to do this. Instead, inspect the subtitle panel. Change the Visibility dropdown to Only During Content. This will hide the subtitle panel after it shows its content. However, if you show two NPC lines in a row, it will show and hide between each lines.Pendergast wrote: ↑Mon Oct 26, 2020 7:08 am2. Is it possible to use the OpenPanel() command to target a particular panel (example: OpenPanel(Dialog Panel,close)) ?
Alternatively, you can connect the response menu panel's OnOpen() UnityEvent to the subtitle panel's StandardUISubtitlePanel.Close method, and leave the subtitle panel's Visibility at its original value.
- Pendergast
- Posts: 38
- Joined: Sun Oct 18, 2020 1:48 pm
Re: OpenPanel() and UI layer/canvas
Hi,
1. Thanks ! The button works even with the canvas component, now !
2. Like you said, for the panel show and hide between each lines of characters. How can i connect the menu panels with the OnOpen() ? I don't think i saw this command on the documentation.
1. Thanks ! The button works even with the canvas component, now !
2. Like you said, for the panel show and hide between each lines of characters. How can i connect the menu panels with the OnOpen() ? I don't think i saw this command on the documentation.
PENDERGAST / NyxNikita
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Re: OpenPanel() and UI layer/canvas
Hi,
You don't need to write any code or sequencer commands. Just hook it up in the inspector:
You don't need to write any code or sequencer commands. Just hook it up in the inspector:
- Pendergast
- Posts: 38
- Joined: Sun Oct 18, 2020 1:48 pm
Re: OpenPanel() and UI layer/canvas
Hi,
Thank you !! It worked !
Thank you !! It worked !
PENDERGAST / NyxNikita
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Re: OpenPanel() and UI layer/canvas
Happy to help!
- Pendergast
- Posts: 38
- Joined: Sun Oct 18, 2020 1:48 pm
Re: OpenPanel() and UI layer/canvas
Hi,
So, i have a big problem with the continue button.
I created a Prefab of my UI. I dropped it into the Dialogue Manager Gameobject, and tried to use the ""Add Instance" option : doing so, my continue button doesn't work now. Not even in the prefab. I don't know what to do now
So, i have a big problem with the continue button.
I created a Prefab of my UI. I dropped it into the Dialogue Manager Gameobject, and tried to use the ""Add Instance" option : doing so, my continue button doesn't work now. Not even in the prefab. I don't know what to do now
PENDERGAST / NyxNikita
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Re: OpenPanel() and UI layer/canvas
Hi,
Maybe another UI is being added to the canvas and blocking your dialogue UI?
As a test, try disabling the Instantiate Prefabs component. Then play the scene. If you can click the continue button, then one of the prefabs listed in Instantiate Prefabs is blocking.
If so, here is one way to resolve this: Create another canvas as a child of the Dialogue Manager GameObject. Set its Sort Order to -1 so it will be less than the Dialogue Manager's original Canvas. Then assign this new canvas to the Instantiate Prefabs component.
Maybe another UI is being added to the canvas and blocking your dialogue UI?
As a test, try disabling the Instantiate Prefabs component. Then play the scene. If you can click the continue button, then one of the prefabs listed in Instantiate Prefabs is blocking.
If so, here is one way to resolve this: Create another canvas as a child of the Dialogue Manager GameObject. Set its Sort Order to -1 so it will be less than the Dialogue Manager's original Canvas. Then assign this new canvas to the Instantiate Prefabs component.
- Pendergast
- Posts: 38
- Joined: Sun Oct 18, 2020 1:48 pm
Re: OpenPanel() and UI layer/canvas
Hi,
It was a bug, some of my components was gone (graphic raycast and canvas group) !
Thanks !
It was a bug, some of my components was gone (graphic raycast and canvas group) !
Thanks !
PENDERGAST / NyxNikita
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Artist & Writer
Caroline I. Letuppe
Instagram: https://instagram.com/nyxnikita
Site officiel: https://nyxnikita.com
Boutique: https://shop.nyxnikita.com
Tous mes liens: https://nyxnikita.carrd.co/
Re: OpenPanel() and UI layer/canvas
Happy to help!