Texture:getDPIScale

Available since LÖVE 0.11.0
This method is not supported in earlier versions.

Gets the DPI scale factor of the Texture.

The DPI scale factor represents relative pixel density. A DPI scale factor of 2 means the texture has twice the pixel density in each dimension (4 times as many pixels in the same area) compared to a texture with a DPI scale factor of 1.

For example, a texture with pixel dimensions of 100x100 with a DPI scale factor of 2 will be drawn as if it was 50x50. This is useful with high-dpi / retina displays to easily allow swapping out higher or lower pixel density Images and Canvases without needing any extra manual scaling logic.

Function

Synopsis

dpiscale = Texture:getDPIScale( )

Arguments

None.

Returns

number dpiscale
The DPI scale factor of the Texture.

See Also

Other Languages