//This sketch starts the same as the one before
//I've written a function called 'setup' which
//sets the size of the window.
//Then I've added a new command which sets the
//background colour of the window. The parameter
//sets the background colour to a shade of grey:
//0 means black and 255 means white.
void setup() {
size(480, 800);
background(0);
}
//void draw()
//
//'draw' is another one of the built in functions
//that Processing knows about. It doesn't give back
//an answer and it doesn't let you send it any information
//as parameters. Processing 'calls' the draw function 60 times
//a second so if you draw something different each time you can
//make an animation. For now it just sets the drawing colour
//with the 'fill' command which works the same as the 'background'
//command (guess what colour it will draw). Then it draws a
//rectangle with the 'rect' command. The numbers between the
//braces are the position of the top left corner of the rectangle
//and the width and height, all in pixels.
//Try changing the code to draw two rectangles on the screen.
void draw() {
fill(255);
rect( 200, 360, 80, 80 );
}
//I've written a function called 'setup' which
//sets the size of the window.
//Then I've added a new command which sets the
//background colour of the window. The parameter
//sets the background colour to a shade of grey:
//0 means black and 255 means white.
void setup() {
size(480, 800);
background(0);
}
//void draw()
//
//'draw' is another one of the built in functions
//that Processing knows about. It doesn't give back
//an answer and it doesn't let you send it any information
//as parameters. Processing 'calls' the draw function 60 times
//a second so if you draw something different each time you can
//make an animation. For now it just sets the drawing colour
//with the 'fill' command which works the same as the 'background'
//command (guess what colour it will draw). Then it draws a
//rectangle with the 'rect' command. The numbers between the
//braces are the position of the top left corner of the rectangle
//and the width and height, all in pixels.
//Try changing the code to draw two rectangles on the screen.
void draw() {
fill(255);
rect( 200, 360, 80, 80 );
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.