Moai SDK  1.5 revision 1 (MoaiEdition)
MOAIGameCenterIOS Class Reference

Inherits MOAIGlobalClass< TYPE, SUPER >.

List of all members.

Function List

  authenticatePlayer
  getPlayerAlias
  getScores
  isSupported
  reportAchievementProgress
  reportScore
  setGetScoresCallback
  showDefaultAchievements
  showDefaultLeaderboard

Function Documentation

Makes sure GameCenter is supported and an account is logged in. If none are logged in, this will prompt the user to log in. This must be called before any other MOAIGameCenterIOS functions.


function authenticatePlayer ( nil )
Parameters:
( nil )
Returns:
nil

Returns the user visible player name string from GameCenter.


function getPlayerAlias ( nil )
Parameters:
( nil )
Returns:
alias ( string )

Returns the top ten scores of everyone for all-time. Optionally specify a leaderboard, player scope, time scope and range. If no leaderboard was specified, this will return scores from the default leaderboard.


function getScores ( [ string category, number playerScope, number timeScope, number startRange, number endRange ] )
Parameters:
category ( string ) Optional.
playerScope ( number ) Optional.
timeScope ( number ) Optional.
startRange ( number ) Optional.
endRange ( number ) Optional.
Returns:
scores ( table )

Returns whether or not GameCenter is supported on the current device.


function isSupported ( nil )
Parameters:
( nil )
Returns:
isSupported ( bool )

Reports an achievement progress to GameCenter.


function reportAchievementProgress ( string identifier, number percentComplete )
Parameters:
identifier ( string )
percentComplete ( number )
Returns:
nil

Reports a score to a desired leaderboard on GameCenter.


function reportScore ( number score, string category )
Parameters:
score ( number )
category ( string )
Returns:
nil

Sets the function to be called upon a successful ' getScores () call.


function setGetScoresCallabck ( function getScoresCallback )
Parameters:
getScoresCallback ( function )
Returns:
nil

Displays the default achievements view.


function showDefaultAchievments ( nil )
Parameters:
( nil )
Returns:
nil

Displays the default leaderboard view.


function showDefaultLeaderboard ( nil )
Parameters:
( nil )
Returns:
nil