Type Event Revision Release 2022.3683 Keywords steam, steamworks, achievements, achievementImageUpdate See also steamworks.addEventListener() steamworks.*
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.
If you call the steamworks.getAchievementImageInfo() function and it returns nil
, Steam will automatically fetch the achievement image asynchronously — assuming that it was given a valid achievement name — and dispatch this event.
The steamworks.getAchievementImageInfo() function will typically return nil
the first time it is called upon application startup, but the Steam client will then cache the requested achievement image and make it immediately available upon subsequent application launches until the Steam client has been exited. That is, exiting the Steam client will clear its cached images, forcing it to
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 )