Categories > Newgrounds.io > rex_ngio_medal

Introduction

Handles loading and unlocking of medals.

Links


Categories > Newgrounds.io > rex_ngio_medalIntroductionLinksDependenceUsagePrepareManage medalsGet listUnlock

Dependence

Usage

Sample capx

Prepare

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

Manage medals

Mange medals in dashboard, API Tools, Medals.

Get list

Callback
Yes
No
Action
is success
Condition:On get medals list

Expression:MedalsAsJSON
Expression:MedalsCount
Condition:On get medals list error
Condition:For each medal

Expression:CurMedalName
Expression:CurMedalID
Expression:CurMedalIcon
Expression:CurMedalDifficulty
Expression:CurMedalDescription
Expression:CurMedalValue
Expression:CurMedalIsSecret
Expression:CurMedalIsUnlocked

Condition:Is secret
Condition:Is unlocked
Condition:Compare difficulty
Expression:ErrorMessage
Action:Get list

  1. Action:Get list

  2. Callback

    • Success : Condition:On get medals list error

      • Expression:MedalsAsJSON

      • Expression:MedalsCount

      • Condition:For each medal

        • Expression:CurMedalName

        • Expression:CurMedalID

        • Expression:CurMedalIcon

          • Load icon into image element
          • Icon can Not load into official sprite
        • Expression:CurMedalDifficulty

        • Expression:CurMedalDescription

        • Expression:CurMedalValue

        • Expression:CurMedalIsSecret, returns 1 if this medal is secret

        • Expression:CurMedalIsUnlocked, returns 1 if this medal is unlocked

        • Condition:Is secret

        • Condition:Is unlocked

        • Condition:Compare difficulty

        • Expression:LoopIndex, index in this for each loop

      • Get medal by index

        • Expression:Index2MedalName( index )

        • Expression:Index2MedalID( index )

        • Expression:Index2MedalIcon( index )

          • Load icon into image element
          • Icon can Not load into official sprite
        • Expression:Index2MedalDifficulty( index )

        • Expression:Index2MedalDescription( index )

        • Expression:Index2MedalValue( index )

        • Expression:Index2MedalIsSecret( index ), returns 1 if this medal is secret

        • Expression:Index2MedalIsUnlocked( index ), returns 1 if this medal is unlocked

        • Condition:Is secret

        • Condition:Is unlocked

        • Condition:Compare difficulty

    • Error : Condition:On get medals list error

      • Expression:ErrorMessage

Unlock

Callback
Yes
No
Action
is success
Condition:On unlock medal
Condition:On unlock medal error
Expression:LastUnlockedMedalID
Expression:ErrorMessage
Action:Unlock
  1. Action:Unlock

  2. Callback

    • Success : Condition:On unlock medal

      • Expression:LastUnlockedMedalID
    • Error : Condition:On unlock medal error

      • Expression:ErrorMessage