Quote: "Can someone with the problem change their 'CLS 0' to 'CLS RGB(0,0,0)' and see if that fixes the problem?"
I get the problem with the original code which doesn't have a "cls 0". The code snippet posted by Juney a few posts back seems to run differently now on my XP laptop - for some reason it runs very slowly with a lot of fan cooling until I remove the second cls and I can't reproduce the behaviour I reported just now.
On my Vista machine the situation is beginning to get confused. The following code works (except for the missing initial box before clicking):
set display mode 800, 600, 32
sync on
sync rate 60
posX = 20
posy = 20
box posx,posy,posx + 80,posy + 80
do
if mouseclick() =1
cls 0
box mousex(),mousey(),mousex() + 80,mousey() + 80
sync
endif
cls
loop
I've tried the following cls pairs (see above snippet for their locations in the code) with the following results:
cls/cls fails
cls 0/cls works
cls/cls 0 works
cls 0/cls 0 fails
cls rgb(0,0,0)/cls rgb(0,0,0) fails
cls 0/cls rgb(0,0,0) works
cls rgb(0,0,0)/cls 0 works
The above seem to be relevant to IanM's question. Is he on to something?
Why should
cls 0 be so different from
cls rgb(0, 0, 0)??
The Help file seems to suggest that there are two different "cls" commands. Here's what it says about "cls" without the extra colour parameter:
Quote: "This command differs from the CLS found in the Basic2D command set which will paint the screen with a specified color."
Of course that could just be poor wording.
What exactly is rendered to, or cleared from, the screen - and in precisely what order? The 2D and 3D commands are rendered differently in some way that is obscure to me - for example, 3D rendering goes to "bitmap 0" but 2D rendering such as text and boxes go somewhere else but still appear on the screen at the same time. How is this? Isn't there a common screen memory somewhere that we can access, copy and save, etc?
rolo99 seems to have posted a good one here.