We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › toggle background erasing on/off
Page Index Toggle Pages: 1
toggle background erasing on/off (Read 347 times)
toggle background erasing on/off
Jan 14th, 2008, 10:04pm
 
hello there,

is there a way to toggle the background erasing on and off? i want to combine a few sketches in one sketch so i can switch between them but some uses background and some doesn't.

any ideas?

thanks,
mow.
Re: toggle background erasing on/off
Reply #1 - Jan 15th, 2008, 6:41am
 
... don't use background() if you don't want to erase the background.

Code:
void draw() {
switch(sketch) {
case 0:
background(255);
// erase background and draw stuff
break;
case 1:
// draw stuff without erasing background
break;
}
}
Page Index Toggle Pages: 1