I need a new command...

Hey guys (and gals)! Let me start off by just saying that I'm terrible at Basic, so sorry if I don't really know what I'm talking about. The reason I'm posting this is because when using TrueBasic Bronze (the program my school offers us) I'm looking to put a picture of Samus I drew onto a background. The problem is, I only know the boxkeep command, which annoys me because it saves the white space in the background as well. Also, this picture moves around on a multi-colored background, so I can't just make the background of the kept picture the same color as the background. Is there anyway to do this (such as a command to cut out the picture itself instead of just saving it to a box)? Thanks!

-WellHelloThere

P.S. I hope I'm posting this on the right forum...

Comments

re: new command

I have made some small changes in your code--see the comments below. rwt

set mode "color256"
set window -10,10,-10,10
box area -10,10,-10,10
set color 55
box disk -1,1,-1,1
box keep -1,1,-1,1 in ball$
clear
set color 0
box area -10,10,-10,10
set color 1
box disk -1,1,-1,1
box keep -1,1,-1,1 in mask$
clear
set color 13
box area -10,0,-10,10
set color 174
box area 0,10,-10,10
for x = -10 to 10 step .5
! you need to keep the area under your object in temp$--since the background changes the temp$ needs to
! change just before each movement of your object--hence inside the the for-next loop
box keep x,x+2,x,x+2.1 in temp$ ! as you found, you need to extend your up down area just a bit
box show mask$ at x,x using "and"
box show ball$ at x,x using "or"
pause .1
box show temp$ at x,x
!then you need to restore the background AFTER showing your object
!you don't need the next statement--pasting temp$ erases the object AND restores the background.
!box clear x,x+2,x,x+2.5
next x
end

First of all, thanks so much

First of all, thanks so much for helping me! Secondly, I tried to make a sample of what you said (my end program will be much more complicated), but it's still not working properly. Can you see what I've done wrong?

set mode "color256"
set window -10,10,-10,10
box area -10,10,-10,10
set color 55
box disk -1,1,-1,1
box keep -1,1,-1,1 in ball$
clear
set color 0
box area -10,10,-10,10
set color 1
box disk -1,1,-1,1
box keep -1,1,-1,1 in mask$
clear
set color 13
box area -10,0,-10,10
set color 174
box area 0,10,-10,10
box keep -1,1,-1,1 in temp$
box show mask$ at -10,-10 using "and"
box show ball$ at -10,-10 using "or"
for x = -10 to 10 step .5
box show temp$ at x,x
box show mask$ at x,x using "and"
box show ball$ at x,x using "or"
pause .1
box clear x,x+2,x,x+2.5
next x
end

Thanks, and I give me regards.

re: new command

To have a graphic that can be moved around over the background with the background showing through you need to do the following.

Draw your graphic but with all the 'white space' actually BLACK (unless on a MAC then the white space should be white." Box save the graphic, say as image$.

Now take your graphic and turn all the background white (black for a Mac) and then color in all the non-background black (white for a Mac). Box save this image--label it as a mask -- mask$.

Now when you want to show your image--first use a box save to save the background area over which you will be pasting your image-box keep x,x1,y,y1 in temp$. Keep this save small--same size as your image.

The do a

box show mask$ at x,y using "and"

followed by

box show image$ at x,y using "or'

This will display your image over the background with transparent areas.

To move the image first restore the background-- box show temp$ at x,y, save out the background at the new position, then repeat the box show sequence above.

All this can be much smoother if you use an invisible screen to do your manipulations, but that takes a lot more instruction to explain. There used to be a document that I wrote some time ago on the web site here, but not sure it is still around. Search on bit-mapped graphics.

rwt