Oh I'm not done yet, I have one with fading colors
Just gimme another minute.
Also attempted to make the text wrap around the screen edges. It's not perfect, I'm trying to figure out why there's a small stutter in it when it finishes wrapping.
Rem Project: Dark Basic Pro Project
Rem Created: Saturday, January 26, 2013
Rem ***** Main Source File *****
dim colors(6) as dword
colors(1) = rgb(255,0,0)
colors(2) = rgb(255,128,0)
colors(3) = rgb(255,255,0)
colors(4) = rgb(0,255,0)
colors(5) = rgb(0,0,255)
colors(6) = rgb(128,0,255)
segWidth# = screen width() / 5
t$ = "The quick brown fox jumped over the teletubby"
twidth = text width(t$)
textX = -340
sync on
do
cls
rem time delay
if timestamp+10 <= timer()
dec textX
if textX < -twidth then textX = (640-twidth)+8
timestamp = timer()
endif
rem scroll the text in a sinus wave form
tx = textX
for i = 1 to len(t$)
if tx < 640
rem get individual character
c$ = mid$(t$,i)
rem calculate y-coordinate position
ty = 200 + sin(wrapvalue(wrap(tx, 0, 640)))*40
rem wrap text to screen
if tx < -8: offsetX = 648 : else offsetX = 0 : endif
x = tx + offsetX
rem interpolate color
s = x / segWidth#
if s > 4 then s = 4
if s < 0 then s = 0
p# = (x - s*segWidth#) / segWidth#
if p# < 0 then p# = 0
if p# > 1 then p# = 1
c = getInterpolatedColor(colors(s+1), colors(s+2), p#)
ink c, 0
text x, ty, c$
text x, ty+18, c$
text x, ty+36, c$
text x, ty+54, c$
endif
tx = tx + text width(c$)
next i
sync
loop
function getInterpolatedColor(colorA, colorB, p#)
ar = rgbr(colorA)
ag = rgbg(colorA)
ab = rgbb(colorA)
br = rgbr(colorB)
bg = rgbg(colorB)
bb = rgbb(colorB)
r = ar + (br-ar)*p#
g = ag + (bg-ag)*p#
b = ab + (bb-ab)*p#
c = rgb(r,g,b)
endfunction c
"You're not going crazy. You're going sane in a crazy world!" ~Tick