leaderboards.loadScores()

Type Function
Return value none
Revision Release 2022.3683
Keywords Google Play Games Services, game network, gpgs, leaderboards, loadScores
See also gpgs.leaderboards
gpgs.*

Overview

Retrieves scores from a specified leaderboard.

Syntax

gpgs.leaderboards.loadScores( params )
params (required)

Table. Contains parameters for the call — see the next section for details.

Parameter Reference

The params table contains parameters for the call.

leaderboardId (required)

String. Leaderboard ID from which to load scores.

position (optional)

String. One of the following values:

  • "top" — the top scores (default).
  • "single" — the current player's score.
  • "centered" — scores around the current player's score.
friendsOnly (optional)

Boolean. If true, loads only scores for the current player's friends.

limit (optional)

Number. Number of scores to load. The maximum and default is 25.

timeSpan (optional)

String. One of the following values:

  • "all time" — all scores (default).
  • "weekly" — scores from the week.
  • "daily" — scores from the day.
reload (optional)

Boolean. If true, the data will be retrieved fresh, not from a cache.

listener (optional)

Listener. Listener function which receives a loadScores event.