Similar to my <<replace>> macro, this code causes the passage text in between the
<<becomes>> tags to be replaced with what is between those and the
<<endtimedreplace>> tag, after a certain amount of time has elapsed.
<<timedinsert>> causes its text to be inserted into the page. It doesn't need a
<<becomes>> tag to function.
<<timedremove>> works in a matching fashion, removing its contained text after the time elapses.
<<timedcontinue>> is similar to
<<timedinsert>> but does not require a final
<<endtimedcontinue>> - instead, it causes all subsequent text in the passage to appear.
You can also substitute the
<<becomes>> tag with
<<gains>> to cause the next run of text to appear at the end of the previous run, without replacing it.
If you put multiple
<<gains>> tags in, the macro will make them appear as well after the same amount of time passes.
This takes CSS time values, which are decimal numbers ending in "s" (for seconds) or "ms" (for milliseconds).
<<timedreplace 2s >>You see nothing. <<becomes>>After 2 seconds, you still see nothing.<<endtimedreplace>>
<<timedreplace 2s >>You see <<gains>>a dog, <<gains>>a walrus, <<gains>>and a civet.<<endtimedreplace>>
You search. <<timedinsert 1s>>You find nothing.<<endtimedinsert>>.
<<timedremove 2.5s >>Something is disappearing... <<endtimedremove>>
Look <<timedcontinue 3s>>A bird just few by...
* If inserted text appears and descends below the bottom of the screen, the page should automatically scroll down to make it visible.
* Note: due to the way the browser and Twine interact, any changes made by code inside a <<timedreplace>> tag will be forgotten if you use the Back or Forward browser buttons, unless you use this script.
* 16/06/2013 - Updated regarding Combined Replace Macro Set.
* 26/04/2013 - Added timedcontinue.
* 05/04/2013 - Added timedinsert and timedremove, as well as downward scrolling.
* 07/03/2013 - Made the transition CSS-based.
* 01/02/2013 - Initial.
Feel free to report any bugs to @webbedspace.