GameArkAPI Developer Zone
· Where can I get the API?
· How do I import the class?
· How do I configure the API?
· Where do I find my game tag and board ID?
· How do I submit a score?
· How do I show the score window?

Where can I get the API?

You can download the GameArkAPI here: GameArkAPI.zip

How do I import the API?

Simply add the SWC to your library and you're all set.

How do I configure the API?

To configure the GameArkAPI for use in your game, just pass the game tag and board ID into the static config method, along with a container for the API to load into, and an optional callback function.
GameArkAPI.config(container_:DisplayObjectContainer, gameTag_:String, boardID_:String, onClose_:Function):void It is important to do this before you try to submit a score, preferably at the start of your game.
Example

// for attaching directly to the stage
GameArkAPI.config(stage, "my-awesome-game", da1e100dc9e7bebb810985e37875de38, myCloseFunction);

// if you don't want to use a callback
GameArkAPI.config(stage, "my-awesome-game", da1e100dc9e7bebb810985e37875de38, null);

Where do I find my game tag and board ID?

Your sponsor contact should have provided you with your game tag and board ID. If you are unable to find either, please contact your sponsor contact and request them.

Your game tag is usually the name of your game, lowercase, with hyphens instead of spaces and underscores.

Example

Game Name: My Awesome Game
Game Tag: my-awesome-game

Your board ID will be a 32-character string of letters and numbers.

Example

Board ID: da1e100dc9e7bebb810985e37875de38

How do I submit a score?

Once everything is configured properly, you are ready to submit a score to the server. To do this, simply pass your score variable into the static submitScore method.
GameArkAPI.submitScore(score_:Number):void Example

// somewhere in your game over logic
GameArkAPI.submitScore(finalScore);

How do I show the score window?

If you want to show the score window without first submitting a score, just use the appropriate method.
GameArkAPI.showScores():void Example

// in the event handler for a button click
GameArkAPI.showScores();