It looks like you're new here. If you want to get involved, click one of these buttons!
{ (set: $look to "This is the meaning") (set: $clook to (text-style: "bold")) } <b>FIRST TRY: </b> When you click on the sentence the meaning will appear for 5 seconds and then it will go away, but with this method you cannot click again and show the meaning: [$clook[Click here to see the meaning.]]<meaning2| (click: ?meaning2)[$look (live:5000ms)[(if: $look ="This is the meaning")(replace: $look)[ ]]]
{ (set: $look to "This is the meaning") (set: $clook to (text-style: "bold")) } [$clook[Click here to see the meaning.]]<meaning2| (click: ?meaning2)[$look]
Comments
You can try using the (live:) macro. For example:
(NOTE: Always remember to include a (stop:) macro once the final hook is called so that it doesn't keep refreshing that hook.)
The hooks are only useful one time, you can't keep using them unless you use another passage and then come back to the original one. (I also wanted to use hooks multiple times, because it would make things so much easier. but hey, we can't get everything we want!)
Here's what I came up with for having text appear and disappear and then clicking again for it to repeat the process. It uses 3 passages:
In your first passage:
Then create a passage called, "MultipleClicksPassage01" and put:
Then create a passage called, "MultipleClicksPassage02" and put:
Here are two ways of doing this.
The first one is without refreshing the First Passage:
In your First Passage put:
Then create a passage called, "MeaningPassage01" and put:
Then create another passage called, "MeaningPassage02" and put:
And here is a method that refreshes the First Passage:
In your First Passage put:
Then create another passage called, "Next Passage" and put:
All these examples can be found in the attached HTML file which you play by clicking on it, and can also save on your computer and import to Twine 2 to see the code.
I hope this helps.
Example number 2 (Appearing and Disappearing text multiple clicks) is a bit buggy. After about four clicks it starts acting up (at least on Chrome). It must be due to the (live:) macro and how it all works, but since I know almost nothing about these things, I can't tell you why it behaves that way.
Example number 3 (Clicking on and off without refreshing the current passage) is probably the best example. It works smoothly, and the benefit of not refreshing the current passage is if you have any (set:) macros, etc. in a passage and you don't want them to keep resetting.
I really appreciate your help!
The following handles your first question, it consists of three parts:
1. Indicate where to show the link: 2. A Passage containing what to show when the meaning is hidden (named Meaning2-Hidden) 3. A Passage containing the meaning to be displayed when the link is clicked (named Meaning2) note: A (live:) macro will keep doing whatever you asked it to do until you either manually (stop:) it or until the the section it is attached to (ie. Passage, hook) is removed from the DOM.
Indeed. Tis' how I'm learnin! thanks @greyelf!!
@greyelf @feliwebwork