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 › turn off DILATE filter
Page Index Toggle Pages: 1
turn off DILATE filter (Read 1990 times)
turn off DILATE filter
May 30th, 2010, 1:50pm
 
Hi,
I have some code within a case statement in draw(). One of the lines is a DILATE filter. This successfully blurs whats being drawn in that case statement and leaves things in the other case statements alone. However I am writing some text to the screen outside of the case statement but still inside draw(). This text gets blurred when the DILATE filter is applied. Is there anyways to tell Processing not to apply the filter to the text?
Ex:


draw()
{

 switch(mode)  
 {
     case 1:
     filter(DILATE)
     *DRAW BLURRY STUFF HERE*  
     break;
     
     case 2:
     *DRAW NON BLURRY STUFF HERE*
     break;

 }//END SWITCH

 text("TEST,0,0);
}


So essentially the word TEST is not blurry when case 2 is true but blurry when case 1 is... is there any way to prevent the filter from affecting TEST?

Thanks,
David
Re: turn off DILATE filter
Reply #1 - May 30th, 2010, 2:21pm
 
you appear to have missed the break statement from the bottom of each case. without it the code will carry on and do all the other cases below the matching one.

http://processing.org/reference/switch_.html

Re: turn off DILATE filter
Reply #2 - May 31st, 2010, 10:11am
 
Thanks koogy but I do have break statements in my actual code, that was just some quick pseudo code to give the outline of my problem. I've changed the pseudocode to match Smiley
Re: turn off DILATE filter
Reply #3 - May 31st, 2010, 10:20am
 
It is strange, because the text() is called after the filter is applied, so it shouldn't be blurred.
Re: turn off DILATE filter
Reply #4 - May 31st, 2010, 10:54am
 
Not sure if this was a real issue or just me not coding something right but I've solved it by drawing a black rectangle behind my writing... Smiley thanks!
Page Index Toggle Pages: 1