SC_ScoreFormatter allows you to configure and display the score as required.

  1. Create an SLScoreFormatter.strings file. The Score Definition section on the developer website offers a score formatter, to configure the score to meet your game's requirements. Edit, copy and save the score formatter to SLScoreFormatter.strings. Additionally, the "Get Leaderboard Widget" link offers a preview of the formatted scores. It is important that the SLScoreFormatter.strings file contains your modified configuration. The widget is useful to display your game's score on a website.

  2. Use the following bar-descriptor.xml entry to add the SLScoreFormatter.strings file to the scoreloop directory of your game project. Make sure to first create the scoreloop subdirectory.
     <asset path="SLScoreFormatter.strings">scoreloop/SLScoreFormatter.strings</asset>
  3. Use the client instance to get the score formatter by calling SC_Client_GetScoreFormatter().

  4. For each score in the score list that is returned, call SC_ScoreFormatter_FormatScore(). Release the SC_String instance that is created.

Steps 3 and 4 can be implemented in the load Leaderboard Completion callback or wherever you want to display scores (for example, during score submission).

See Leaderboards for sample code to integrate the score formatter.

Last modified: 2014-09-29

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus