: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/GKPlayer.xml. .. _class_GKPlayer: GKPlayer ======== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`GKLocalPlayer`, :ref:`GKSavedGame` Represents any Game Center player (local or remote). .. rst-class:: classref-introduction-group Description ----------- ``GKPlayer`` is the shared base type for friends, opponents, and the local user. Use it to access Apple-provided identifiers plus helper methods such as :ref:`load_photo()`, as referenced in the "Players" section of ``GameCenterGuide.md``. Apple's reference lives at `Apple's GKPlayer documentation `__. Loading a player photo (guide sample): .. tabs:: .. code-tab:: gdscript # Put the downloaded image inside a TextureRect named $texture_rect. local_player.load_photo(true, func(image: Image, error: Variant) -> void: if error == null: $texture_rect.texture = ImageTexture.create_from_image(image) else: print("Could not load photo %s" % error) ) .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-----------------------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | :ref:`String` | :ref:`alias` | ``"Unknown"`` | +-----------------------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | :ref:`String` | :ref:`display_name` | ``""`` | +-----------------------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | :ref:`String` | :ref:`game_player_id` | ``"35F4D53AA03317E8DCEFDBDB14943B03FE9C908214139E44661F131895E6E51C"`` | +-----------------------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_invitable` | ``false`` | +-----------------------------+---------------------------------------------------------------+------------------------------------------------------------------------+ | :ref:`String` | :ref:`team_player_id` | ``"EFE0530BC629B6FEB2BB992C9F1DC62649393BEAFC38B5A41903CCD90E33068F"`` | +-----------------------------+---------------------------------------------------------------+------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`load_photo`\ (\ small\: :ref:`bool`, callback\: :ref:`Callable`\ ) | +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`scopedIDsArePersistent`\ (\ ) | +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_GKPlayer_property_alias: .. rst-class:: classref-property :ref:`String` **alias** = ``"Unknown"`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`String` **get_alias**\ (\ ) Player-specified nickname. .. rst-class:: classref-item-separator ---- .. _class_GKPlayer_property_display_name: .. rst-class:: classref-property :ref:`String` **display_name** = ``""`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`String` **get_display_name**\ (\ ) Localized display name suited for UI. .. rst-class:: classref-item-separator ---- .. _class_GKPlayer_property_game_player_id: .. rst-class:: classref-property :ref:`String` **game_player_id** = ``"35F4D53AA03317E8DCEFDBDB14943B03FE9C908214139E44661F131895E6E51C"`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`String` **get_game_player_id**\ (\ ) Stable, per-game identifier used by Apple to uniquely address the player. .. rst-class:: classref-item-separator ---- .. _class_GKPlayer_property_is_invitable: .. rst-class:: classref-property :ref:`bool` **is_invitable** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`bool` **get_is_invitable**\ (\ ) True if the player allows Game Center invitations. .. rst-class:: classref-item-separator ---- .. _class_GKPlayer_property_team_player_id: .. rst-class:: classref-property :ref:`String` **team_player_id** = ``"EFE0530BC629B6FEB2BB992C9F1DC62649393BEAFC38B5A41903CCD90E33068F"`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`String` **get_team_player_id**\ (\ ) Team-scoped identifier shared with other games from the same developer account. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_GKPlayer_method_load_photo: .. rst-class:: classref-method |void| **load_photo**\ (\ small\: :ref:`bool`, callback\: :ref:`Callable`\ ) :ref:`🔗` Downloads the player's avatar. Pass ``true`` for a small image or ``false`` for the normal size. The callback receives ``(Image image, Variant error)`` and exactly one argument is ``null``, mirroring the Swift inline documentation. .. rst-class:: classref-item-separator ---- .. _class_GKPlayer_method_scopedIDsArePersistent: .. rst-class:: classref-method :ref:`bool` **scopedIDsArePersistent**\ (\ ) :ref:`🔗` Returns the result of Apple's ``scopedIDsArePersistent()`` method, letting you detect whether scoped identifiers stay stable for the current device/account combination. .. |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.)`