00:00
00:00
Newgrounds Background Image Theme

Kingkavvvv just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Newgrounds Wiki: ScoreBoard

Description Handles loading and posting of high scores and scoreboards.

ScoreBoard.getBoards

Returns a list of available scoreboards.

Returns:

scoreboards - array<ScoreBoard>
An array of scoreboard objects.

ScoreBoard.getScores

Loads a list of score objects from a scoreboard. Use 'skip' and 'limit' for getting different pages.

Parameters:

app_id - string
The App ID of another, approved app to load scores from. (optional)

id - int
The numeric ID of the scoreboard.

limit - int
An integer indicating the number of scores to include in the list. Default = 10. (optional)

period - string
The time-frame to pull scores from (see notes for acceptable values). (optional)

skip - int
An integer indicating the number of scores to skip before starting the list. Default = 0. (optional)

social - boolean
If set to true, only social scores will be loaded (scores by the user and their friends). This param will be ignored if there is no valid session id and the 'user' param is absent. (optional)

tag - string
A tag to filter results by. (optional)

user - mixed
A user's ID or name. If 'social' is true, this user and their friends will be included. Otherwise, only scores for this user will be loaded. If this param is missing and there is a valid session id, that user will be used by default. (optional)

Returns:

app_id - string
The App ID of any external app these scores were loaded from.

limit - int
The query skip that was used.

period - string
The time-frame the scores belong to. See notes for acceptable values.

scoreboard - ScoreBoard
The scoreboard being queried.

scores - array<Score>
An array of score objects.

social - boolean
Will return true if scores were loaded in social context ('social' set to true and a session or 'user' were provided).

user - User
The user the score list is associated with (either as defined in the 'user' param, or extracted from the current session when 'social' is set to true)

Notes:

Acceptable 'period' values:
"D" = current day (default)
"W" = current week
"M" = current month
"Y" = current year
"A" = all-time

ScoreBoard.postScore

Posts a score to the specified scoreboard.

Parameters:

id - int
The numeric ID of the scoreboard.

tag - string
An optional tag that can be used to filter scores via ScoreBoard.getScores (optional)

value - int
The int value of the score.

Returns:

score - Score
The score that was posted to the board.

scoreboard - ScoreBoard
The scoreboard that was posted to.

Notes:

If this board uses incremental scores, the new total score value will be returned.
This method can use [wiki:wiki/creator-resources/newgrounds-apis/newgrounds-io/encryption encryption].