'=========================================================================== ' Subject: VERTICAL SCROLLING TEXT Date: 06-25-98 (00:00) ' Author: Matt Gulden Code: QB, QBasic, PDS ' Origin: www.thrillhaus.com/basic.html Packet: GRAPHICS.ABC '=========================================================================== ' SCRLTXT3.BAS -- by Matt Gulden (mattg@thrillhaus.com) ' Found at http://www.thrillhaus.com/ ' This is the third smooth scrolling text demo, now scrolling ' vertically! Uses new scrolltext keywords; ' WAIT4KEY - stops scrolltext and suspends until key is pressed ' PAUSE n - Pauses for n seconds (type double) ' END - marks end of text (required!) ' The DATA statements need the color, then the text. ' All text is right-aligned, you can edit it though. DEFINT A-Z DECLARE SUB DrawStuff () DECLARE SUB PAL (A, R, G, B) DECLARE SUB RightAlign (y, text$) DECLARE SUB PAUSE (LENGTH#) DIM DataString(6240) AS SINGLE SCREEN 13 DrawStuff WHILE INKEY$ = "" IF NextPrint = 16 THEN READ Colour, text$ IF UCASE$(text$) = "END" THEN RESTORE ScrollTextStart READ Colour, text$ COLOR Colour RightAlign 24, text$ NextPrint = 0 ' These next two lines make the text look skinny GET (1, 184)-(319, 192), DataString PUT (0, 184), DataString, AND ELSEIF UCASE$(text$) = "WAIT4KEY" THEN WHILE INKEY$ = "": WEND NextPrint = 0 ELSEIF LEFT$(UCASE$(text$), 6) = "PAUSE " THEN PAUSE VAL(RIGHT$(text$, LEN(text$) - INSTR(text$, " "))) NextPrint = 0 ELSE COLOR Colour RightAlign 24, text$ NextPrint = 0 ' These next two lines make the text look skinny GET (1, 184)-(319, 192), DataString PUT (0, 184), DataString, AND END IF END IF NextPrint = NextPrint + 1 ' Wait for vertical retrace WAIT &H3DA, 8 ' move text up a pixel GET (0, 115)-(319, 192), DataString PUT (0, 114), DataString, PSET ' Make text italic 'GET (1, 184)-(319, 192), DataString 'PUT (0, 184), DataString, PSET WEND ScrollTextStart: DATA 30, "Smooth scrolling text #3!" DATA 40, "by Matt Gulden (aka Folter)" DATA 50, "webmaster@thrillhaus.com" DATA 0, "PAUSE 2.5" DATA 0, "" DATA 50, "This is just another example of" DATA 60, "the quality source code found at:" DATA 70, "http://www.thrillhaus.com/" DATA 0, "PAUSE 2.5" DATA 0, "" DATA 70, "Also check out our free software," DATA 80, "compiler(s), utilities, and screen" DATA 90, "savers" DATA 0, "PAUSE 2.5" DATA 0, "" DATA 90, "Look for projects like THScript," DATA 100, "LightBasic, SpASM, Bastard 98, vTXT," DATA 110, "and more!" DATA 0, "PAUSE 2.5" DATA 0, "" DATA 0, "" DATA 0, "" DATA 80, "Restarting Text " DATA 0, "" DATA 0, "" DATA 0, "" DATA 0, "" DATA 0, "END" SUB DrawStuff FOR NUM = 0 TO 63 PAL NUM, NUM, 0, 0 NEXT NUM2 = 63 FOR NUM = 64 TO 113 PAL NUM, 63, NUM, 0 NUM2 = NUM2 - 1 NEXT NUM2 = 63 FOR y = 0 TO 113 LINE (0, y)-(319, y), y NEXT END SUB SUB PAL (A, R, G, B) OUT &H3C8, A OUT &H3C9, R OUT &H3C9, G OUT &H3C9, B END SUB SUB PAUSE (LENGTH#) START# = TIMER: WHILE TIMER < START# + LENGTH#: WEND END SUB SUB RightAlign (y, text$) x = 40 - LEN(text$) LOCATE y, x: PRINT text$; END SUB