0 votes
by (710 points)

I am trying to create a passage where I randomly take strings from an array, lets say <<set $fruits to ["bananas","apples","pears]>>, where the player might see "bananas" fade in after a few seconds, "pears", after another couple of seconds, etc. The text that fades in would remain on the screen. Ideally the output would look something like this.

You are looking at fruit:



<look at vegetables> <go to deli section>   <----links

You are looking at vegetables:



<look at fruit> <go to deli section>   <----links

Could you point me to the macros I should use for creating an in-passage timer, and the macro I should use for fade (from searching for previous threads, I think I would use CSS?)

Also, I would like to be able to escape the random-string-fade-in loop by clicking on a button (which would initiate another loop from a different array of strings, or take the player to another passage ). I think I know how to create the clickable link, and how to switch arrays, so I am just including this part in the question in case it interferes/conflicts with the timer/fade.

1 Answer

+1 vote
by (44.7k points)
selected by
Best answer

You could probably use Chapel's fading macros for that.  You can find that, and other macros, at ChapelR's GitHub page.

by (710 points)
Thanks, this is just what I was looking for!