Skip to content

AccessPoint

Francisco Dias edited this page Jul 17, 2026 · 6 revisions

Access Point

Functions

The following functions are provided to control the Game Center access point:

Constants

The following enumerations are provided to configure the Game Center access point:



Back To Top

gamecenter_access_point_set_active

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:

Boolean

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.



Back To Top

gamecenter_access_point_get_active

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:

Boolean

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.



Back To Top

gamecenter_access_point_set_location

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:

Boolean

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.



Back To Top

gamecenter_access_point_get_location

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:

Real

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.



Back To Top

gamecenter_access_point_is_presenting_game_center

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:

Boolean

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.



Back To Top

gamecenter_access_point_is_visible

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:

Boolean

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.



Back To Top

gamecenter_access_point_set_show_highlights

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:

Boolean

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.



Back To Top

gamecenter_access_point_get_show_highlights

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:

Boolean

Whether the access point shows highlights


Example:

var _highlights = gamecenter_access_point_get_show_highlights();

This code gets whether the access point shows highlights.



Back To Top

gamecenter_access_point_get_coordinate

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:

Real

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.



Back To Top

gamecenter_access_point_present_with_state

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:

Boolean

Whether the view was successfully triggered


Triggers:

Callback

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.



Back To Top

gamecenter_access_point_present

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:

Boolean

Whether the dashboard was successfully triggered


Triggers:

Callback

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.



Back To Top

GameCenterAccessPointLocation

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.


Back To Top

GameCenterAccessPointCoordinate

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.


Back To Top

GameCenterViewState

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.