Yeah not done yet. Im doing the coloring atm.
Edit: works:
Code:
generate_colors.php:
[php]<?php
$img = imagecreatefrompng("r.png");
$count = 18;
$sx = 2;
$sy = 6;
$step = 9;
$xpos = $sx;
$colors = array();
for($u = 0; $u < $count; $u++){
$color_border = imagecolorat($img, $xpos-1, $sy);
$color_high = imagecolorat($img, $xpos, $sy);
$color_high_mix = imagecolorat($img, $xpos+1, $sy);
$color_main = imagecolorat($img, $xpos, $sy+1);
$colors[] = array($color_border, $color_main, $color_high, $color_high_mix);
$xpos += $step;
}
imagedestroy($img);
for($u = 1; $u < $count; $u++){
$img = imagecreatefrompng("gta2font_normal.png");
imagesavealpha($img, true);
$width = imagesx($img);
$height = imagesy($img);
for($y = 0; $y < $height; $y++){
for($x = 0; $x < $width; $x++){
$color = imagecolorat($img, $x, $y);
if($color == $colors[0][0]){
imagesetpixel($img, $x, $y, $colors[$u][0]);
}else if($color == $colors[0][1]){
imagesetpixel($img, $x, $y, $colors[$u][1]);
}else if($color == $colors[0][2]){
imagesetpixel($img, $x, $y, $colors[$u][2]);
}else if($color == $colors[0][3]){
imagesetpixel($img, $x, $y, $colors[$u][3]);
}
}
}
imagepng($img, "gta2font_normal_c{$u}.png");
imagedestroy($img);
}
?>[/php]
gta2text.php (replace the normal font loader):
[php]
// load font (and get $font_height at same time):
if($font_style == 0 && $color_style > 0 && $color_style < 18){
$fnt = imagecreatefrompng("gta2font_normal_c{$color_style}.png");
}else{
$fnt = imagecreatefrompng("gta2font_{$typestr}.png");
}[/php]