GKAchievementDescription¶
Inherits: RefCounted < Object
Metadata for every achievement that is defined in App Store Connect.
Description¶
GKAchievementDescription exposes the localized text, group assignments, and icon that you configure for each achievement. Use load_achievement_descriptions() as shown in GameCenterGuide.md to list everything the player can unlock, even before they have reported progress. Apple’s documentation lives at Apple’s GKAchievementDescription reference.
Listing descriptions (guide sample):
GKAchievementDescription.load_achievement_descriptions(func(descriptions: Array[GKAchievementDescription], error: Variant) -> void:
if error:
print("Load achievement description error %s" % error)
else:
for description in descriptions:
print("Achievement Description ID: %s" % description.identifier)
print(" Unachieved: %s" % description.unachieved_description)
print(" Achieved: %s" % description.achieved_description)
)
Loading an image sample (assuming description is one of the loaded entries):
description.load_image(func(image: Image, error: Variant) -> void:
if error == null:
$texture_rect.texture = ImageTexture.create_from_image(image)
else:
print("Error loading achievement image %s" % error)
)
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
void |
load_achievement_descriptions(callback: Callable) static |
void |
load_image(callback: Callable) |
Property Descriptions¶
String achieved_description = "" 🔗
String get_achieved_description()
Text shown after the player completes the achievement.
String group_identifier = "" 🔗
String get_group_identifier()
The optional group identifier configured on App Store Connect.
String get_identifier()
Unique identifier string for this description.
bool get_is_hidden()
Indicates whether the achievement is currently hidden from the user.
bool get_is_replayable()
True when the achievement can be earned more than once.
int get_maximum_points()
The point value that Apple shows when this achievement is completed.
Variant get_rarity_percent()
Either a double with Apple’s reported rarity or null on platforms that do not expose this data.
String get_title()
Display title, localized according to the player’s language.
String unachieved_description = "" 🔗
String get_unachieved_description()
Text shown before the player meets the completion criteria.
Method Descriptions¶
void load_achievement_descriptions(callback: Callable) static 🔗
Loads the entire catalog of achievement descriptions and calls the callback with Array[GKAchievementDescription] and a Variant error (null on success, or a string from GameKit).
void load_image(callback: Callable) 🔗
Downloads the image for this description. The callback receives (Image image, Variant error) where exactly one argument is null, matching the helper described in the guide’s “Load Achievement Description Image” section.