Skip to content

MAJigsaw77/hxgamejolt-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hxgamejolt-api

Haxe bindings for GameJolt API.

Installation

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

Basic Usage Example

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);
	}
});

Licensing

hxgamejolt-api is made available under the MIT License. Check LICENSE for more information.

About

Haxe bindings for GameJolt API.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages