object.pixelHeight

Type Number
Revision 2017.3060
Keywords steam, steamworks, image, texture, avatar, ImageInfo, pixelHeight
See also ImageInfo
steamworks.*

Overview

An integer indicating the height of the image in pixels.

You can convert this property's pixel height to Corona content-scaled coordinates, relative to the content width and height set in the config.lua file, by multiplying this property by the display.contentScaleY property.

Example

local steamworks = require( "plugin.steamworks" )

-- Fetch information about the logged in user's medium avatar image
local imageInfo = steamworks.getUserImageInfo( "avatarMedium" )

if ( imageInfo ) then
    -- Print the avatar size in pixels
    local message1 = string.format(
        "Medium Avatar Pixel Size: %dx%d",
        imageInfo.pixelWidth,
        imageInfo.pixelHeight )
    print( message1 )

    -- Print the avatar size in Corona's content scaled coordinates
    local message2 = string.format(
        "Medium Avatar Content Size: %dx%d",
        imageInfo.pixelWidth * display.contentScaleX,
        imageInfo.pixelHeight * display.contentScaleY )
    print( message2 )
end