Game-TextMapper

 view release on metacpan or  search on metacpan

lib/Game/TextMapper/Traveller.pm  view on Meta::CPAN

  my $text = "";
  for my $x (0 .. $self->cols - 1) {
    for my $y (0 .. $self->rows - 1) {
      my $tile = $tiles->[$x + $y * $self->cols];
      if ($tile) {
	$text .= sprintf("%02d%02d @$tile\n", $x + 1, $y + 1);
      }
    }
  }
  $text .= join("\n", @$comms, "\ninclude traveller.txt\n");
  $text .= $self->legend();
  return $text;
}

sub legend {
  my $self = shift;
  my $template = qq{# frame and legend};
  my $x = int(($self->cols + 1) * 1.5 * $dx);
  my $y = int(($self->rows + 1) * $dy + 5);
  $template .= qq{
other <rect fill="none" stroke="black" stroke-width="10" x="0" y="-50" width="$x" height="$y" />},
  $x = int(($self->cols + 1) * 0.75 * $dx);
  $y = int(($self->rows + 1) * $dy - 60);
  $template .= qq{
other <text font-size="24pt" y="-10" x="$x" font-family="Optima, Helvetica, sans-serif" text-anchor="middle">coreward</text>
other <text font-size="24pt" y="$y" x="$x" font-family="Optima, Helvetica, sans-serif" text-anchor="middle">rimward</text>};
  $x = int($self->rows * $dy / 2);

share/traveller-original.svg  view on Meta::CPAN

      }
      .coordinates {
        fill-opacity: 0.5;
      }
      .starport, .base {
        font-size: 20pt;
      }
      .direction {
        font-size: 24pt;
      }
      .legend {
        text-anchor: start;
        font-size: 14pt;
      }
      tspan.comm {
        fill: #ff6347; /* tomato */
      }
      line.comm {
        stroke-width: 10pt;
        stroke: #ff6347; /* tomato */
      }

share/traveller-original.svg  view on Meta::CPAN

    <use xlink:href="#hex" x="1150.000" y="1385.641"/>
    <text class="coordinates" x="1150.000" y="1325.641">0808</text>

    <use xlink:href="#hex" x="1150.000" y="1558.846"/>
    <text class="coordinates" x="1150.000" y="1498.846">0809</text>

    <use xlink:href="#hex" x="1150.000" y="1732.051"/>
    <text class="coordinates" x="1150.000" y="1672.051">0810</text>
  </g>

  <g id='legend'>
    <text class="legend" x="-10.000" y="1905.256">◉ gas giant – ■ imperial consulate – ☼ TAS – ▲ scout base – ★ navy base – π research base – ☠ pirate base – <tspan class="comm">▮</tspan> communication – <tspan class="t...
    <text class="direction" x="600.000" y="-13.000">coreward</text>
    <text transform="translate(1260.000,866.025) rotate(90)" class="direction">trailing</text>
    <text class="direction" x="600.000" y="1853.294">rimward</text>
    <text transform="translate(-10.000,866.025) rotate(-90)" class="direction">spinward</text>
  </g>

  <g id='system'>
  <a xlink:href="https://campaignwiki.org/wiki/NameOfYourWiki/Inedgeus">
    <g id="Inedgeus">
      <circle cx="100.000" cy="86.603" r="18.000" />

share/traveller-square-example.svg  view on Meta::CPAN

# alert status
red xml <circle r="48" fill="red" opacity="0.3"/>
amber xml <circle r="48" fill="none" stroke="black" stroke-width="1" opacity="0.3"/>

text font-size="16pt" dy="15px" font-family="Optima, Helvetica, sans-serif" fill-opacity="0.5"
label font-size="16pt" font-family="Optima, Helvetica, sans-serif"

communication path attributes stroke="#ff6347" stroke-width="10pt" fill="none" opacity="0.7"
trade path attributes stroke="#afeeee" stroke-width="6pt" fill="none" opacity="0.7"

# frame and legend
other <rect fill="none" stroke="black" stroke-width="10" x="30" y="30" width="1500" height="1840" />
other <text font-size="24pt" y="70px" x="730px" font-family="Optima, Helvetica, sans-serif">coreward</text>
other <text font-size="24pt" y="1850px" x="730px" font-family="Optima, Helvetica, sans-serif">rimward</text>
other <text font-size="24pt" x="0" y="0" transform="translate(70,1020) rotate(-90) " font-family="Optima, Helvetica, sans-serif">spinward</text>
other <text font-size="24pt" x="0" y="0" transform="translate(1490,900) rotate(90) " font-family="Optima, Helvetica, sans-serif">trailing</text>
other <text font-size="14pt" x="0" y="0" transform="translate(10,1850) rotate(-90) " font-family="Optima, Helvetica, sans-serif">◉ gas giant – ■ imperial consulate – ☼ TAS – ▲ scout base – ★ navy base – π research base – ☠ pi...

# This file is for use with text-mapper.
# https://alexschroeder.ch/cgit/text-mapper/about/

share/traveller-square.txt  view on Meta::CPAN

# alert status
red xml <circle r="48" fill="red" opacity="0.3"/>
amber xml <circle r="48" fill="none" stroke="black" stroke-width="1" opacity="0.3"/>

text font-size="16pt" dy="15px" font-family="Optima, Helvetica, sans-serif" fill-opacity="0.5"
label font-size="16pt" font-family="Optima, Helvetica, sans-serif"

communication path attributes stroke="#ff6347" stroke-width="10pt" fill="none" opacity="0.7"
trade path attributes stroke="#afeeee" stroke-width="6pt" fill="none" opacity="0.7"

# frame and legend
other <rect fill="none" stroke="black" stroke-width="10" x="30" y="30" width="1500" height="1840" />
other <text font-size="24pt" y="70px" x="730px" font-family="Optima, Helvetica, sans-serif">coreward</text>
other <text font-size="24pt" y="1850px" x="730px" font-family="Optima, Helvetica, sans-serif">rimward</text>
other <text font-size="24pt" x="0" y="0" transform="translate(70,1020) rotate(-90) " font-family="Optima, Helvetica, sans-serif">spinward</text>
other <text font-size="24pt" x="0" y="0" transform="translate(1490,900) rotate(90) " font-family="Optima, Helvetica, sans-serif">trailing</text>
other <text font-size="14pt" x="0" y="0" transform="translate(10,1850) rotate(-90) " font-family="Optima, Helvetica, sans-serif">◉ gas giant – ■ imperial consulate – ☼ TAS – ▲ scout base – ★ navy base – π research base – ☠ pi...



( run in 1.348 second using v1.01-cache-2.11-cpan-49f99fa48dc )