GodtoSteamKit Tutorials - Achievement Icons
By Gramps
This tutorial will cover the basics of using the Steam Achievement Icon custom nodes from the GodotSteamKit.
Usage
Once you have the GodotSteamKit installed, there will be three new texture nodes: SteamAchievementIcon, SteamAchievementIcon3D and SteamAchievementIconRect which are the Sprite2D, Sprite3D, and TextureRect nodes, respectively.
You can set the achievement's API name to the achievement_api_name property or use its setter method, set_api_name. This must be the name you set for the achievement in the Steamworks back-end, e.g. achievement01, ACHIEVE1, etc.:
# Assigning the property directly
steam_achievement_icon.achievement_api_name = new_api_name
# Alternatively setting the steam_id property by using the setter function
steam_achievement_icon.set_api_name(new_api_name)
Once the API name is set, the node will call getAchievementIcon() and, if successful, it will render the icon to itself. The node will also trigger a user_achievement_icon_fetched callback internally if Steam takes a while to load the image after the API name is set.
You can also set the custom_size property to resize the image.
Properties
achievement_api_name
The API name for this achievement in the Steamworks back-end.
custom_size
Set a specific size for the Steam achievement icon. Make sure this is smaller than the original image you uploaded to the Steamworks back-end.
Functions
set_api_name
This is the setter function for achievement_api_name which will set the tracked API name then request and display the related icon.
Troubleshooting
If both of these fail and no image is displayed, it may be possible the icon was set but not published live in the Steamworks back-end. It is also possible that your callbacks are not running so check to see if that they are enabled.