Printing Text After a Paragraph on Word Click

Twine Version: 2
[also choose a Story Format tag above]

Hey there! Probably a softball question, but I’m looking for a way to reveal/print text after what’s already been printed on click of a word in the already revealed paragraph.

For example:
You see a cup on the table.
(click the word cup)
(then this text is printed below what already exists in the passage:)
What a handsome cup.

Thank you for your help!

Welcome Dave.

If you need only one instance of this in your passage, you can use the replace macro.

It then would like something lihe

You see a <<link "cup">><<replace "#textbottom">>What a handsome cup.<</replace>><</link>> on the table.
<span id="textbottom"></span>

However if there’s more than one such instance in the passage it might prove a little less easy.

1 Like

you can use multiple replaces, you just need more html <span> or <div> elements to reference.

thank you both! <3

Though if Dave wants more than one new sentences at the end of a paragraph, it’s not so easy to have these sentences in the order the reader would have called them.

I’d be curious about fixed positions if you have any tips! But for my purposes I just need whatever paragraph is linked to that word to appear at the bottom when the word is clicked, and this solve has worked so far. Resulting order doesn’t matter too much. :slight_smile:

1 Like

you can always <<append>> to the same html element instead of replacing each time

1 Like

Indeed <<append>> is the way to go!

I know in Chapbook you can use a Reveal link to display text or an entire passage with everything inherent about it. I’ve been using it when I want the revealed text to include more links or choices.

I miss AXMA (yes, I know, “stahp old man!”) where you could just add a plus-sign in a link like [[+PassageName]] and on click it would add the passage content to the bottom of the current page instead of navigating to the new passage.

This is what happens with the <<replace>>, <<append>>, and <<prepend>> macros. Or the <<link[append/replace/prepend]>> ones. Except the latter, you have the wrap the whole sentence you want to click, as it adds before/after or replaces the link with more text. The former gives you a bit more freedom, since you can choose where you want the new text to appear.

You can even combine it with <<include>> to add a whole “passage” on the page :stuck_out_tongue:

2 Likes