width#
System variable that stores the width of the display window.
Examples#
def setup():
py5.no_stroke()
py5.background(0)
py5.rect(0, 40, py5.width, 20)
py5.rect(0, 60, py5.width//2, 20)
Description#
System variable that stores the width of the display window. This value is set by the first parameter of the size() function. For example, the function call size(320, 240)
sets the width
variable to the value 320. The value of width
defaults to 100 if size() is not used in a program.
Underlying Processing field: width
Updated on March 06, 2023 02:49:26am UTC