Пример #1
0
 Mapa::getArea(4, 0)->setTipo(AREA_FORA);
 Mapa::getArea(0, 4)->setTipo(AREA_FORA);
 Mapa::getArea(1, 4)->setTipo(AREA_FORA);
 Mapa::getArea(3, 4)->setTipo(AREA_FORA);
 Mapa::getArea(4, 4)->setTipo(AREA_FORA);
 if ($gerar) {
     $width = Mapa::getTileAreaWidth();
     $height = Mapa::getTileAreaHeight();
     $height -= floor(Mapa::getHexWidth() / 2);
     $image2 = imagecreatetruecolor($width, $height);
     imagealphablending($image2, false);
     imagesavealpha($image2, true);
     $bg = imagecolorallocatealpha($image2, 255, 255, 255, 127);
     imagefilledrectangle($image2, 0, 0, $width, $height, $bg);
 } else {
     $image = Mapa::gerarConfiguracao();
     $width = imagesx($image);
     $height = imagesy($image);
     $height -= floor(Mapa::getHexWidth() / 2);
     $image2 = imagecreatetruecolor($width, $height);
     imagecopy($image2, $image, 0, 0, 0, 0, $width, imagesy($image));
 }
 $arte->carregarArquivo();
 $arte->resizeToHeight($altura);
 $token = $arte->getImagem();
 $dst_w = imagesx($token);
 $dst_h = $altura;
 $dst_x = floor(($width - $dst_w) / 2) + $margin_left;
 $dst_y = floor(($height - $dst_y) / 2) + $margin_top;
 if ($rotate > 0) {
     $bg = imagecolorallocatealpha($token, 0, 0, 0, 127);