View Single Post
  #10  
Old 10-24-2009, 02:40 PM
gabeki gabeki is offline
Premium Member
 
Join Date: Oct 2009
Posts: 24
Gender: Female
Credits: 1,293
gabeki
Default RE: Display Clicks and level in Sig image

ok, there's an error at the code, the '12' at "imagestring ($image, 12, 0, $textheight, $str1, $color)" is being referred to a built-in font.. but there are only 5 built-in fonts in php, so 12 is being used as font 5

the 12 is not the size of the font, if you change 12 to 5, you'll see the result is the same. the size (width and height) of the font (each char), is placed at the font file, in this case, in the 5th built-in font

if you want to use anotehr font, you can use

$font = imageloadfont("font place here");
imagestring ($image, $font, 0, $textheight, $str1, $color);

but the font must be .gdf

here's a windows converter from ttf to gdf
http://www.wedwick.com/wftopf.exe

but.. the fonts get pretty ugly anyway -_-
so I'm using that in my site:

PHP Code:
$str1 $name;
$str2 "Level ".$currentlevel;

imagestring($image42$textheight 1$str1$color);
imagestring($image42$textheight 13,  $str2$color); 
and I changed this part also

PHP Code:
    $newheight $height 18
because my two strings occupy less space

thats it :D

- Edit -

oh, i found another thing

the $textheight determines where to place the first string of the text, it cames below the image, so this
PHP Code:
$textheight $width 2
is supposed to be
PHP Code:
$textheight $height 2
that way the text will not override the image in case the image has the width bigger than the height
Reply With Quote