Here are some examples of maps that were generated with my code.
Don't get your hopes up entirely! You cannot give this library a BZW file and have it generate a thumbnail for you. Not yet at least. This library requires you to give it your map as a WorldDatabase from the bzflag-networking.php library. I'll get around to writing a BZW parser eventually. Maybe. Help is welcome!
Right now, the only way of getting a WorldDatabase object is to get one that's embedded from a replay file; that's how I'm achieving map thumbnails in Postgame.
Code: Select all
use allejo\bzflag\graphics\PNG\Radar\WorldRenderer as PNGWorldRenderer;
use allejo\bzflag\graphics\SVG\Radar\WorldRenderer as SVGWorldRenderer;
use allejo\bzflag\replays\Replay;
$replay = new Replay('official-match.rec');
$world = $replay->getHeader()->getWorldDatabase();
// Export as a PNG
$renderer = new PNGWorldRenderer($world);
$renderer->writeToFile("my_world.png");
// Export as an SVG
$renderer = new SVGWorldRenderer($world);
$renderer->writeToFile("my_world.svg");