Page 1 of 1

Creating a button within the Dialogue UI

Posted: Tue May 05, 2015 10:57 am
by BaddyDan
I'm trying to create a button within the Dialogue UI that will open the in-game menu. When I create the button within the Dialogue UI Panel, the button will highlight, but will not detect any clicks. When it is created on a separate canvas, the button is not detected (I assume this is because the Dialogue UI Panel overlaps this button). Is there any way around this? Thanks in advance!

Creating a button within the Dialogue UI

Posted: Tue May 05, 2015 12:53 pm
by Tony Li
Hi,



Which GUI system are you using? It sounds like you're probably using the new Unity UI, so I'll suggest common Unity UI issues:



Are the canvas(es) in screen space or world space? If the canvas is world space or screen space - camera, is a camera assigned to it?

On the canvas's Graphic Raycaster, try UN-ticking Ignore Reversed Graphics. If this fixes it, your canvas may just be oriented backward.

If your canvas has a Canvas Group, tick Interactable. You may want to UN-tick Blocks Raycasts if you want clicks to pass through to lower canvases.

Check the sort order of your canvases.



If these don't help, please feel free to email an example project to tony (at) pixelcrushers.com. I'll be happy to take a look.



Creating a button within the Dialogue UI

Posted: Wed May 06, 2015 10:05 am
by BaddyDan
Hi Tony,



Thanks for your reply. To answer your question, I am using the new Unity UI to design and implement the Dialogue UI. I tried the suggestions you listed above, but to no avail. Currently, my canvases are set to screen overlay; I'm not sure if that has anything to do with my issue, but world space is not working as intended for me, either.



I will create an example project and send it to your email. Thanks in advance.

Creating a button within the Dialogue UI

Posted: Wed May 06, 2015 1:41 pm
by BaddyDan
Nevermind, for some reason after remaking the Dialogue UI, the button works. However, I do have another question. I'm trying to make the continue button fill the entire canvas. My problem lies in the fact that it will overlap the choice button template, and one will take priority over the other. If continue is behind the choice holder, I can't press it in that spot even if the choice buttons aren't up. If continue is over the choice holder, I can't press on the choices when they come up. Is there any way to set it up so that both of them work as required?

Creating a button within the Dialogue UI

Posted: Wed May 06, 2015 2:09 pm
by Tony Li
If you assign your choice holder panel to UnityUIDialogueUI > Dialogue > Response Menu > Panel, the Dialogue System will ensure that it's only active when showing the response menu.  Then make sure that the choice holder is on top of the continue button. If you can't assign the choice holder panel, add a disabled Image component to it first.







I just noticed that I forgot to do this in the example scene's dialogue UI. It doesn't make a difference in the example because the example doesn't use a continue button. But I'll assign it anyway in v1.5.1+ to provide a better model to follow.

Creating a button within the Dialogue UI

Posted: Wed May 06, 2015 7:01 pm
by BaddyDan
Oh my. I never knew it would be such a quick fix. Thank you so much! :)

Creating a button within the Dialogue UI

Posted: Thu May 07, 2015 2:11 am
by Tony Li
Happy to help!