Haxe bindings for GameJolt API.
You can install it through Haxelib
haxelib install hxgamejolt-api
Or through Git
, if you want the latest updates
haxelib git hxgamejolt-api https://github.com/MAJigsaw77/hxgamejolt-api.git
import hxgamejolt.GameJolt;
GameJolt.init('game id', 'private key');
// Basic API
GameJolt.authUser('user name', 'user token', {
onSucceed: function(data:Dynamic):Void
{
// your code
},
onFail: function(message:String):Void
{
trace(message);
}
}).requestData();
GameJolt.fetchUser('user name', [], {
onSucceed: function(data:Dynamic):Void
{
// your code
},
onFail: function(message:String):Void
{
trace(message);
}
}).requestData();
// Batch Requests
final addTrophyResponse:EmptyResponseCallbacks = {
onSucceed: function():Void
{
// your code
},
onFail: function(message:String):Void
{
trace(message);
}
};
final addTrophyRequest0:GameJoltHttp = GameJolt.addTrophy('user name', 'user token', 0, addTrophyResponse);
final addTrophyRequest1:GameJoltHttp = GameJolt.addTrophy('user name', 'user token', 0, addTrophyResponse);
final addTrophyRequest2:GameJoltHttp = GameJolt.addTrophy('user name', 'user token', 0, addTrophyResponse);
GameJolt.batchRequest([addTrophyRequest0, addTrophyRequest1, addTrophyRequest2], {
onSucceed: function():Void
{
// your code
},
onFail: function(msg:String):Void
{
trace(message);
}
});
hxgamejolt-api is made available under the MIT License. Check LICENSE for more information.