SugarCube 2.0: UIBar and UI API
Sometimes, it can be worthwhile to change the sidebar, such as closing it or opening it for the player.
Luckily, SugarCube has existing functionality for that in <a href="http://www.motoslave.net/sugarcube/2/docs/api-uibar.html">//UIBar//</a>.
To close the //UIBar//, use {{{UIBar.stow()}}}. To open, {{{UIBar.unstow()}}}. You can even get rid of completely with {{{UIBar.destroy()}}}.
<<link "Stow that UIBar!">>
<<script>>
UIBar.stow();
<</script>>
<</link>>
[[UI API]]
Like the //UIBar// functionality, the <a href="http://www.motoslave.net/sugarcube/2/docs/api-ui.html">//UI//</a> API acts to show different things like the built-in alert or the "Saves", "Settings", "Share", and "Jump-to" dialog windows.
<<button "Open an alert!">>
<<script>>
UI.alert("An alert");
<</script>>
<</button>>
<<button "Open the 'Saves' dialog">>
<<script>>
UI.saves();
<</script>>
<</button>>
<<button "Open the 'Settings' dialog">>
<<script>>
UI.settings();
<</script>>
<</button>>
<<button "Open the 'Share' dialog">>
<<script>>
UI.share();
<</script>>
<</button>>
<<button "Open the 'Jump-to' dialog">>
<<script>>
UI.jumpto();
<</script>>
<</button>>
<a href="http://twitter.com/">Twitter</a>
<a href="http://facebook.com/">Facebook</a>