|
Post by vetea on Mar 24, 2018 7:30:58 GMT -5
Hi all, Since I use BEX again for a future new project ( publish soon .. Stay tuned ! ), here is a simple scrolling text sample ! You can modify or use it for your project. '######################################################
'############### Scrolling Text SAMPLE ################
'######################################################
'///// Variables /////
global b$(50) as string
'///// Init Scrolling /////
settextplane SCROLL_B
setscrollplane Scroll_B
SetScrollmode HScroll_Overall,VScroll_Overall
'///// Boucle principale /////
do
valt SC++
DX++
if DX1>=(Lo+2)<<1 then
Phase++
if phase>3 then phase=1
if phase=1 then a$=" I THINK BEX IS A POWERFUL DEVIT ... "
if phase=2 then a$=" ... AND IT'S TRUE !! THANKS A LOT ..."
if phase=3 then a$=" ... MR JOSEPH NORMAN !!! "
l=len(a$)
for i=1 to l
b$(i)=mid$(a$,i-1,1)
next
lo=l+1
DX1=0
SC=0
g=64
end if
'Traitement
if DX>=8 then
DX1++
if l>0 then
for i=l to lo
c$=c$+b$(i)
next
d$=c$
c$=""
l--
PrintText g-1,10,d$,1
else
d$=" "
printText lo+g,10,d$,1
end if
DX=0
g--
if g>32678 then g=64
end if
scroll2 right,SC
sleep 1,TVBLANK
loop
'///////////////////////////
'///// Procédure Texte /////
'///////////////////////////
Declare Sub PrintText(x As Integer, y As Integer, tex$ As String,P As Integer)
x++
y++
l = Len(tex$)
Dim Tex1$ As String
Adr=0
Tex1$=tex$
DataPtr& = VarPtr&(tex$)
SetGfxPlane Scroll_B
For i=1 To l
Read t
DrawTile Adr+t+Palette(0)+Priority(0),x,y
x++
Next
End Sub
Cheers !! Vetea
|
|
|
Post by wraith on Mar 24, 2018 16:39:12 GMT -5
|
|
|
Post by wraith on Apr 1, 2018 3:12:25 GMT -5
Check this one out, Old Skool wave scroller. TextWave.bin (16 KB)
|
|