Quantcast
Channel: Twine Forum
Viewing all articles
Browse latest Browse all 3830

How to Show/Hide Text in Sugarcube v2

$
0
0
Is there a way to toggle a link macro in Sugarcube v2 to show text and then hide it?

For example, suppose I create a link called "Height" and want the player to see text describing how tall they are. When they click on the link, the text will be revealed. (Which is something I know how to do.) But how can the same link be used to hide that text?

Here is what I have so far for this endeavor:

<<link "Height">>
<<replace "#text">>Your height is about average for someone your age.<</replace>>
<</link>>: 5'10"
<span id="text"></span>

It works to reveal the text I want the player to see upon clicking the link. But I also want to give the option of hiding the same text by clicking the link again.

Thanks!

Viewing all articles
Browse latest Browse all 3830

Trending Articles