Difference between revisions of "love.graphics.getPixelWidth"
(Created page) |
m |
||
Line 2: | Line 2: | ||
Gets the width in pixels of the window. | Gets the width in pixels of the window. | ||
− | [[love.graphics.getWidth]] gets the width of the window in units scaled by the screen's [[love.graphics.getDPIScale|DPI scale factor]], rather than pixels. Use getWidth for calculations related to drawing to the screen (calculating the center of the screen, for example), and getPixelWidth only when dealing specifically with underlying pixels (pixel-related calculations in a pixel [[Shader]], for example). | + | [[love.graphics.getWidth]] gets the width of the window in units scaled by the screen's [[love.graphics.getDPIScale|DPI scale factor]], rather than pixels. Use getWidth for calculations related to drawing to the screen and using the graphics coordinate system (calculating the center of the screen, for example), and getPixelWidth only when dealing specifically with underlying pixels (pixel-related calculations in a pixel [[Shader]], for example). |
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === |
Revision as of 17:28, 21 January 2018
Available since LÖVE 0.11.0 |
This function is not supported in earlier versions. |
Gets the width in pixels of the window.
love.graphics.getWidth gets the width of the window in units scaled by the screen's DPI scale factor, rather than pixels. Use getWidth for calculations related to drawing to the screen and using the graphics coordinate system (calculating the center of the screen, for example), and getPixelWidth only when dealing specifically with underlying pixels (pixel-related calculations in a pixel Shader, for example).
Function
Synopsis
pixelwidth = love.graphics.getPixelWidth( )
Arguments
None.
Returns
number pixelwidth
- The width of the window in pixels.
See Also
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