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 › move object without repainting with background()
Page Index Toggle Pages: 1
move object without repainting with background()? (Read 1325 times)
move object without repainting with background()?
Oct 29th, 2009, 3:46am
 
This is probably pretty basic, but - is there a way to move an object to a new position without repainting the whole screen?

I guess I need something like a remove function similar to as3's removeChild() to remove an element from the display list.
Re: move object without repainting with background()?
Reply #1 - Oct 29th, 2009, 3:52am
 
I dont think you can, they way processing works is drawing the canvas in every frame, painting everything that has been updated in the draw function, that is why you need background() funciton in the top of draw so it clears everything in it

Hope that makes sence

Cheers
rS
Re: move object without repainting with background()?
Reply #2 - Oct 29th, 2009, 4:00am
 
I see. Thanks.
Re: move object without repainting with background()?
Reply #3 - Oct 29th, 2009, 4:28am
 
As said. Processing doesn't have a concept of display list nor scenegraph (like in JavaFX), it is quite low level.
Usually, it is fast enough to ensure a decent frame rate even with lot of objects.
Page Index Toggle Pages: 1