Game::TextMapper::Point::Hex - a hex on a map
use Modern::Perl; use Game::TextMapper::Point::Hex; my $hex = Game::TextMapper::Point::Hex->new(x => 1, y => 1, z => 0); say $hex->svg_region('', [0]); # <polygon id="hex110" points="50.0,86.6 100.0,173.2 200.0,173.2 250.0,86.6 200.0,0.0 100.0,0.0" />
This class holds information about a hex region: coordinates, a label, and types. Types are the kinds of symbols that can be found in the region: a keep, a tree, a mountain. They correspond to SVG definitions. The class knows how to draw a SVG polygon at the correct coordinates using these definitions.
For attributes and methods, see Game::TextMapper::Point.
Return the relative SVG coordinates of the points making up the shape, i.e. six for Game::TextMapper::Point::Hex and four for Game::TextMapper::Point::Square.
The SVG coordinates are arrays with x and y coordinates relative to the center of the shape.
This is a specialisation of Game::TextMapper::Point.
The SVG size is determined by $dx and $dy from Game::TextMapper::Constants.
$dx
$dy
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.