Quote: "Is there a way to clear text only from the screen?"
Not a single command but you can mimic it in several different ways.
1. If your text is going to be in specific areas and graphics aren't going to be under where the text is you can use the command SET TEXT OPAQUE and any text you put on the screen will overwrite any graphics or other text because it (after that command) writes the background color to the screen also.
set display mode 800,600,16
` Set the text to overwrite the background too
set text opaque
` Make some lines
for t=1 to 1000
ink rgb(rnd(255),rnd(255),rnd(255)),0
line rnd(800),rnd(600),rnd(800),rnd(600)
next t
ink rgb(255,255,255),0
` Show the text
text 0,0,"This is a test."
wait key
` Erase the text
text 0,0,space$(15)
wait key
2. You can just grab the entire screen with GET IMAGE and PASTE IMAGE every time you wish to clear the text.
set display mode 800,600,16
` Make some lines
for t=1 to 1000
ink rgb(rnd(255),rnd(255),rnd(255)),0
line rnd(800),rnd(600),rnd(800),rnd(600)
next t
` Grab the image
get image 1,0,0,800,600,1
ink rgb(255,255,255),0
do
` Show the text
text rnd(800),rnd(600),"This is a test."
wait 500
` Replace the background
paste image 1,0,0
loop
3. You can make all text sprites so they don't interfere with the background.
set display mode 800,600,16
sync rate 0
sync on
` Make some lines
for t=1 to 1000
ink rgb(rnd(255),rnd(255),rnd(255)),0
line rnd(800),rnd(600),rnd(800),rnd(600)
next t
` Grab the image
get image 1,0,0,800,600,1
ink rgb(255,255,255),0
` Make a sprite out of the text
a$="This is a test."
` Make a bitmap
create bitmap 1,text width(a$),text height(a$)
` Write the text on that bitmap
text 0,0,a$
` Grab the text as an image
get image 2,0,0,text width(a$),text height(a$),1
` Delete the bitmap
delete bitmap 1
` Change to the main screen
set current bitmap 0
do
` Show the background
paste image 1,0,0
` Show the text
sprite 1,rnd(800),rnd(600),2
wait 500
sync
loop
I'm sure there are other methods but I couldn't think of anymore.