FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Programs
(Moderators: fry, REAS)
   EXTREMELY simple problem
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: EXTREMELY simple problem  (Read 301 times)
Ride215

Ride215
EXTREMELY simple problem
« on: Apr 6th, 2004, 10:59am »

Ok, I am a very new beginner, so I have no idea why this isn't running, but...
 
I was reading the introductory processing tutorial and the beginning of the "motion" section has this example:
 
int x = 0;
 
void setup(){
noStroke();
}
 
void loop(){
rect(x,0,5,100);
x = x+1;
}
 
Now I just wanted to see it work so I did it on my own but instead of the line going across as it should, it basically does a wipe over the entire screen, where is the discrepency?
 
TomC

WWW
Re: EXTREMELY simple problem
« Reply #1 on: Apr 6th, 2004, 12:27pm »

In earlier alpha releases the background was cleared automatically at the start of every frame.  Now it must be done explicitly.
 
Add a line like this at the beginning of loop() (before the call to rect()).
 
Code:

background(128);

 
See the reference for more info on background().
« Last Edit: Apr 6th, 2004, 12:28pm by TomC »  
Pages: 1 

« Previous topic | Next topic »