Hi - Have been AWOL due to RL issues.... No, not fixed yet, and I truly don't understand what's wrong. Below is the complete code for the map_generate.php
header("Content-type: image/png");
$map = imagecreatefrompng('../../resources/images/scenario_1_map.png') or die("Cannot create basic map image");
$query_units = "SELECT * FROM otwg_e107_otwg_unit WHERE Side_ID = '1' AND Loc_X > '0'";
$result_units = mysql_query($query_units) or die("Query units failed");
while ($row_units = mysql_fetch_array($result_units, MYSQL_ASSOC))
{
$unit = imagecreatefrompng('../../resources/images/'.$row_units[Image_ID].'');
$insert_x = imagesx($unit);
$insert_y = imagesy($unit);
imagecopymerge($map,$unit,$row_units[Loc_X],$row_units[Loc_Y],0,0,$insert_x,$insert_y,100);
}
imagepng($map);
imagedestroy($map);
imagedestroy($unit);
mysql_free_result($result_units); */
The above doesn't work, while the hard coded version below does...
header("Content-type: image/png");
$map = imagecreatefrompng('../../resources/images/scenario_1_map.png') or die("Cannot create basic map image");
$unit = imagecreatefrompng('../../resources/images/green_infantry.png');
$insert_x = imagesx($unit);
$insert_y = imagesy($unit);
imagecopymerge($map,$unit,275,100,0,0,$insert_x,$insert_y,100);
imagepng($map);
imagedestroy($map);
imagedestroy($unit);
The map_display.php code is the same for both examples. Any feedback is appreciated