Try this
Posted: Fri Dec 22, 2006 12:56 pm
Code updated for 5.20+
Code: Select all
;Press escape to exit
f=100
Dim s(f,2)
a$=""
For n=1 To 15
Read.b b.b
a$+Chr(b)
Next
DataSection
Data.b 77,101,114,114,121,32,67,104,114,105,115,116,109,97,115
EndDataSection
InitSprite()
InitKeyboard()
font1=LoadFont(1,"lucida handwriting italic",48)
OpenWindow(0,0,0,800,128,"",#PB_Window_ScreenCentered|#PB_Window_BorderLess)
OpenWindowedScreen(WindowID(0),0,0,800,128,0,0,0)
ClearScreen(RGB(128,128,255))
StartDrawing(ScreenOutput())
Box(0,100,800,28,RGB(0,255,0))
BackColor(RGB(128,128,255))
DrawingFont(font1)
DrawingMode(#PB_2DDrawing_Transparent)
tw=TextWidth(a$)
th=TextHeight(a$)
xo=(800-tw)/2
yo=128-th
For y=yo To yo+2
For x=xo To xo+2
DrawText(x,y,a$,0)
Next
Next
DrawText(xo+1,yo+1,a$,RGB(255,0,0))
For n=1 To f
s(n,1)=Random(799)
s(n,2)=0
Next
StopDrawing()
FlipBuffers()
Repeat
StartDrawing(ScreenOutput())
For n=1 To f
p=Point(s(n,1),s(n,2)+1)
If p<>RGB(128,128,255)
s(n,1)=Random(799)
s(n,2)=0
Else
Plot(s(n,1),s(n,2)+1,RGB(255,255,255))
Plot(s(n,1),s(n,2),RGB(128,128,255))
s(n,2)+1
EndIf
Next
WindowEvent()
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)