 |
 |
 |
 |
Name |
|
size() |
 |
|
|
Examples |
|
void setup() {
size(320, 240);
background(153);
}
void loop() {
line(0, 0, width, height);
}
|
|
|
Description |
|
Defines the dimension of the display window in units of pixels. The size() function must be the first line in setup(). If size() is not called, the default size of the window is 100x100 pixels. The system variables width and height are set based on the parameters passed to the size() function. |
 |
|
|
Syntax |
|
size(width, height)
|
 |
|
|
Parameters |
|
width |
|
int: width of the display window in units of pixels
|
height |
|
int: height of the display window in units of pixels
|
|
 |
|
|
Returns |
|
None |
 |
|
|
Usage |
|
Web & Application |
 |
|
|
|