-
Notifications
You must be signed in to change notification settings - Fork 0
/
with note
29 lines (20 loc) · 928 Bytes
/
with note
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//setup() can set the screen size and bakground color , is called by Processing once should not be called again
//only be one setup()function for each sketch
void setup()//define a method or function
{
size(500,400);
}
//you should never call the draw() function processing autocalls it after the setup() call
//draw()continuosly executes the cdoe ontained inside it, there can only be one draw()function for each sketch
void draw()
{
//set to black,grayscale spectrum
background(0);
noStroke(); //stroke(60,220,90) or stroke(0,0,0); //black outline
fill(60, 220, 90); //green
rect(0,100,width,40); //horizontal
rect(100,0,30,height);//vertical
ellipse(mouseX,mouseY,100,100);
}
/*why many circles? background(0) is in the setup function*/
/*what happens moves to background(0) into the draw function, before each cicle is drawn,the backgound is painted black, so it clears the previous circle*/