getName(); $x2 = 113; $y2 = 28; $textcolor2 = imagecolorallocate ($im, 253, 258, 10); @imagettftext($im, $size2, $angle, $x2, $y2, $textcolor2, $font, $text2); //text est Nbjoueurs / Max joueurs //****************************** $play = $srv->getNbPlayers(); $max = $srv->getMaxPlayers(); $text = "Joueurs : "; $text.= $play; $text.= " / "; $text.= $max; //$x = (imagesx($im)-$box["width"])/2-1; $x=110; $y =45; $textcolor = imagecolorallocate ($im, 253, 238, 1); @imagettftext($im, $size, $angle, $x2, $y, $textcolor, $font, $text); //@imagefilledrectangle ($im, 110, 25, 295, 29, $backgroundcolor); //text3 donne la carte en cours //****************************** $text3 = "Map : "; $text3.= $srv->getMap(); $y3 = 65; $textcolor3 = imagecolorallocate ($im, 253, 238, 1); @imagettftext($im, $size, $angle, $x2, $y3, $textcolor3, $font, $text3); //text4 le powered //****************************** //@imagefilledrectangle ($im, 120, 72, 300, 74, $backgroundcolor); $text4 = "Powered by www.clansk.org"; $textcolor4 = imagecolorallocate ($im, 200, 100, 0); $size4 = 7; $y4 = 98; @imagettftext($im, $size4, $angle, 15, $y4, $textcolor4, $font, $text4); //text5 IP:port //****************************** $text5 = "IP:PORT --> "; $text5.= $srv->getIp(); $text5.= ":"; $text5.= $srv->getPort(); $textcolor5 = imagecolorallocate ($im, 253, 238, 1); $size5 = 8; $y5 = 82; @imagettftext($im, $size5, $angle, 113, $y5, $textcolor5, $font, $text5); $box = fixbbox(@imagettfbbox ($size, $angle, $font, $text)); //imagegif ($im); imagepng ($im); imagedestroy($im); function fixbbox($bbox) { $tmp_bbox["left"] = min($bbox[0],$bbox[2],$bbox[4],$bbox[6]); $tmp_bbox["top"] = min($bbox[1],$bbox[3],$bbox[5],$bbox[7]); $tmp_bbox["width"] = max($bbox[0],$bbox[2],$bbox[4],$bbox[6]) - min($bbox[0],$bbox[2],$bbox[4],$bbox[6]) + 1; $tmp_bbox["height"] = max($bbox[1],$bbox[3],$bbox[5],$bbox[7]) - min($bbox[1],$bbox[3],$bbox[5],$bbox[7]); $tmp_bbox["left"] = 0 - $tmp_bbox["left"]; $tmp_bbox["top"] = 0 - $tmp_bbox["top"]; return $tmp_bbox; } ?>