BlitzCoder Essentials
•
Home Page
•
About BlitzCoder
•
Contributors
•
Terms of Use
•
Email Us
Main Areas
•
BlitzCoder Chat
•
Discussions
•
Articles/Tutorials
•
Code Database
•
Link Database
•
Showcase Area
•
Worklogs
•
Competitions
Special Areas
•
Undocumented
Other Blitz Sites
•
Blitz Basic Home
•
Blitz Showcase
•
BlitzPlay Library
Forum Login
Username:
Password:
•
Register Now!
BlitzCoder Code Archives Page
Main Codes Page
"Wavy Vertical Text Scroller "
, by specis
Scrolls the text up the screen.
It needs the text file as this is where it reads the text from
Code
resX = 800 resY = 600 resD = 16 y = 0 Graphics resX,resY,redD SetBuffer BackBuffer() ; Open the File and read all the lines in the file to count how many there are linecount = 0 ; Starts the line count at zero firstImage = resy ; Makes sure the first image is placed off the bottom of the screen linecountf = OpenFile("cha.txt") ; opens the test file (REPLACE WITH TEXT FILE OF YOUYR CHOICE) Repeat temp$ = ReadLine(linecountf) ; Reads the line for no reason linecount = linecount + 1 ; adds 1 to the line count Until Eof(linecountf) ; If its the end of the file exit the loop CloseFile(linecountf) ; closes the file linecount = linecount - 1 ; takes 1 of the line count so we can setup the arrays Color 247,201,89 ; sets the colour to the funkey yellow Dim pics(linecount) ; Sets up the array for the images Dim cords(linecount) ; Sets up the array for the cordinates Dim Middle(linecount) ; Sets up the position for the center of the screen lines = OpenFile("cha.txt") ; Reopen the txt file to read the lines this time For x = 0 To (linecount) temp$ = ReadLine(lines) ; reads the line of text middlestr = (StringWidth(temp)/2) ; works out the middle of the string in pixels middle(x) = ((resx/2) - middlestr); sets it to the middle if the screen offset by the size of the string pics(x) = CreateImage(StringWidth(temp),15,1) ; Creates the image SetBuffer ImageBuffer(pics(x)) Text 0,0,temp$ ; draws the text to the screen cords(x) = firstimage ; sets the Y cordinate place SetBuffer BackBuffer() firstimage = firstimage + 20 ; move the Y cordinate veriable down the screen for the next image Next While Not KeyHit(1) Cls For x = 0 To linecount DrawImage pics(x),(middle(x)+(Sin(100+cords(x))*100)),cords(x) cords(x) = cords(x) - 1 If cords(x) < -50 cords(x) = (resy + 20) EndIf Next Flip Wend
Copyright(c) 2000-2004, BlitzCoder. All Rights Reserved.
Code software created by Krylar's Kreations