here is an example of 2 chars on 1 sig.
its very basic.. but hopefully youll get the gist.
http://freewaffles.hostoi.com/ls/test/don.png
Code
<?php
Header ('Content-type: image/png');
Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
Header('Pragma: no-cache');
/******************************************************
* BASICS *
******************************************************/
// create the image from a background png
$image = imagecreatefrompng('bg.png');
// set some colours for future use
$cool = imagecolorallocate($image, 81, 86, 96);
$red = imagecolorallocate($image, 255, 0, 0);
$yellow = imagecolorallocate($image, 255, 181, 53);
// set the font and print text
$font = '/ddbb.ttf';
/******************************************************
* LOAD DATA *
******************************************************/
// Create an array for determining the class you play.
// In the XML this is saved as an int number, the conversion is shown below.
$class_name = array( -1 => 'None',
0 => 'Fighter',
1 => 'Barbarian',
2 => 'Rogue',
3 => 'Magician',
4 => 'Guardian',
5 => 'Samurai',
6 => 'Paladin',
7 => 'Monk',
8 => 'Ninja',
9 => 'Warlock',
10 => 'Headhunter',
11=> 'Alchemist');
// This is where you load your own info from the xml d2jsp gives. This is a PHP5 only
command!
$data = simplexml_load_file('http://ladderslasher.d2jsp.org/xmlChar.php?i=155121');
$data2 = simplexml_load_file('http://ladderslasher.d2jsp.org/xmlChar.php?i=105404');
$name = $data->name;
$name2 = $data2->name;
$class = $class_name[(int)$data->classid];
$class2 = $class_name[(int)$data2->classid];
$level = $data->level;
$level2 = $data2->level;
/******************************************************
* TEXT PART *
******************************************************/
//Example; ImageTTFText ($image, textsize, angle, right indent, down indent, color, font,
"text");
//show name
ImageTTFText ($image, 9, 0, 120, 33, $yellow, $font, "Name: ");
ImageTTFText ($image, 9, 0, 150, 33, $red, $font, $name);
//show level
ImageTTFText ($image, 9, 0, 210, 33, $yellow, $font, "Level: ");
ImageTTFText ($image, 9, 0, 245, 33, $red, $font, $level);
//show class
ImageTTFText ($image, 9, 0, 270, 33, $yellow, $font, "Class: ");
ImageTTFText ($image, 9, 0, 310, 33, $red, $font, $class);
// show name2
ImageTTFText ($image, 9, 0, 120, 45, $yellow, $font, "Name: ");
ImageTTFText ($image, 9, 0, 150, 45, $red, $font, $name2);
//show level2
ImageTTFText ($image, 9, 0, 210, 45, $yellow, $font, "Level: ");
ImageTTFText ($image, 9, 0, 245, 45, $red, $font, $level2);
// show class 2
ImageTTFText ($image, 9, 0, 270, 45, $yellow, $font, "Class: ");
ImageTTFText ($image, 9, 0, 310, 45, $red, $font, $class2);
// output and destroy
imagepng($image);
imagedestroy($image);
?>