:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/../../GodotApplePlugins/doc_classes/GKAchievementDescription.xml. .. _class_GKAchievementDescription: GKAchievementDescription ======================== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Metadata for every achievement that is defined in App Store Connect. .. rst-class:: classref-introduction-group Description ----------- ``GKAchievementDescription`` exposes the localized text, group assignments, and icon that you configure for each achievement. Use :ref:`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): .. tabs:: .. code-tab:: gdscript 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): .. tabs:: .. code-tab:: gdscript 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) ) .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`String` | :ref:`achieved_description` | ``""`` | +-------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`String` | :ref:`group_identifier` | ``""`` | +-------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`String` | :ref:`identifier` | ``""`` | +-------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`is_hidden` | ``false`` | +-------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`is_replayable` | ``false`` | +-------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`maximum_points` | ``0`` | +-------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`Variant` | :ref:`rarity_percent` | | +-------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`String` | :ref:`title` | ``""`` | +-------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`String` | :ref:`unachieved_description` | ``""`` | +-------------------------------+-----------------------------------------------------------------------------------------------+-----------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`load_achievement_descriptions`\ (\ callback\: :ref:`Callable`\ ) |static| | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`load_image`\ (\ callback\: :ref:`Callable`\ ) | +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_GKAchievementDescription_property_achieved_description: .. rst-class:: classref-property :ref:`String` **achieved_description** = ``""`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`String` **get_achieved_description**\ (\ ) Text shown after the player completes the achievement. .. rst-class:: classref-item-separator ---- .. _class_GKAchievementDescription_property_group_identifier: .. rst-class:: classref-property :ref:`String` **group_identifier** = ``""`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`String` **get_group_identifier**\ (\ ) The optional group identifier configured on App Store Connect. .. rst-class:: classref-item-separator ---- .. _class_GKAchievementDescription_property_identifier: .. rst-class:: classref-property :ref:`String` **identifier** = ``""`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`String` **get_identifier**\ (\ ) Unique identifier string for this description. .. rst-class:: classref-item-separator ---- .. _class_GKAchievementDescription_property_is_hidden: .. rst-class:: classref-property :ref:`bool` **is_hidden** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`bool` **get_is_hidden**\ (\ ) Indicates whether the achievement is currently hidden from the user. .. rst-class:: classref-item-separator ---- .. _class_GKAchievementDescription_property_is_replayable: .. rst-class:: classref-property :ref:`bool` **is_replayable** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`bool` **get_is_replayable**\ (\ ) True when the achievement can be earned more than once. .. rst-class:: classref-item-separator ---- .. _class_GKAchievementDescription_property_maximum_points: .. rst-class:: classref-property :ref:`int` **maximum_points** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`int` **get_maximum_points**\ (\ ) The point value that Apple shows when this achievement is completed. .. rst-class:: classref-item-separator ---- .. _class_GKAchievementDescription_property_rarity_percent: .. rst-class:: classref-property :ref:`Variant` **rarity_percent** :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`Variant` **get_rarity_percent**\ (\ ) Either a double with Apple's reported rarity or ``null`` on platforms that do not expose this data. .. rst-class:: classref-item-separator ---- .. _class_GKAchievementDescription_property_title: .. rst-class:: classref-property :ref:`String` **title** = ``""`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`String` **get_title**\ (\ ) Display title, localized according to the player's language. .. rst-class:: classref-item-separator ---- .. _class_GKAchievementDescription_property_unachieved_description: .. rst-class:: classref-property :ref:`String` **unachieved_description** = ``""`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`String` **get_unachieved_description**\ (\ ) Text shown before the player meets the completion criteria. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_GKAchievementDescription_method_load_achievement_descriptions: .. rst-class:: classref-method |void| **load_achievement_descriptions**\ (\ callback\: :ref:`Callable`\ ) |static| :ref:`🔗` 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). .. rst-class:: classref-item-separator ---- .. _class_GKAchievementDescription_method_load_image: .. rst-class:: classref-method |void| **load_image**\ (\ callback\: :ref:`Callable`\ ) :ref:`🔗` 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. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`