Creating a button within the Dialogue UI

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
BaddyDan
Posts: 14
Joined: Tue May 05, 2015 2:52 pm

Creating a button within the Dialogue UI

Post 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!
User avatar
Tony Li
Posts: 21636
Joined: Thu Jul 18, 2013 1:27 pm

Creating a button within the Dialogue UI

Post 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.


BaddyDan
Posts: 14
Joined: Tue May 05, 2015 2:52 pm

Creating a button within the Dialogue UI

Post 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.
BaddyDan
Posts: 14
Joined: Tue May 05, 2015 2:52 pm

Creating a button within the Dialogue UI

Post 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?
User avatar
Tony Li
Posts: 21636
Joined: Thu Jul 18, 2013 1:27 pm

Creating a button within the Dialogue UI

Post 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.
BaddyDan
Posts: 14
Joined: Tue May 05, 2015 2:52 pm

Creating a button within the Dialogue UI

Post by BaddyDan »

Oh my. I never knew it would be such a quick fix. Thank you so much! :)
User avatar
Tony Li
Posts: 21636
Joined: Thu Jul 18, 2013 1:27 pm

Creating a button within the Dialogue UI

Post by Tony Li »

Happy to help!
Post Reply