Difference between revisions of "Texture:getDPIScale"

(Created page)
 
m (0.11.0 -> 11.0)
 
Line 1: Line 1:
{{newin|[[0.11.0]]|110|type=method}}
+
{{newin|[[11.0]]|110|type=method}}
 
Gets the DPI scale factor of the Texture.
 
Gets the DPI scale factor of the Texture.
  

Latest revision as of 19:34, 7 May 2019

Available since LÖVE 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