-
Notifications
You must be signed in to change notification settings - Fork 1
AccessPoint
The following functions are provided to control the Game Center access point:
- gamecenter_access_point_set_active
- gamecenter_access_point_get_active
- gamecenter_access_point_set_location
- gamecenter_access_point_get_location
- gamecenter_access_point_is_presenting_game_center
- gamecenter_access_point_is_visible
- gamecenter_access_point_set_show_highlights
- gamecenter_access_point_get_show_highlights
- gamecenter_access_point_get_coordinate
- gamecenter_access_point_present_with_state
- gamecenter_access_point_present
The following enumerations are provided to configure the Game Center access point:
This function shows or hides the Game Center access point, the floating Game Center badge (GKAccessPoint).
Note
The access point requires iOS 14 / macOS 11. On older OS versions this function returns false and does nothing.
Syntax:
gamecenter_access_point_set_active(active)
| Argument | Type | Description |
|---|---|---|
| active | Boolean | Whether the access point should be active (shown) or not |
Returns:
Whether the access point's active state was successfully set
Example:
gamecenter_access_point_set_active(true);This code shows the Game Center access point.
This function returns whether the Game Center access point is currently active.
Note
The access point requires iOS 14 / macOS 11. On older OS versions this function returns false.
Syntax:
gamecenter_access_point_get_active()
Returns:
Whether the access point is active
Example:
var _active = gamecenter_access_point_get_active();
show_debug_message($"Access point active: {_active}");This code gets whether the access point is active and outputs it in a debug message.
This function sets the screen corner in which the Game Center access point is displayed, using a GameCenterAccessPointLocation value.
Note
The access point requires iOS 14 / macOS 11. On older OS versions this function returns false and does nothing.
Syntax:
gamecenter_access_point_set_location(location)
| Argument | Type | Description |
|---|---|---|
| location | GameCenterAccessPointLocation | The screen corner in which to display the access point |
Returns:
Whether the location was successfully set
Example:
gamecenter_access_point_set_location(GameCenterAccessPointLocation.TopTrailing);This code positions the access point in the top trailing corner of the screen.
This function returns the screen corner in which the Game Center access point is displayed, as the GameCenterAccessPointLocation value cast to a {Real}.
Note
The access point requires iOS 14 / macOS 11. On older OS versions this function returns -1.
Syntax:
gamecenter_access_point_get_location()
Returns:
The location as the enum value, or -1 if unavailable
Example:
var _location = gamecenter_access_point_get_location();
if (_location == GameCenterAccessPointLocation.TopLeading)
{
show_debug_message("Access point is in the top leading corner.");
}This code gets the access point's location and checks whether it is in the top leading corner.
This function returns whether the access point is currently presenting the Game Center UI.
Note
The access point requires iOS 14 / macOS 11. On older OS versions this function returns false.
Syntax:
gamecenter_access_point_is_presenting_game_center()
Returns:
Whether the access point is currently showing the Game Center UI
Example:
if (gamecenter_access_point_is_presenting_game_center())
{
show_debug_message("The Game Center UI is open.");
}This code checks whether the Game Center UI is currently being presented.
This function returns whether the access point is currently visible on screen.
Note
The access point requires iOS 14 / macOS 11. On older OS versions this function returns false.
Syntax:
gamecenter_access_point_is_visible()
Returns:
Whether the access point is currently on screen
Example:
var _visible = gamecenter_access_point_is_visible();This code gets whether the access point is currently visible on screen.
This function sets whether the access point shows achievement and rank highlights.
Note
The access point requires iOS 14 / macOS 11. On older OS versions this function returns false and does nothing.
Syntax:
gamecenter_access_point_set_show_highlights(show)
| Argument | Type | Description |
|---|---|---|
| show | Boolean | Whether the access point should show highlights or not |
Returns:
Whether the setting was successfully applied
Example:
gamecenter_access_point_set_show_highlights(true);This code enables achievement and rank highlights on the access point.
This function returns whether the access point shows achievement and rank highlights.
Note
The access point requires iOS 14 / macOS 11. On older OS versions this function returns false.
Syntax:
gamecenter_access_point_get_show_highlights()
Returns:
Whether the access point shows highlights
Example:
var _highlights = gamecenter_access_point_get_show_highlights();This code gets whether the access point shows highlights.
This function returns a single component (X, Y, Width or Height, per GameCenterAccessPointCoordinate) of the access point's on-screen frame, in screen coordinates.
Note
The access point requires iOS 14 / macOS 11. On older OS versions this function returns -1.
Syntax:
gamecenter_access_point_get_coordinate(coordinate)
| Argument | Type | Description |
|---|---|---|
| coordinate | GameCenterAccessPointCoordinate | The frame component to retrieve |
Returns:
The requested frame component in screen coordinates, or -1 if unavailable
Example:
var _x = gamecenter_access_point_get_coordinate(GameCenterAccessPointCoordinate.X);
var _y = gamecenter_access_point_get_coordinate(GameCenterAccessPointCoordinate.Y);
show_debug_message($"Access point at: {_x}, {_y}");This code gets the X and Y coordinates of the access point's on-screen frame.
This function triggers the access point to open a specific Game Center view, given by a GameCenterViewState value. The callback fires once the view is dismissed.
Note
The access point requires iOS 14 / macOS 11. On an unsupported OS this function returns false and still invokes the callback once, so a caller awaiting it does not hang.
[!NOTE]
The GameCenterViewState values Challenges and LocalPlayerFriendsList require newer OS versions (iOS 17.2 / macOS 14.2); selecting them on an older OS may show an empty or unexpected screen.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Callback.
Syntax:
gamecenter_access_point_present_with_state(state, callback)
| Argument | Type | Description |
|---|---|---|
| state | GameCenterViewState | The Game Center view to open |
| callback | Function | The function to call when the presented view is dismissed |
Returns:
Whether the view was successfully triggered
Triggers:
This callback is triggered when the presented Game Center view is dismissed. It carries no data, so it is called with no arguments.
Example:
gamecenter_access_point_present_with_state(GameCenterViewState.Leaderboards, function()
{
show_debug_message("Game Center view dismissed.");
});This code opens the Game Center leaderboards view from the access point and outputs a debug message when it is dismissed.
This function triggers the access point to open the default Game Center dashboard. The callback fires once the dashboard is dismissed.
Note
The access point requires iOS 14 / macOS 11. On an unsupported OS this function returns false and still invokes the callback once, so a caller awaiting it does not hang.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Callback.
Syntax:
gamecenter_access_point_present(callback)
| Argument | Type | Description |
|---|---|---|
| callback | Function | The function to call when the presented view is dismissed |
Returns:
Whether the dashboard was successfully triggered
Triggers:
This callback is triggered when the presented Game Center dashboard is dismissed. It carries no data, so it is called with no arguments.
Example:
gamecenter_access_point_present(function()
{
show_debug_message("Game Center dashboard dismissed.");
});This code opens the default Game Center dashboard from the access point and outputs a debug message when it is dismissed.
This enumeration contains the screen corners in which the Game Center access point can be displayed.
These constants are referenced by the following functions:
| Member | Description |
|---|---|
TopLeading |
The access point is displayed in the top leading corner of the screen. |
TopTrailing |
The access point is displayed in the top trailing corner of the screen. |
BottomLeading |
The access point is displayed in the bottom leading corner of the screen. |
BottomTrailing |
The access point is displayed in the bottom trailing corner of the screen. |
This enumeration contains the components of the access point's on-screen frame.
These constants are referenced by the following functions:
| Member | Description |
|---|---|
X |
The x coordinate of the frame. |
Y |
The y coordinate of the frame. |
Width |
The width of the frame. |
Height |
The height of the frame. |
This enumeration contains the Game Center views that can be presented from the access point.
These constants are referenced by the following functions:
| Member | Description |
|---|---|
Default |
The default Game Center view. |
Leaderboards |
The leaderboards view. |
Achievements |
The achievements view. |
Challenges |
The challenges view. |
LocalPlayerProfile |
The local player's profile view. |
Dashboard |
The Game Center dashboard. |
LocalPlayerFriendsList |
The local player's friends list view. |
GameMaker 2026