GitXplorerGitXplorer
J

librpg

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
ea22ee46b97dcdf05f38c5b2d241ed27a2ee4951

Merge branch 'master' of github.com:JumpLink/librpg

JJumpLink committed 12 years ago
Unverified
9e65c33ee3b606de9b1887ce9016bff0b18c56d2

return tex properity on the fly

JJumpLink committed 12 years ago
Unverified
d832c0b97d8d4b8610d653f7e274f12c3735e79d

return null or -1 on error

JJumpLink committed 12 years ago
Unverified
813d9d05995a76b84e7c54972031cd138834ecc5

Update README.md

JJumpLink committed 12 years ago
Unverified
20e59c98ee01055e2cced58f81da09ab349ca9c4

Update README.md

JJumpLink committed 12 years ago
Unverified
a52a03cb6501e0f4b6f815ab9285d8c057a114cc

Update README.md

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