I used the D3D plugin, but it can be altered to work without it.
Basically, this is stripped from a program I'm currently working on and felt it was neat enough to share the snippet. There are 3 lists that you can scroll back and forth from left to right. Only a single list is displayed at a time, and as it slides off to the side it'll fade out as the new list fades in. It was just a fancy animation effect to scroll between data for my program.
I actually tackled with this snippet for several hours last night before I finally set my program aside and worked it out separately from my main project. I still have to go back and implement it. It gave me a huge headache until a simple solution finally occurred to me, which the results are below.
dim list1$(12)
dim list2$(20)
dim list3$(10)
for i = 0 to 12
list1$(i) = str$(i)+". some stuff"
next i
for i = 0 to 20
list2$(i) = str$(i)+". lots more stuff"
next i
for i = 0 to 10
list3$(i) = str$(i)+". final list of random junk"
next i
d3d_init
d3d_font 1, "JaguarJC", 28, 0, 0, 0
fontHeight = d3d_gettextheight(1, "M")
_MusicView = 0
_OldMusicView = -1
slideFadeAlpha = 0
sync on
sync rate 60
repeat
cls
d3d_starttext
if _MusicView = 0 or _OldMusicView = 0
x = 200 - (_MusicView*300) + fadeOffsetX
if _OldMusicView = 0 : alpha = slideFadeAlpha : else : alpha = 255-slideFadeAlpha : endif
for i = 0 to array count(list1$())
y = 100 + i*fontHeight
d3d_text 1, x, y, 0, list1$(i), d3d_rgba(255,255,255,alpha)
next i
endif
if _MusicView = 1 or _OldMusicView = 1
x = 500 - (_MusicView*300) + fadeOffsetX
if _OldMusicView = 1 : alpha = slideFadeAlpha : else : alpha = 255-slideFadeAlpha : endif
for i = 0 to array count(list2$())
y = 100 + i*fontHeight
d3d_text 1, x, y, 0, list2$(i), d3d_rgba(255,255,255,alpha)
next i
endif
if _MusicView = 2 or _OldMusicView = 2
x = 800 - (_MusicView*300) + fadeOffsetX
if _OldMusicView = 2 : alpha = slideFadeAlpha : else : alpha = 255-slideFadeAlpha : endif
for i = 0 to array count(list3$())
y = 100 + i*fontHeight
d3d_text 1, x, y, 0, list3$(i), d3d_rgba(255,255,255,alpha)
next i
endif
if fadeSlide = 1
dec fadeOffsetX, 30
dec slideFadeAlpha, 26
if fadeOffsetX < 0 then fadeOffsetX = 0 : fadeSlide = 0
if slideFadeAlpha < 0 then slideFadeAlpha = 0
endif
if fadeSlide = 2
inc fadeOffsetX, 30
dec slideFadeAlpha, 26
if fadeOffsetX > 0 then fadeOffsetX = 0 : fadeSlide = 0
if slideFadeAlpha < 0 then slideFadeAlpha = 0
endif
d3d_endtext
if rightkey() = 1 and vkFlag = 0 and _MusicView < 2
vkFlag = 1
_OldMusicView = _MusicView
inc _MusicView
if _MusicView > 2 then _MusicView = 2
if _OldMusicView <> _MusicView then fadeSlide = 1 : slideFadeAlpha = 255 : fadeOffsetX = 300
endif
if leftkey() = 1 and vkFlag = 0 and _MusicView > 0
vkFlag = 1
_OldMusicView = _MusicView
dec _MusicView
if _MusicView < 0 then _MusicView = 0
if _OldMusicView <> _MusicView then fadeSlide = 2 : slideFadeAlpha = 255 : fadeOffsetX = -300
endif
if rightkey() = 0 and leftkey() = 0 then vkFlag = 0
sync
until spacekey()
end
The Internet: Where men are men, women are men, and children are federal agents