Reference pixelDensity()

pixelDensity()

Sets the pixel density or returns the 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.

pixelDensity() sets the pixel scaling for high pixel density displays. By default, the pixel density is set to match the display's density. Calling pixelDensity(1) turn this off.

Calling pixelDensity() without an argument returns the current pixel density.

Examples

Syntax

pixelDensity([val])
pixelDensity()

Parameters

val
Number:

desired pixel density.

This page is generated from the comments in src/core/environment.js . Please feel free to edit it and submit a pull request!

Related References