Skip to content

Game Center UI

levching edited this page Apr 15, 2020 · 2 revisions

Game Center provides two distinct types of user interface elements for you to use in your game. The first type is intended to be displayed modally by your game, covering your own game’s user interface and temporarily interrupting the normal flow of your game. Typically these user interface screens allow a player to interact with content loaded from Game Center or to perform Game Center tasks. When the player finishes interacting with one of these screens of content, your game shows the next appropriate screen, either by returning to one of your game screens or by advancing to another screenful of content.

Full-Screen View

In iOS, a fullscreen user interface is packaged as a view controller, and follows the standard conventions of view controllers on the system. One of your game’s view controllers is expected to present these view controllers when needed, and later respond when the view controller is dismissed. On OS X, a special class provided by Game Kit provides a similar infrastructure so that your game can present the user interface.

There are few configurations you can use to display the Game Center view controller.

Achievements Page

using SA.iOS.GameKit;
...
ISN_GKGameCenterViewController viewController = new ISN_GKGameCenterViewController();
viewController.ViewState = ISN_GKGameCenterViewControllerState.Achievements;
viewController.Show();

Challenges Page

ISN_GKGameCenterViewController viewController = new ISN_GKGameCenterViewController();
viewController.ViewState = ISN_GKGameCenterViewControllerState.Challenges;
viewController.Show();

Leaderboards Page

using SA.iOS.GameKit;
...
ISN_GKGameCenterViewController viewController = new ISN_GKGameCenterViewController();
viewController.ViewState = ISN_GKGameCenterViewControllerState.Leaderboards;
viewController.Show();

Leaderboard

using SA.iOS.GameKit;
...
ISN_GKGameCenterViewController viewController = new ISN_GKGameCenterViewController();
viewController.ViewState = ISN_GKGameCenterViewControllerState.Leaderboards;
viewController.LeaderboardIdentifier = "itunes.leaderboard.id";
viewController.LeaderboardTimeScope = ISN_GKLeaderboardTimeScope.Today;
viewController.Show();

Banner

The second type of user interface element is a banner that is displayed for a short time to the player. Afterwards, the banner automatically disappears from the screen. While players can interact with some banners, usually banners are simply used to display a message to the player. Game Center displays many banners on behalf of your game, but you can also present your own banners to the player if your game has information you need to display.

About

Foundation

AV Foundation

App Tracking Transparency

Game Kit

Store Kit

UI Kit

Social

Replay Kit

Contacts

AVKit

Photos

App Delegate

User Notifications

MediaPlayer

Core Location

AdSupport

EventKit

CloudKit

Authentication Services

XCode

Knowledge Base

Clone this wiki locally