Hello,
I'm looking to add a slim and stowable bar to the upper right portion of the screen. I feel that the information it would display would best be handled by a horizontal bar, as opposed to the UI-Bar on the left. It would need to appear in every passage (though hiding it during the game's intro would be an added bonus).
I know how to actually create the bar in HTML/CSS/JS, but I'm not sure about the proper way to add this bar using SugarCube.
I've looked through the documentation (and likely missed a well documented explanation), but I can't find anything about introducing new HTML elements. Is this something that can be done? Thank you.
Comments
1. The Javascript I use to add the HTML elements representing the right sidebar, it's toggle button, and it's body (which is the content of a StoryRightSidebar passage). 2. The CSS I use to style the components of the right sidebar (including when it is stowed), and the adjustments to the main story/passage area. This CSS is heavily based upon SugarCube 2's own Sidebar. 3. A dummy StoryRightSidebar passage.
Assign a value to $var within a normal passage (like Start) and the value should automatically appear in the right side bar.
I would of modified the above to work with your own stow-able bar but you did not supply an example. *smile*
The workaround is to replace the ES6 arrow function expression with a normal/pre-ES6 function expression.
FIND: REPLACE WITH:
Are anonymous functions going to be added at some point?
I was able to work this out due to one of Greyelf's replies in another post which I stumbled across. So cheers a bunch
and
Using this UI Bar on T1 Sugarcube2, how can you set it closed as the default?
Thanks in advance.