Categories > Newgrounds.io > rex_ngio_scoreboard

Introduction

Handles loading and posting of high scores and scoreboards.

Links


Categories > Newgrounds.io > rex_ngio_scoreboardIntroductionLinksDependenceUsagePrepareManage boardsGet boardsPost scoreGet score

Dependence

Usage

Prepare

Put rex_ngio_authentication into project, and set property App id and AES key.

Manage boards

Mange boards in dashboard, API Tools, Scoreboards.

Get boards

Callback
Yes
No
Action
is success
Condition:On get boards

Expression:BoardsAsJSON
Condition:On get boards error
Condition:For each board

Expression:CurBoardName
Expression:CurBoardID
Expression:ErrorMessage
Action:Get boards

Sample capx

  1. Action:Get boards

  2. Callback

    • Success : Condition:On get boards

      • Expression:BoardsAsJSON

      • Expression:BoardsCount

      • Condition:For each board

        • Expression:CurBoardName
        • Expression:CurBoardID
        • Expression:LoopIndex, index in this for each loop
      • Get board by index

        • Expression:Index2BoardName( index )
        • Expression:Index2BoardID( index )
    • Error : Condition:On get boards error

      • Expression:ErrorMessage

Post score

Callback
Yes
No
Action
is success
Condition:On post score
Condition:On post score error
Expression:ErrorMessage
Property ID
Action:Set board ID
Action:Post score

Sample capx

  1. Set board ID

    • Property ID, or
    • Action:Set board ID
    • Expression:BoardID
  2. Action:Post score

    • Tag for querying scores (optional)

      • Property Tag
      • Action:Set tag
      • Expression:Tag
  3. Callback

    • Success : Condition:On post score

    • Error : Condition:On post score error

      • Expression:ErrorMessage

Get score

Callback
Yes
No
Action
is success
Condition:On get scores


Expression:ScoresAsJSON
Condition:On get scores error
Condition:For each score

Expression:CurUserName
Expression:CurUserID
Expression:CurFormattedValue
Expression:CurValue
Expression:ErrorMessage
Property ID
Action:Set board ID
Start index
----
Action:Request in a range
Pages
----
Action:Turn to page
Action:Update current page
Action:Turn to next page
Action:Turn to previous page
----
Expression:PageIndex
Property Lines
  1. Set board ID

    • Property ID, or
    • Action:Set board ID
    • Expression:BoardID
  2. Request scores

    • By start index

      • Action:Request in a range
    • Page by page

      • Action:Turn to page

      • Action:Update current page

      • Action:Turn to next page

      • Action:Turn to previous page

      • Page properties:

        • Expression:PageIndex, current page index
        • Property Lines : lines of each page
    • Period, time-frame (optional)

      • Property Period

      • Action:Set period

      • Action:Set period by code

        • D : current day
        • W : current week
        • M : current month
        • Y : current year
        • A : all-time
      • Expression:Period

    • Tag for querying scores (optional)

      • Property Tag
      • Action:Set tag
      • Expression:Tag
  3. Callback

    • Success : Condition:On get scores

      • Expression:ScoresAsJSON

      • Expression:ScoresCount

      • Expression:StartIndex

      • Condition:For each score

        • Expression:CurUserName
        • Expression:CurUserID
        • Expression:CurFormattedValue
        • xpression:CurValue
        • Expression:LoopIndex, index in this for each loop
      • Get score by index of current received scores

        • Expression:Index2UserName( index )
        • Expression:Index2UserID( index )
        • Expression:Index2FormattedValue( index )
        • Expression:Index2Value( index )
    • Error : Condition:On get scores error

      • Expression:ErrorMessage