First page Back Continue Last page Graphics
Screen Width & Height
Processing has 2 built in variables for the screen width and height
- width : the current screen width in pixels
- height : the current screen height in pixels
- if you change the numbers in the size command, then width and height change automatically :
- size( 200, 200 ) -> width = 200
- size( 400, 200 ) -> width = 400
- Useful in loops and drawing math; you don't have use a separate variable and can change the screen size without changing code