Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Parses TMX files from the Tiled map editor
Perl
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
eg
lib/Games/TMX
t
README
dist.ini

README

Games::Tmx::Parser
==================

Parses TMX files from the Tiled map game editor:

http://www.mapeditor.org/

Draw your maps in Tiled, then use this module to parse and build maps and
waypoints for your game.

Provides a simple OO XML::Twig-like API for accessing every corner of the map
object model.


Usage
-----

In Tiled, draw your map and place properties as markers on special tiles you
want to read in Perl. Then in your Perl game, read the map and use:

    my @cells = $map->get_layer('layer_with_stuff')
                    ->find_cells_with_property('my_special_tile_marker');
 
To find your special cells (spawn points, enemy locations, etc.).

Draw a layer by iteating over:

    @{ $layer->rows };

Which will give you an ARRAY ref of cells, one per column. Then you can find
the tile of the cell using:

    $cell->tile;

And then access its properties, or cut the correct image from the tileset image file:

    $tile->tileset->image;


Requires
--------

- Moose
- XML::Twig


Not Implemented
---------------

- no support for base64 or compression of maps, uncheck the correct check boxes in Tiled before you save
- no support for object layers

Something went wrong with that request. Please try again.