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 & HelpPrograms › BACKGROUND Switcher ON/OFF
Page Index Toggle Pages: 1
BACKGROUND Switcher ON/OFF (Read 966 times)
BACKGROUND Switcher ON/OFF
May 19th, 2010, 12:03pm
 
Do anybody know how to make such a switcher?
There is no problem to switch ON the background (mousePressed) . but how to switch OFF, when it is ON?????

so

if (mousePressed){
background(100,0);     - so alpha trick NOT WORKS...
background(null);        - NOT WORKS
}


do any of you have some other solutions????


peace!
Marek
Re: BACKGROUND Switcher ON/OFF
Reply #1 - May 19th, 2010, 12:36pm
 
something like this.


boolean showbg = true;


then in draw:

if(showbg)background(0);


and to switch the background on and off.


void mouseReleased(){
showbg = !showbg;

}
Re: BACKGROUND Switcher ON/OFF
Reply #2 - May 20th, 2010, 1:09am
 
As Cedric shown, to switch off background, you just don't draw it...
Unless you meant something else?
Page Index Toggle Pages: 1