function aimattftext($im, $size, $angle, $x, $y, $colour, $font, $text, $stroke = 0) { global $colBuffs; $fill = $colBuffs[$colour]; $stroke = $colBuffs[$stroke]; $size *= 1.3; $text = svgentities($text); aimaoutput($im, "<text x='{$x}' y='{$y}' font-family='{$font}' font-size='{$size}' fill='{$fill}' stroke='{$stroke}'>{$text}</text>\n"); }
function draw_village_marker($image, $entity, $village, $colour) { global $server, $cx, $cy, $zx, $zy, $zz, $lines, $imageline, $dotsize; $vx = ($village['x'] - $zx) * $zz; $vy = -($village['y'] - $zy) * $zz; if ($lines) { $imageline($image, $entity['dx'], $entity['dy'], $cx + $vx, $cy + $vy, $colour); } $name = $village['name']; $owner = $village['owner']; $guild = $village['guild']; $x = $village['x']; $y = $village['y']; $pop = $village['population']; $cohash = (256 - $y) * 512 + ($x + 257); if ($zx != 0 || $zy != 0) { $dx = $x - $zx; $dy = $y - $zy; $dist = (int) sqrt($dx * $dx + $dy * $dy); $dfz = " ({$dist} away)"; } $tip = svgentities("{$name} ({$x}, {$y}){$dfz}, {$pop}, ({$owner}, {$guild})"); aimacustom($image, "<a xlink:href='http://{$server}/karte.php?z={$cohash}' xlink:title='{$tip}'>"); dot($image, $cx + $vx, $cy + $vy, $colour, (log($pop + 1) + 1) * $dotsize); aimacustom($image, "</a>"); }