'=========================================================================== ' Subject: SINGLE PIXEL SCROLL-TEXT Date: 06-25-98 (00:00) ' Author: Matt Gulden Code: QB, QBasic, PDS ' Origin: www.thrillhaus.com/basic.html Packet: GRAPHICS.ABC '=========================================================================== ' SCRLTEXT.BAS ' by Matt Gulden (mattg@thrillhaus.com) ' http://www.thrillhaus.com/ ' A single pixel scroll-text demonstration. Not much more than that. Enjoy! ' This is public domain and may be redistributed in any form but if modified ' must be accompanied by the original version which can be grabbed from ' http://www.thrillhaus.com/source.html DEFINT A-Z DECLARE SUB DrawDumbStuff () DIM DataString(638) AS SINGLE SCREEN 13 ' Draw nice background graphics. DrawDumbStuff WHILE INKEY$ = "" ' Get a line from the DATA statements below READ TEXT$ NextPrint = 8 ' If "END" is encountered in DATA statement, start from beginning of text. IF UCASE$(TEXT$) = "END" THEN RESTORE ScrollTextStart READ TEXT$ NextPrint = 8 END IF FOR num = 1 TO LEN(TEXT$) IF NextPrint = 8 THEN BYTE$ = MID$(TEXT$, num, 1) ' If the ascii code is over 150 then the it will be colored text where ' 150 actually equals 0, 151 is 1, and so on... Feel free to change this ' it won't harm anything. IF ASC(BYTE$) > 150 THEN COLOR ASC(BYTE$) - 150 BYTE$ = MID$(TEXT$, num + 1, 1) num = num + 1 END IF LOCATE 13, 40: PRINT BYTE$; NextPrint = 0 ELSE num = num - 1 END IF GET (1, 96)-(319, 103), DataString PUT (0, 96), DataString, PSET: NextPrint = NextPrint + 1 ' Wait for vertical retrace, reduces flicker, also causes nice pause. WAIT &H3DA, 8 IF INKEY$ <> "" THEN END NEXT WEND ScrollTextStart: DATA "This is ½s¾m¿oÀoÁtÂh¥ scrolling text... " DATA "do you like it? " DATA "It's just a small, yet cool routine by me, Matt Gulden (aka Folter)... you can mail me at: " DATA "¶w·e¸b¹mºa»s¼t½e¾r¿@ÀtÁhÂrÃiÄlÅlÆhÇaÈuÉsÊ.ËcÌoÍm¥ " DATA "... and you just GOTTA check out my site! at: " DATA "¶www.thrillhaus.com¥ ... It has more high-quality sources for " DATA "Qbasic, C/C++, and soon Assembly-language... " DATA "This smooth scrolling text looks œmuch¥ better than those ugly demos " DATA "with text moving from block-to-block. " DATA "One downside to this little scroll-text routine is that I ran into a " DATA "bug that for some reason skips the last character of a DATA statement " DATA "and after trying to figure it out for quite a while, " DATA "I just gave up and put an extra space at the end of each string... That's all, and " DATA "happy coding! " DATA " —Restarting Demo...¥ " DATA "END" SUB DrawDumbStuff FOR X = 16 TO 43 LINE (X, X)-(319 - X, 199 - X), X, BF NEXT LINE (0, 94)-(319, 105), 0, BF LINE (0, 93)-(319, 106), 8, B LINE (0, 92)-(319, 107), 7, B END SUB