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.
예제
구문
pixelDensity([val])
pixelDensity()
매개변수
desired pixel density.
관련 레퍼런스
deltaTime
A Number variable that tracks the number of milliseconds it took to draw the last frame.
describeElement
Creates a screen reader-accessible description of elements in the canvas.
displayDensity
Returns the display's current pixel density.
displayHeight
A Number variable that stores the height of the screen display.