Width of the Py5Graphics drawing surface in pixels.
Width of the Py5Graphics drawing surface in pixels. When
pixel_density(2) was used in
settings() to make use of a high resolution display (called a Retina display on OSX or high-dpi on Windows and Linux), the width and height of the Py5Graphics drawing surface does not change, but the number of pixels is doubled. As a result, all operations that use pixels (like Py5Graphics.load_pixels(), Py5Graphics.get(), etc.) happen in this doubled space. As a convenience, the variables
pixel_width and Py5Graphics.pixel_height hold the actual width and height of the drawing surface in pixels. This is useful for any Py5Graphics objects that use the Py5Graphics.pixels or Py5Graphics.np_pixels arrays, for instance, because the number of elements in each array will be
Underlying Java field: PGraphics.pixelWidth
Updated on September 11, 2021 16:51:34pm UTC