PHP code example of rogiel / star-map

1. Go to this page and download the library: Download rogiel/star-map 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/ */

    

rogiel / star-map example snippets


use Rogiel\StarMap\Map;

// Parse the map
$map = new Map('Ruins of Seras.SC2Map');

// Get the map name in multiple locales
$documentHeader = $map->getDocumentHeader();

echo sprintf('Map name (English): %s', $documentHeader->getName()).PHP_EOL; // english is default
echo sprintf('Map name (French): %s', $documentHeader->getName('frFR')).PHP_EOL;

// Get the map size
$mapInfo = $map->getMapInfo();
$x = $mapInfo->getWidth();
$y = $mapInfo->getHeight();
echo sprintf('Map size: %sx%s', $x, $y).PHP_EOL;

// Export Minimap image as a PNG
$map->getMinimap()->toPNG('Minimap.png');