Sets the framebuffer's pixel density or returns its current density.
Computer displays are grids of little lights called pixels. A display's pixel density describes how many pixels it packs into an area. Displays with smaller pixels have a higher pixel density and create sharper images.
The parameter, density
, is optional. If a number is passed, as in myBuffer.pixelDensity(1)
, it sets the framebuffer's pixel density. By default, the framebuffer's pixel density will match that of the canvas where it was created. All canvases default to match the display's pixel density.
Calling myBuffer.pixelDensity()
without an argument returns its current pixel density.
उदाहरण
सिंटैक्स
pixelDensity([density])
पैरामीटर्स
density
Number:
pixel density to set.
Returns
Number: current pixel density.
This page is generated from the comments in src/webgl/p5.Framebuffer.js . Please feel free to edit it and submit a pull request!