lovr.graphics.getPixelDensity

Returns the pixel density of the window. On "high-dpi" displays, this will be 2.0, indicating that there are 2 pixels for every window coordinate. On a normal display it will be 1.0, meaning that the pixel to window-coordinate ratio is 1:1.

density = lovr.graphics.getPixelDensity()

Arguments

None

Returns

NameTypeDescription
densitynumberThe pixel density of the window.

Notes

If the window isn't created yet, this function will return 0.

See also