: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/GKMatchmakerViewController.xml. .. _class_GKMatchmakerViewController: GKMatchmakerViewController ========================== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Presents Apple's Game Center matchmaking UI. .. rst-class:: classref-introduction-group Description ----------- Use this helper to show the stock ``GKMatchmakerViewController`` workflow described in ``GameCenterGuide.md``. You can either create and present the controller manually for full control or call :ref:`request_match()` for the convenience flow demonstrated in the guide. See `Apple's GKMatchmakerViewController reference `__ for Apple's API documentation. Convenience usage from the guide: .. tabs:: .. code-tab:: gdscript var request := GKMatchRequest.new() request.max_players = 2 request.min_players = 1 request.invite_message = "Join me in a quest to fun" GKMatchmakerViewController.request_match(request, func(game_match: GKMatch, error: Variant) -> void: if error: print("Could not request a match %s" % error) else: print("Match ready") # Store game_match and connect to its signals as needed. ) .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +---------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`GKMatchmakerViewController` | :ref:`create_controller`\ (\ request\: :ref:`GKMatchRequest`\ ) |static| | +---------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`present`\ (\ ) | +---------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`request_match`\ (\ request\: :ref:`GKMatchRequest`, callback\: :ref:`Callable`\ ) |static| | +---------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_GKMatchmakerViewController_signal_cancelled: .. rst-class:: classref-signal **cancelled**\ (\ arg1\: :ref:`String`\ ) :ref:`🔗` Emitted when the user cancels the matchmaking UI. The string is empty on UIKit and contains an informational message on macOS. .. rst-class:: classref-item-separator ---- .. _class_GKMatchmakerViewController_signal_did_find_hosted_players: .. rst-class:: classref-signal **did_find_hosted_players**\ (\ arg1\: :ref:`Array`\ ) :ref:`🔗` Fired when GameKit returns players for a hosted-server scenario. The array contains ``GKPlayer`` instances. .. rst-class:: classref-item-separator ---- .. _class_GKMatchmakerViewController_signal_did_find_match: .. rst-class:: classref-signal **did_find_match**\ (\ arg1\: :ref:`GKMatch`\ ) :ref:`🔗` Triggered when a peer-to-peer match has been found and is ready to start. .. rst-class:: classref-item-separator ---- .. _class_GKMatchmakerViewController_signal_failed_with_error: .. rst-class:: classref-signal **failed_with_error**\ (\ arg1\: :ref:`String`\ ) :ref:`🔗` Emitted if Apple reports an error while matchmaking. The string contains ``localizedDescription``. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_GKMatchmakerViewController_method_create_controller: .. rst-class:: classref-method :ref:`GKMatchmakerViewController` **create_controller**\ (\ request\: :ref:`GKMatchRequest`\ ) |static| :ref:`🔗` Builds a wrapper around Apple's view controller for the supplied ``GKMatchRequest``. Configure the returned object and call :ref:`present()` to display it. .. rst-class:: classref-item-separator ---- .. _class_GKMatchmakerViewController_method_present: .. rst-class:: classref-method |void| **present**\ (\ ) :ref:`🔗` Presents the previously created view controller, handling both UIKit and AppKit dialog flows. .. rst-class:: classref-item-separator ---- .. _class_GKMatchmakerViewController_method_request_match: .. rst-class:: classref-method |void| **request_match**\ (\ request\: :ref:`GKMatchRequest`, callback\: :ref:`Callable`\ ) |static| :ref:`🔗` Shows the matchmaking UI and invokes the callback with ``(GKMatch match, Variant error)`` where only one argument is non-``null``. Errors are reported as strings such as "cancelled" when the user dismisses the sheet. .. |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.)`