Game::TextMapper::Mapper - a text map parser and builder
use Modern::Perl; use Game::TextMapper::Mapper::Hex; my $map = <<EOT; 0101 forest include default.txt EOT my $svg = Game::TextMapper::Mapper::Hex->new(dist_dir => 'share') ->initialize($map) ->svg(); print $svg;
This class knows how to parse a text containing a map description into SVG definitions, and regions. Once the map is built, this class knows how to generate the SVG for the entire map.
The details depend on whether the map is a hex map or a square map. You should use the appropriate class instead of this one: Game::TextMapper::Mapper::Hex or Game::TextMapper::Mapper::Square.
You need to pass this during instantiation so that the mapper knows where to find files it needs to include.
Call this to load a map into the mapper.
This method generates the SVG once the map is initialized.
Game::TextMapper::Mapper::Hex is for hex maps.
Game::TextMapper::Mapper::Square is for square maps.
To install Game::TextMapper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Game::TextMapper
CPAN shell
perl -MCPAN -e shell install Game::TextMapper
For more information on module installation, please visit the detailed CPAN module installation guide.