Posted: 12th Dec 2002 3:10
Yet another scrolling text snippet

I saw it somewhere and I thought I would program it... Anyway, here ya go...

+ Code Snippet
`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
`ScrollTextFade() Written by:  Epidemicz~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
`lol well really scroll text function because I haven't programmed in the text fade part ^^;~~~~~~~~~~~~~~~~~~`
`but I will get to that soon enough~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
`this code can be altered to scroll the whole screen width or whatever you want~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
`you would have to change the function around to do that so that the text doesn't scroll back up again though~`
`enjoy the code, if ya use it on your game I would really like to know, ya can e-mail me at~~~~~~~~~~~~~~~~~~~`
`epidemicz@myrealbox.com~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

`````Remember you can highlight any command and hit f1 for an explanation`````

REM Basic Set up : turn on sync and set a rate, hide the annoying mouse, and set display to 800,600
sync on
sync rate 60
hide mouse
set display mode 800,600,32

REM Initiate main program loop to display the text
do

`this calls my function ScrollTextFade().
`400 = X position on screen - places text at 400 X
`600 = Y position on screen - places text at 600 Y
`24 = Text Size :P
`"--- Blah blah blah whatever ---" = The text to display

ScrollTextFade(400,600,20,"--- Epidemicz's Scroll Text Fade Function Snippet ---")
ScrollTextFade(400,600,20,"--- Use this code at your own risk ---")
ScrollTextFade(400,600,20,"--- This function is supposed to fade the text out as it moves up/down ---")
ScrollTextFade(400,600,20,"--- But... ---")
ScrollTextFade(400,600,20,"--- As you can see.... ---")
ScrollTextFade(400,600,20,"--- It DOES NOT~~~~~~ ---")
ScrollTextFade(400,600,20,"--- I haven't gotten to program that in yet ---")
ScrollTextFade(400,600,20,"--- If you use this snippet I would really like to know ---")
ScrollTextFade(400,600,20,"--- Comments or Suggestions? E-mail:  epidemicz@myrealbox.com ---")
ScrollTextFade(400,600,20,"--- ~~~~~The End~~~~~ ---")

loop

`aaah my glorious function
`pretty self explanatory
`set the font for the text
`set text size
`set text background to opaque ***NECESSARY OR TEXT WILL BLUR***
`a bunch of other stuff, if you need better explanation e-mail me: epidemicz@myrealbox.com
`i will be happy to explain it :)

Function ScrollTextFade(XPos,YPos,TextSize,TextString$)
set text font "Arial"
set text size TextSize
set text opaque
if escapekey()=1 then end
   for YPos = YPos to 550 step -1
      if escapekey()=1 then end
      center text XPos,YPos,TextString$
      sync
   next YPos
wait 2500
   for YPos = YPos to 600 step 1
      if escapekey()=1 then end
      center text XPos,YPos,TextString$
      sync
   next YPos
sync
wait 2500

Endfunction
Posted: 12th Dec 2002 3:11
+ Code Snippet
`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
`ScrollTextFade() Written by:  Epidemicz~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
`lol well really scroll text function because I haven't programmed in the text fade part ^^;~~~~~~~~~~~~~~~~~~`
`but I will get to that soon enough~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
`this code can be altered to scroll the whole screen width or whatever you want~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
`you would have to change the function around to do that so that the text doesn't scroll back up again though~`
`enjoy the code, if ya use it on your game I would really like to know, ya can e-mail me at~~~~~~~~~~~~~~~~~~~`
`epidemicz@myrealbox.com~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

`````Remember you can highlight any command and hit f1 for an explanation`````

REM Basic Set up : turn on sync and set a rate, hide the annoying mouse, and set display to 800,600
sync on
sync rate 60
hide mouse
set display mode 800,600,32

REM Initiate main program loop to display the text
do

`this calls my function ScrollTextFade().
`400 = X position on screen - places text at 400 X
`600 = Y position on screen - places text at 600 Y
`24 = Text Size :P
`"--- Blah blah blah whatever ---" = The text to display

ScrollTextFade(400,600,20,"--- Epidemicz's Scroll Text Fade Function Snippet ---")
ScrollTextFade(400,600,20,"--- Use this code at your own risk ---")
ScrollTextFade(400,600,20,"--- This function is supposed to fade the text out as it moves up/down ---")
ScrollTextFade(400,600,20,"--- But... ---")
ScrollTextFade(400,600,20,"--- As you can see.... ---")
ScrollTextFade(400,600,20,"--- It DOES NOT~~~~~~ ---")
ScrollTextFade(400,600,20,"--- I haven't gotten to program that in yet ---")
ScrollTextFade(400,600,20,"--- If you use this snippet I would really like to know ---")
ScrollTextFade(400,600,20,"--- Comments or Suggestions? E-mail:  epidemicz@myrealbox.com ---")
ScrollTextFade(400,600,20,"--- ~~~~~The End~~~~~ ---")

loop

`aaah my glorious function
`pretty self explanatory
`set the font for the text
`set text size
`set text background to opaque ***NECESSARY OR TEXT WILL BLUR***
`a bunch of other stuff, if you need better explanation e-mail me: epidemicz@myrealbox.com
`i will be happy to explain it :)

Function ScrollTextFade(XPos,YPos,TextSize,TextString$)
set text font "Arial"
set text size TextSize
set text opaque
if escapekey()=1 then end
   for YPos = YPos to 550 step -1
      if escapekey()=1 then end
      center text XPos,YPos,TextString$
      sync
   next YPos
wait 2500
   for YPos = YPos to 600 step 1
      if escapekey()=1 then end
      center text XPos,YPos,TextString$
      sync
   next YPos
sync
wait 2500
Endfunction


ya gotta hate that when that happens