Okay, so for a game I'm making I want a sideways-scrolling text region like the little snippets you get at the bottom of the TV news. Basically my idea is to wrap a string inside a timed repeat and on each loop through the repeat I remove the first character of the string. Then if the string is reduced below I certain length I append new text to it. This is almost, but not quite, working correctly:
<<set _scrollstring to "THIS IS A TEST! WATCH ME SCROLL! ">>
<span id="scrollregion">_scrollstring</span>
<<silently>>
<<repeat 64ms>>
<<if _scrollstring.length lt 30>>
<<set _scrollstring to _scrollstring + "LOTS OF SCROLLIE TEXT! HOORAY! ">>
<</if>>
<<set _scrollstring to _scrollstring.substring(1)>>
<<set _dispstring to _scrollstring.substring(0,20)>>
<<replace "#scrollregion">>_dispstring<</replace>>
<</repeat>>
<</silently>>
The problem is that every so often the displayed string will briefly appear below its proper position, and in a huge font size. I can't see where in my code the font size could be modified, so I am very puzzled. Is this a bug in how Twine displays/replaces text, or am I missing something?
Thanks.
Comments
Clearly in my case escaping the exclamation mark with a backslash is not an option.
FIND: REPLACE WITH: That will replace an exclamation point in the first position with it's numeric character reference—meaning that it will display as an exclamation point, but not trigger the heading markup.
EDIT: Fixed the NCR ("&33;" ⇒ "!").