0 votes
by (140 points)
I am using sugarcube and i would like to make a help button to go to a passage in the bar on the left but i dont know how

2 Answers

0 votes
by (159k points)

You can use StoryMenu special passage to add links (which will look like buttons) to the Menu area of the Left Side-bar. If your project doesn't have such a passage yet then simply use the green + Passage button to add a new passage to your project and give it a name of StoryMenu (letter case is important!)

You can then add either a Markup based Link or a Macro based Link to this passage.

[[Help]]


note: You can use the related StoryCaption special passage to add non-menu related content to the Left Side-bar.

+1 vote
by (68.6k points)

In short.  The same way you'd do so normally.

In long.  It depends on where/how you're attempting to place this button and if you mean an actual button or not.

If you intend to use the StoryMenu special passage, which displays links within the UI bar that are styled to look like the default buttons, then you may simply use the normal link markup or the <<link>> macro.  For example:

[[The text|passage name]]

<<link [[The text|passage name]]>>
	/* Any code you need run when it's clicked. */
<</link>>

If you intend to use one of the other special passages that display within the UI bar—e.g. the StoryCaption special passage—then you may use the normal link markup, the <<link>> macro, or the <<button>> macro, if you needed a real button.  For example: (only showing <<button>> here, the other two are unchanged from the above example)

<<button [[The text|passage name]]>>
	/* Any code you need run when it's clicked. */
<</button>>

 

...