Package | com.myflashlab.air.extensions.gameCenter |
Class | public class LeaderboardSet |
Inheritance | LeaderboardSet flash.events.EventDispatcher |
An object that organizes leaderboards into logical and coherent groups. A LeaderboardSet object is used to read data from a leaderboard set stored on Game Center. Your game uses LeaderboardSet objects when it wants to retrieve localized information about a specific leaderboard set or to retrieve scores from a leaderboard set. Typically, you do this when you want the data needed to implement your own custom leaderboard set user interface.
After incorporating leaderboard sets into your app, you must put all of your leaderboards into a set. Individual leaderboards can be put into multiple leaderboard sets and given different display names in each set.
During the development process, you create the leaderboard sets for your game in App Store Connect.
To retrieve information about the available leaderboards for the current set, use loadLeaderboards
static method.
To retrieve information about the available leaderboard sets, use the LeaderboardSet.load
method.
To retrieve information about the image associated with a leaderboard set, use the loadImage
method.
Property | Defined By | ||
---|---|---|---|
groupIdentifier : String [read-only]
Identifies the group that the leaderboard set belongs to. | LeaderboardSet | ||
identifier : String [read-only]
The identifier for the leaderboard set. | LeaderboardSet | ||
title : String [read-only]
Localized title for the leaderboard set. | LeaderboardSet |
Method | Defined By | ||
---|---|---|---|
LeaderboardSet($ctx:ExtensionContext, $index:int) | LeaderboardSet | ||
load($callback:Function):void [static]
Load all of the leaderboard sets for the current game. | LeaderboardSet | ||
loadImage($callback:Function):void
Load the image associated with the leaderboard set. | LeaderboardSet | ||
loadLeaderboards($callback:Function):void
Load all of the leaderboards for the current leaderboard set. | LeaderboardSet |
groupIdentifier | property |
groupIdentifier:String
[read-only]
Identifies the group that the leaderboard set belongs to. This is set when the leaderboard set is part of a game
group. It gets set when LeaderboardSet.load
is called on leaderboards that support game groups.
public function get groupIdentifier():String
identifier | property |
identifier:String
[read-only] The identifier for the leaderboard set.
public function get identifier():String
title | property |
title:String
[read-only] Localized title for the leaderboard set.
public function get title():String
LeaderboardSet | () | Constructor |
public function LeaderboardSet($ctx:ExtensionContext, $index:int)
$ctx:ExtensionContext | |
$index:int |
load | () | method |
public static function load($callback:Function):void
Load all of the leaderboard sets for the current game.
Below shows what parameters the callback function must havefunction($leaderboardSets:Vector.<LeaderboardSet>, $error:String):void { // $leaderboardSets: is an array of LeaderboardSet objects that provides the leaderboard sets for your game. If an error occurred, this value may be non-nil. In this case, the array holds whatever data Game Kit was able to download before the error occurred. // $error: If an error occurred, this error object describes the error. If the operation completed successfully, the value is nil. }
Parameters
$callback:Function — is called when the categories have been retrieved from the server.
|
loadImage | () | method |
public function loadImage($callback:Function):void
Load the image associated with the leaderboard set.
Below shows what parameters the callback function must havefunction($leaderboardSet:LeaderboardSet, $photo:String, $error:String):void { // $leaderboardSet: is a reference to the object which initiated this method. // $photo: is the image associated with the leaderboard set. // $error: If an error occurred, this error object describes the error. If the operation completed successfully, the value is nil. }
Parameters
$callback:Function — is called when the categories have been retrieved from the server.
|
loadLeaderboards | () | method |
public function loadLeaderboards($callback:Function):void
Load all of the leaderboards for the current leaderboard set.
Below shows what parameters the callback function must havefunction($leaderboardSet:LeaderboardSet, $leaderboards:Vector.<Leaderboard>, $error:String):void { // $leaderboardSet: is a reference to the object which initiated this method. // $leaderboards: is an array of Leaderboard objects that provides the leaderboards for your game. If an error occurred, this value may be non-nil. In this case, the array holds whatever data Game Kit was able to download before the error occurred. // $error: If an error occurred, this error object describes the error. If the operation completed successfully, the value is nil. }
Parameters
$callback:Function — is called when the categories have been retrieved from the server.
|