I have been able to eventually figure out all the 2D and 3D commands and understand that there is a difference between 2D and 3D screens.
However, I can't seem to be able to figure out how in the world to clear the screen of simple 2D objects.
CLS does not work.
I had basically finished a 2D arcade game as a hands-on project for learning DBP. I then wanted to add just a simple "title" screen prior to game start. I loaded 4 images and used the
paste image statement. I also loaded and played 1 sound file (wav). Two of the images were a
help button and a
play button. When I click on the play button it continues with my program as it was coded and the screen is changed to the game area (all 2D) and everything is fine.
When I click on the help button, I have not been able to clear the screen of those initial images so that it is a blank canvas for my help stuff. I thought a simple CLS would suffice but that does not work. In fact I actually didn't need it for the game area. I tried emulating what I had done to init the game area even to the point of loading and pasting the background image. That didn't work.
The original images remained. I made sure that I had code that would keep me in the help area until the space-key would be pressed (for testing purposes). When I would press that key it would go ahead and start the game which again works just fine. I do not know what I am missing or not doing or whatever.
The following is the code which is not optimized as yet. Also I had redone the logic and sequences of some of the code to see if that would make any difference. None had and this code reflects the last changes so they may seem a little odd.
CLS
hide mouse
global SND_START as byte = 4
`load images
load image "title.bmp", 10
load image "an_olive_tree_game1.bmp",11
load image "play.bmp",20
load image "help.bmp",21
load image "background.bmp", IMG_BACKGROUND
set text to bold
load sound "start2.wav", SND_START
set sound volume snd_start,90
sleep 500
play sound SND_START
left_side_image_10 = (screen width() - 497)/2
paste image 10,left_side_image_10,25
sleep 2750
paste image 11,(screen width() - 250)/2,150
sleep 3500
ink rgb(0,0,0),0
set text size 14
set text font "Tahoma"
center text (screen width()/2)-50,300,"Produced by"
sleep 2750
center text (screen width()/2) - 50,330,"Olive Tree"
center text (screen width()/2) - 50,345,"Game Development"
do
i = i + 1
if i = 150 then paste image 20,20,screen height()/2 : paste image 21, screen width() - 155,screen height()/2 : exit
loop
sync on
sync rate 3
show mouse
sync
do
if mouseclick() = 1
x = mousex()
y = mousey()
if (x >= 20 and x <= 155) and (y >= screen height()/2 and y <= (screen height()/2) + 60) then exit
if (x >= screen width() - 155 and x <= (screen width() - 155) + 135) and (y >= screen height()/2 and y <= (screen height()/2) + 60)
delete image 10 : delete image 11 : delete image 20 : delete image 21
delete sound snd_start
get_help = 1
exit
endif
endif
loop
if get_help = 1 then help()
Any help of course would be appreciated. I may find it myself tommorrow after I've had some sleep.
As opposed to Highlander.