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 › animation against a background
Page Index Toggle Pages: 1
animation against a background (Read 837 times)
animation against a background
Jan 11th, 2010, 1:37pm
 
I'm working on my first Processing project and would really appreciate a bit of advice about how best to make an animated circle move against a static background (a grid of lines). Shall I redraw the background and circle -- i.e. the whole screen -- in every frame? It seems strange to redraw the whole background when only the area around the circle needs updating, but I've been trying to update that small area only and it turns out to quite complicated to do so.
Re: animation against a background
Reply #1 - Jan 11th, 2010, 1:44pm
 
no, its absolutely ok, to redraw the whole background everyframe. thats actually how you do it.
Re: animation against a background
Reply #2 - Jan 11th, 2010, 1:49pm
 
Quote:
Shall I redraw the background and circle -- i.e. the whole screen -- in every frame


Definitely. This is the way to go. There's no harm clearing and redrawing everything in every frame.

(nootropic wrote a library to use layers, if you feel more comfortable with layering : http://processing.org/discourse/yabb2/num_1259116487_.html
Re: animation against a background
Reply #3 - Jan 12th, 2010, 6:12am
 
Cedric & antiplastik -- thanks, i'll go for that approach
Page Index Toggle Pages: 1