Platforms to show: All Mac Windows Linux Cross-Platform
Back to GKAchievementMBS class.
GKAchievementMBS.Constructor(identifier as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
identifier: A string that identifies the achievement you want to update.
Your game initializes a new achievement object only when it has not previously reported progress for that achievement. If your game has previously reported progress on an achievement, you should retrieve the achievement object by calling the loadAchievementsWithCompletionHandler class method and update the progress on that object instead.
GKAchievementMBS.identifier as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The identifier property must match the identifier string for an achievement you created for your game on iTunes Connect.
(Read and Write computed property)
GKAchievementMBS.isCompleted as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The value of this property is true if the percentComplete property is equal to 100.0; otherwise, it is false.
GKAchievementMBS.isHidden as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
On a newly initialized achievement object, the property's value is invalid. If the achievement object was returned to your game by the loadAchievementsWithCompletionHandler class method, the value of this property matches the value you set in iTunes Connect for that achievement. The value in this property is identical to the value found in the hidden property for an GKAchievementDescriptionMBS object that shares the same achievement identifier.
GKAchievementMBS.issueChallengeToPlayers(playerIDs() as string, message as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 13.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Players may not issue challenges to themselves nor to non-friends. Please see the GameKit reference documentation for further details on these methods.
Available on Mac OS X 10.8.2 and newer.
GKAchievementMBS.lastReportedDate as date
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
On a newly initialized achievement object, this property holds the current date.
GKAchievementMBS.percentComplete as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The default value for a newly initialized achievement object is 0.0. The range of legal values is between 0.0 and 100.0, inclusive.
(Read and Write computed property)
GKAchievementMBS.reportAchievement(tag as Variant = nil)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
When the player makes progress towards completing an achievement, your game should communicate the player's progress to Game Center by calling this method. An achievement object is implicitly tied to the local player that was authenticated when the object was created; your game should only report progress when the same local player is still authenticated on the device.
Note: To avoid using network bandwidth unnecessarily, only report an achievement when the user has actually advanced the progress they have made towards completing it.
When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls GameKitMBS.reportAchievementCompleted.
When the progress is successfully reported, the achievement is made visible if it was previously hidden. The percentComplete and lastReportedDate property values stored on Game Center are updated if the new percentComplete value is greater than the value previously stored on Game Center. if the value of the percentComplete property was equal to 100.0, then the achievement is marked as completed and a banner may be shown to the player.
If the error is a network error and your game is running on iOS 4.3 or earlier, your game should periodically attempt to report the progress until the achievement is successfully reported. On iOS 5.0 and later and on OS X, the background reporting task automatically handles network errors on your game's behalf.
GKAchievementMBS.selectChallengeablePlayerIDs(playerIDs() as string, tag as Variant = nil)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 13.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Available on Mac OS X 10.8.2 and newer.
Calls later GameKitMBS.selectChallengeablePlayerIDsCompleted event when completed.
GKAchievementMBS.showsCompletionBanner as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
When an achievement is completed and the value of this property is true, a notification banner is displayed to the player to inform them of the completed achievement. If the value of this property is false, there is no visual indication that the achievement is completed. Your game should set this property to false only when it wants to provide its own visual indicator that the achievement was earned. The default value is false.
(Read and Write computed property)
The items on this page are in the following plugins: MBS MacFrameworks Plugin.