Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Display problems with sideways scrolling text

$
0
0
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.

Viewing all articles
Browse latest Browse all 1844

Trending Articles