I made an exp bar image, you can configure the height and the width of it, or just the standard (width = 100, height = 20)
Configured one:
Code: Select all
http://skillaria.byethost3.com/phpimages/bar.php?amount=25&width=200&height=100
Code: Select all
http://skillaria.byethost3.com/phpimages/bar.php?amount=90
Code: Select all
<?php
if(!isset($_GET['height'])) {
$height = 20;
} else {
$height = $_GET['height'];
}
if(!isset($_GET['width'])) {
$width = 100;
} else {
$width = $_GET['width'];
}
$amount = intval($_GET['amount']);
$im = Imagecreatetruecolor($width, $height);
$red = Imagecolorallocate($im, 255, 0, 0);
$green = Imagecolorallocate($im, 0, 255, 0);
imagefill($im, 0, 0, $red);
imagefilledrectangle($im, 0, 0, $amount * $width/100, $height, $green);
$border = ImageColorAllocate($im, 0, 0, 0);
ImageRectangle($im, 0, 0, $width - 1, $height - 1, $border);
$font = 3;
$font_width = ImageFontWidth($font);
$font_height = ImageFontHeight($font);
$text = $amount . "%";
$text_width = $font_width * strlen($text);
$position_center = ceil(($width - $text_width) / 2);
$text_height = $font_height;
$position_middle = ceil(($height - $text_height) / 2);
$textcolor = imagecolorallocate($im, 0, 0, 0);
ImageString($im, $font, $position_center, $position_middle, $text, $textcolor);
header("Content-type: image/png");
Imagepng($im);
Imagedestroy($im);
?>
Have fun!