Texture:getPixelWidth

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

Gets the width in pixels of the Texture.

Texture:getWidth gets the width of the texture in units scaled by the texture's DPI scale factor, rather than pixels. Use getWidth for calculations related to drawing the texture (calculating an origin offset, for example), and getPixelWidth only when dealing specifically with pixels, for example when using Canvas:newImageData.

Function

Synopsis

pixelwidth = Texture:getPixelWidth( )

Arguments

None.

Returns

number pixelwidth
The width of the Texture, in pixels.

See Also

© 2006–2020 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/Texture:getPixelWidth