GitXplorerGitXplorer
J

librpg

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
28709f9ccbbe0426c5e79e80a4b90dcaf8d25cfe

cleanup

JJumpLink committed 12 years ago
Unverified
262fe7162ad2821cf3378ecbef44778e65d75864

json-string support for spritesets

JJumpLink committed 12 years ago
Unverified
db012554164b6301f217c7bbcec407363643830b

json-support for spritesets (untested)

JJumpLink committed 12 years ago
Unverified
194fee37159c8f5c6abce2ae3b70c2e68c628333

json-support for sprit, spriteanimation, spriteframe and spritelayer (untested)

JJumpLink committed 12 years ago
Unverified
e073c24319c843cf04312ce68f5c6ab31d5ce797

cleanup

JJumpLink committed 12 years ago
Unverified
1353cab643260f75855d175487a10e8f0643869b

removed unused functions and fix error with incorrect pixels

JJumpLink committed 12 years ago

README

The README file for this repository.

librpg

Librpg is a library to handle maps from Tiled to use it in your own Game, also librpg can handle sprites, tilesets and more! Librpg is written in Vala and you can use it with Vala, JavaScript, Python, Lua, .NET any other language which has GObject Introspection bindings.

Documentation

Example

using rpg;
class Main : Object {
	public static int main (string[] args) {
		var data = new rpg.ResourceManager();
		data.load_spriteset_manager("./data/spriteset/");
		data.load_tileset_manager("./data/tileset/");
		data.load_map_manager("./data/map/");
		var map = data.mapmanager.get_from_filename("testmap.tmx");
		var layer = map.get_layer_from_index(0);
		var tile = layer.tiles[0,0]; //get tile x y
		layer.merge(16,16);
		layer.tex.save("test.png");
		map.merge();

		print("layers_same(index:0) -> name:%s, width:%u, height:%u, zoff:%f\n", layer.name, layer.width, layer.height, layer.zoff);
		print("tile(x:0,y:0) -> gid:%i, width:%f, height:%f\n", tile.gid, tile.width, tile.height);
		print("textur: colorspace:%s\n", tile.tex.colorspace.to_string());
		
		return 0;
	}
}

Compile

valac sample.vala --pkg rpg-0.3 --pkg gee-1.0 --pkg gio-2.0 --pkg gdk-pixbuf-2.0 --pkg Sxml-0.1
./sample

Practical Examples

This Libary is used by HMWworld and HMWorld-Website.

Extensions

If you want to use OpenGL you could use the OpenGL Extension librpggl.

Install

First you need to install Sxml.

Debian

    apt-get install libgirepository1.0-dev libgee-dev gobject-introspection libgtk2.0-dev gir1.2-glib-2.0
    make
    make install

Things which work

  • Load tmx-maps (uncompressed and compressed)
  • Export Map Layer as png
  • Load Sprites
  • Load TileSets
  • Get Map as Json

Things which dont work (correct)

  • Map-Objects
  • Load Dialogs