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 › How to "shrink" shapes?
Page Index Toggle Pages: 1
How to "shrink" shapes?? (Read 440 times)
How to "shrink" shapes??
Sep 10th, 2008, 4:50am
 
Okay, now I feel really stupid. Here's my code:

int xpos, ypos, wdth, ht;
void setup(){
 size(200, 200);
 wdth = int (random(100));
 ht = wdth;
 noStroke();
 xpos = width/2;
 ypos = height/2;
 frameRate(30);
}

void draw(){
 wdth = wdth + 1; // change + to -
 ht = wdth;
 ellipse(xpos, ypos, wdth, ht);
}

Okay, so when I run this, the circle enlarges smoothly. Now change the + to a - in the first line in the draw function where there is a comment. I expected the circle to shrink but it doesn't. Why?

How do I get it to shrink in size?

George

Never mind--figured it out!
Reply #1 - Sep 10th, 2008, 5:17am
 
Use background() to "erase" the previous shape. Duh....
Page Index Toggle Pages: 1