0 votes
by (140 points)

Twine 2.2.1

Sugarcube 2.28.1

Is there a way to make the Dialog API produce a modal dialog - where it must be dismissed before the background can be interacted with?

The example I have seen

isn't modal - in it  allows the user to click on the background and interact with the passage contents without explicitly dismissing the "modal" dialog.



2 Answers

0 votes
by (63.1k points)
Clicking outside the modal dismisses it, which is fairly common practice. You can't actually interact with the passage though, so I'm not sure where you got that.
0 votes
by (44.7k points)

That example uses an <iframe> element to display the example Twine story, which is why you can click on elements outside the <iframe> even when the modal dialog is displayed.  When the Twine story is the whole window, then the modal dialog will actually be modal.  See this Alert and Dialog sample code here (you can click "Jump to Start" in the UI bar to see other sample code there as well).

Enjoy!  :-)