Skip to content

creating a modal save dialog

jackdarker edited this page Feb 28, 2021 · 2 revisions

Part 3

Now we are going to create a GUI to make use of the implemented functions of part 1 & 2.

See passage SaveDialog in HUD.twee.
The important thing here is that the GUI should not display like a normal passage but as modal dialog. When the GUI is opened, any other interaction with the sidepanel should be blocked.
Therefore a 'backdrop' is dynamical added above the normal panels and below the save-GUI.

The SaveDialog is by default set to hidden and will only be shown if you press Save/Load in sidepanel. Maybe it would be possible to add it dynamical to html but I found this an easy way. However, this requires the dialog to be rendered in all passages by calling <%=window.story.render("SaveDialog") %>

Clone this wiki locally