PHP code example of kreemer / tmx

1. Go to this page and download the library: Download kreemer/tmx library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kreemer / tmx example snippets




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