displayDensity

Static displayDensity 

Source
pub static displayDensity: DisplayDensityInternalType
Expand description

Returns the pixel density of the current display the sketch is running on.

Examples

function setup() {
  let density = displayDensity();
  pixelDensity(density);
  createCanvas(100, 100);
  background(200);
  ellipse(width / 2, height / 2, 50, 50);
}