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.
IndexDiscussionGeneral Discussion,  Status › help me, please
Page Index Toggle Pages: 1
help me, please (Read 1083 times)
help me, please
May 5th, 2009, 6:14pm
 
hi, i want the ellipse not to stretch as it is going along the screen- how would i do this? i just want it to travel across the screen as a circle


float y=0.0;

void setup(){ size(700,700);
 smooth ();
 
}

void draw () {
 background(0);
fill(#FA2014);//planet

noStroke();
ellipse(y,45,100,y);
noFill();

 y=y+ 1;
// if (y>900)//y>height
//   y=0.0;
if (y>900){
  y=90;  

 }
}
Re: help me, please
Reply #1 - May 5th, 2009, 10:12pm
 
Hi louisa,

just get that last "y" out of the ellipse function call.

Code:
ellipse(y, 45, 100, y); 


should be:
Code:
ellipse(y, 45, 100, 100); 


Take a look at the reference for the ellipse method. It says the syntax is like this:
Quote:
ellipse(x, y, width, height);


Also you should probably change your "y" variable to be called "x", because you are wanting to change the ellipses x position.

Hope that helps.
Re: help me, please
Reply #2 - May 5th, 2009, 11:09pm
 
Thanks a lot that helped so much!!
Page Index Toggle Pages: 1