have every sentence slowly fade in after one second.

0 votes
asked Jul 15 by dionkoffie (120 points)
Hello,

 

I'm kinda new with Twine and I had a little feature in mind that would be a great feature in my story. Is it possible to have a javascript code to make each line of text slowly fade in after a second or two.

For example:

Line one

line two

line three

 

I'd like to implement this, so that the player won't be bombed with much text upon reading.

I'm not much of a proffesional with javascript. I only know basic HTML/CSS.

 

Thank you :)

2 Answers

+1 vote
answered Jul 15 by litrouke (1,610 points)

For Twine 1 or 2? Sugarcube / Harlowe / other?

If Sugarcube 2 (in either version of Twine), you can use this little guy made by Chapel or, more simply, the timed macro that's built into Sugarcube. I haven't used Harlowe, but from a quick search, it looks a little trickier but still easily doable.

0 votes
answered Jul 18 by Mr_Robot (280 points)

If you do it with harlowe, you can use the (live:[reload time]) macro. I'm bad at explaining, but here's a code exampfe of which I hope it'll help:

(live:1s)[
(set: $helloTimer to $helloTimer + 1)
(if: $helloTimer is 3 or $helloTimer > 3)[Line 1]
(if: $helloTimer is 6 or $helloTimer > 6)[Line 2]
(if: $helloTimer is 9 or $helloTimer > 9)[Line 3]
(if: $helloTimer is 21)[(stop:)]]]}

THat probably isn't the most elegant way to answer it, but it worked for me.

It doesn't fade though, it just appears.

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...