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 (61.6k 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 (38.6k 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!  :-)

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...