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 › trace and no trace at the same time
Page Index Toggle Pages: 1
trace and no trace at the same time (Read 386 times)
trace and no trace at the same time
Sep 20th, 2006, 9:17pm
 
Hello everybody,

how could I tell a moving object ("A") to leave a trace on the screen, while a second object ("B") moves without leaving a trace - at the same time?

for example:

float a = 20;

void setup()
{
 size(500, 200);
 background(51);
 stroke(255);
 framerate(30);
}

void draw()
{
 background(51);//delete --> trace
 a = a + 1;
 if (a < 0) {
   a = height;
 }
 rect(a, 75, 10,10);  
}


thanks in advance,

brin
Re: trace and no trace at the same time
Reply #1 - Sep 21st, 2006, 5:33am
 
Instead of using background to erase the rectangle, draw a rectangle at the old position, with the color of the background that you want.
Re: trace and no trace at the same time
Reply #2 - Sep 22nd, 2006, 12:33pm
 
Very cool, this idea.

The background isn´t of just one colour but drawn by the programm so far. I´ll experiment with "taking a picture" of what the rectangle (or whatever object) is upon, should be possible with "copy()".

Thanks!
Page Index Toggle Pages: 1