Page 1 of 1

Preventing user clicking on screen during dialogue

Posted: Mon Jan 23, 2017 8:48 am
by goldo
Hi, I am trying to do something a little tricky.

I have a screen full of buttons, which I want to still show in the background during a particular dialogue.
But I do not want the player to be able to click on the screen buttons while the dialogue is playing.

To achieve this, I have covered the button screen with another screen which has some opacity and activates at the start of the dialogue (to indicate to the player that the background screen is unavailable), and I have made that screen modal.

However, because of the modal screen, it is now impossible to advance through the game. The dialogue just stays stuck at the first sentence.

I tried putting the 'say' window on a high zorder, but it doesn't help. I'm guessing the 'click-to-advance' behavior is happening on a low layer.

What would be the best way to approach this particular problem? Thanks a lot!

Re: Preventing user clicking on screen during dialogue

Posted: Mon Jan 23, 2017 11:01 am
by Ocelot
Modal screens would stop interactions with everything until you hide them. Including advancing and other screens. You could make your modal screen one pixel in size and it would still block everything

Quick fix is make screen non-modal and a single invisible button, covering whole screen, with do-nothing action.

Re: Preventing user clicking on screen during dialogue

Posted: Mon Jan 23, 2017 2:10 pm
by Imperf3kt
I'd personally use imagebuttons and place their images on screen and not make them buttons until you need them to be buttons.
No need to rely on blocking the buttons then.

Re: Preventing user clicking on screen during dialogue

Posted: Mon Jan 23, 2017 11:25 pm
by goldo
Ocelot wrote:Modal screens would stop interactions with everything until you hide them. Including advancing and other screens. You could make your modal screen one pixel in size and it would still block everything

Quick fix is make screen non-modal and a single invisible button, covering whole screen, with do-nothing action.
Thanks! I'll try that, and report.

Edit:
So I tried with an invisible button. It almost works as intended, however, advancing the story only happens when clicking outside the invisible screen. That could be confusing for players. Is there any way I could cause the invisible button to advance to the next line of conversation instead of doing nothing?

Here's an illustration of what I'm trying to achieve:
Image

PS: I am not using image buttons at all for that game, it's a design decision that would be too complex to unwind. I could also set a blocking variable and use it with an 'if' clause on each button's action, but that would add a lot of clutter to the code, because there are lots of buttons...

Re: Preventing user clicking on screen during dialogue

Posted: Wed Jan 25, 2017 12:07 am
by goldo
goldo wrote: So I tried with an invisible button. It almost works as intended, however, advancing the story only happens when clicking outside the invisible screen. That could be confusing for players. Is there any way I could cause the invisible button to advance to the next line of conversation instead of doing nothing?
I found the solution, and it was actually super easy! All I had to do was mapping the invisible button to the action 'Return()', and voila, the game advances when clicking. Thank you guys for your help.