Quick Links: Gideros Home | Download Gideros | Developer Guide
GameKit API
  • MagnusviriMagnusviri +1 -1 (+4 / -0 )
    This is what I was able to glean from the GameKit plugin for how to use it. I've mostly left it as C++ code. I'm not 100% sure this is correct. If anyone notices errors please correct me.

    class GameKit : public GEventDispatcherProxy
    BOOL isAvailable()
    // Checks to see if OS is 4.1 or newer (minimum requirement for GameKit)
    // Connects to game center
    // [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:]
    // dispatches event "authenticateComplete"
    // dispatches event "loadFriendsComplete"
    // [[GKLocalPlayer localPlayer] loadFriendsWithCompletionHandler:]
    // returns array of friends
    loadPlayers(NSArray* identifiers)
    // dispatches event "loadPlayersComplete"
    // [GKPlayer loadPlayersForIdentifiers:withCompletionHandler:]
    // returns array of tables with these fields: playerID, alias, isFriend
    reportScore(int64_t value, NSString* category)
    // saves score to server
    // GKScore* score = [[[GKScore alloc] initWithCategory:category] autorelease];
    // score.value = value;
    // [score reportScoreWithCompletionHandler:]
    // dispatches event "reportScoreComplete"
    // presents GKLeaderboardViewController
    // presents GKAchievementViewController
    // dispatches event "loadAchievementsComplete"
    // [GKAchievement loadAchievementsWithCompletionHandler:]
    // returns array of tables with these fields: identifier, percentComplete, completed, hidden
    reportAchievement(NSString* identifier, double percentComplete)
    // saves achievement
    // GKAchievement* achievement = [[GKAchievement alloc] initWithIdentifier:identifier];
    // achievement.percentComplete = percentComplete;
    // [achievement reportAchievementWithCompletionHandler:]
    // [GKAchievement resetAchievementsWithCompletionHandler:]
    // dispatches event "resetAchievementsComplete"
    // [GKAchievementDescription loadAchievementDescriptionsWithCompletionHandler:]
    // dispatches event "loadAchievementDescriptionsComplete"
    // returns array of tables with these fields: identifier, title, achievedDescription, unachievedDescription, maximumPoints, hidden

    If there is an error, the event will return a table with these field values: errorCode, errorDescription

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with OpenID

Top Posters