Skip to content
/ tmx Public

TMX is a library for creating, parsing and editing tmx files.

License

Notifications You must be signed in to change notification settings

kreemer/tmx

Repository files navigation

TMX [Continuous Integration]

Total Downloads Latest Stable Version Code Coverage

TMX is a library for creating, parsing and editing tmx files. The main purpose is to parse a tmx file and save the parsed file as image file.

The tmx format is used by the program Tiled. The format is explained here.

Installation

Install the latest version with

$ composer require kreemer/tmx

Basic Usage

<?php

use Tmx\Service\Parser;
use Tmx\Service\Printer;

$parser = new Parser();
$map = $parser->parse('filename.tmx');

echo $map->getWidth(); // get width of map
echo $map->getHeight(); // get height of map

$printer = new Printer();
$printer->print($map, 'output.png'); // save map to output.png

Documentation

See here for additional documentation.

About

Requirements

  • Tmx works with PHP 7.4 or above.
  • You have to install the imagick extension, gd support is currently under development
  • If you want to parse zlib or zstd compressed maps, you have to install these extensions

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub

Attribution

This library uses Serene village revamped tiles for automatic tests. The tileset is under the Creative commons license.

Please support the original developer for this wonderful tileset.

License

Tmx is licensed under the MIT License - see the LICENSE file for details.

About

TMX is a library for creating, parsing and editing tmx files.

Resources

License

Stars

Watchers

Forks

Languages