achievementImageUpdate

Type Event
Revision Release 2024.3703
Keywords steam, steamworks, achievements, achievementImageUpdate
See also steamworks.addEventListener()
steamworks.*

Overview

This event occurs when an achievement image has been loaded for the first time, or when the image has changed.

You can receive these events by adding a listener to the plugin via the steamworks.addEventListener() function.

Gotchas

Properties

Example

local steamworks = require( "plugin.steamworks" )

-- Called when an achievement image has been changed/loaded
local function onAchievementImageUpdated( event )
    -- Fetch information about the achievement
    local achievementInfo = steamworks.getAchievementInfo( event.achievementName )

    -- Print the achievement's image info to the log
    print( "Achievement Image Updated" )
    print( "  Localized Name: " .. achievementInfo.localizedName )
    print( "  Is Unlocked Image: " .. tostring(event.unlocked) )
    print( "  Image Pixel Width: " .. tostring(event.imageInfo.pixelWidth) )
    print( "  Image Pixel Height: " .. tostring(event.imageInfo.pixelHeight) )
end

-- Set up a listener to be invoked when an achievement image has been changed/loaded
steamworks.addEventListener( "achievementImageUpdate", onAchievementImageUpdated )