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
- Texture
- Texture:getDimensions
- Texture:getPixelDimensions
- love.graphics.newImage
- love.graphics.newCanvas
- Config Files
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info