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 › paint() function
Page Index Toggle Pages: 1
paint() function (Read 953 times)
paint() function
Apr 5th, 2010, 10:22pm
 
Hi,

I didn't find anything related to a "paint" method in the documentation, however if I create a function with that name it is called twice automatically by processing:

Code:

void paint()
{
 println("frame : " + frameCount);
}

output :

frame : 1
frame : 2



Is this functionality documented? if so, can someone post the link?

Regards,
Joel
Re: paint() function
Reply #1 - Apr 6th, 2010, 12:46am
 
Re: paint() function
Reply #2 - Apr 6th, 2010, 2:52am
 
I don't think Cedric's link is relevant... (it is about the app, ie. the PDE itself).

But your sketch extends PApplet which defines paint() (protected) which is called to draw the screen surface. Defining such method might actually disturb the sketch...
The problem is that neither the compiler nor the PDE warn that a function definition overrides an existing one. We get a hint in Eclipse but even then we can miss it...
Re: paint() function
Reply #3 - Apr 6th, 2010, 3:15am
 
ah, alright, i got the problem Smiley thx PhiLho
Page Index Toggle Pages: 1