Platforms to show: All Mac Windows Linux Cross-Platform
GKLocalPlayerMBS class
Super class: GKPlayerMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
At any given time, only one player may be authenticated on the device; this player must log out before another player can log in.
Your game must authenticate the local player before using any Game Center features. Authenticating the player ensures that the player has created an account and is connected to Game Center. To authenticate the local player, retrieve the shared instance of the local player by calling the localPlayer class method, and then call the authenticateWithCompletionHandler: method.
You can see whether the local player is authenticated by reading the local player's authenticated property. If authenticated is true, then the local player's other properties are valid, and you can call other Game Center methods.
Call the loadFriendsWithCompletionHandler: method to retrieve the player identifiers for the local player's friends.
Subclass of the GKPlayerMBS class.
- 2 properties
- property isAuthenticated as boolean
- property isUnderage as boolean
- 8 methods
- method Constructor
- method friends as string()
- method loadDefaultLeaderboardCategoryID(tag as Variant = nil)
- method loadFriendPlayers(tag as Variant = nil)
- method loadFriends(tag as Variant = nil)
- method SetAuthenticateHandler(tag as Variant = nil)
- method setDefaultLeaderboardCategoryID(categoryID as string, tag as Variant = nil)
- 2 shared methods
- shared method GKPlayerAuthenticationDidChangeNotificationName as string
- shared method localPlayer as GKLocalPlayerMBS
Super class GKPlayerMBS
- 5 properties
- property alias as string
- property displayName as String
- property Handle as Integer
- property isFriend as boolean
- property playerID as string
- 2 methods
- method Constructor Private
- method loadPhotoForSize(size as Integer, tag as Variant = nil)
- 3 shared methods
- shared method Available as boolean
- shared method GKPlayerDidChangeNotificationName as string
- shared method loadPlayersForIdentifiers(identifiers() as string, tag as Variant = nil)
- 2 constants
Constants
Constant | Value | Description |
---|---|---|
GKPhotoSizeNormal | 1 |
One of the size constants of a photo loaded by Game Center.
Load a normal sized photo. |
GKPhotoSizeSmall | 0 |
One of the size constants of a photo loaded by Game Center.
Load a small photo. |
This class has no sub classes.
Some events using this class:
- GameKitMBS.authenticateCompleted(localPlayer as GKLocalPlayerMBS, error as NSErrorMBS, tag as Variant)
- GameKitMBS.authenticateHandler(LocalPlayer as GKLocalPlayerMBS, viewController as NSViewControllerMBS, error as NSErrorMBS, tag as Variant, viewControllerHandle as Integer)
- GameKitMBS.loadDefaultLeaderboardCategoryIDCompleted(LocalPlayer as GKLocalPlayerMBS, categoryID as string, error as NSErrorMBS, tag as Variant)
- GameKitMBS.loadFriendPlayersCompleted(localPlayer as GKLocalPlayerMBS, friendPlayers() as GKPlayerMBS, error as NSErrorMBS, tag as Variant)
- GameKitMBS.loadFriendsCompleted(localPlayer as GKLocalPlayerMBS, friends() as string, error as NSErrorMBS, tag as Variant)
- GameKitMBS.setDefaultLeaderboardCategoryIDCompleted(LocalPlayer as GKLocalPlayerMBS, categoryID as string, error as NSErrorMBS, tag as Variant)
Some examples using this class:
Xojo Developer Magazine
- 12.6, page 27: Writing OS X Apps for Game Center, Part 3: Turn-Based Games by Tom Baumgartner
- 12.4, pages 30 to 31: Writing OS X Apps for Game Center, Getting started by authenticating the local player with the Game Center Sandbox testing facility by Tom Baumgartner
The items on this page are in the following plugins: MBS MacFrameworks Plugin.
GKLeaderboardViewControllerMBS - GKMatchmakerMBS