Sousis dimention tables et images
Posté : 11 janv. 2010, 17:29
Bonjour,
Je crée un Rpg en php et j'ai un petit problème avec la carte :euh:
la carte est fragmentée en petites cases 30*30 j'aimerais tout redimensionner pour avoir des cases de 43*43.
J'ai essayé a plusieurs reprise sans y parvenir voici le code de l'affichage :

Un grand Merci d'avance :p
Je crée un Rpg en php et j'ai un petit problème avec la carte :euh:
la carte est fragmentée en petites cases 30*30 j'aimerais tout redimensionner pour avoir des cases de 43*43.
J'ai essayé a plusieurs reprise sans y parvenir voici le code de l'affichage :
Voila ce que ca donne :echo " <table width=\"490\" height=\"9\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">
<tr>
<td height=\"9\" width=\"490\" background=\"images/carte/b1.gif\" colspan=\"3\" ></td></td>
</tr>
<tr>
<td height=\"300\" width=\"9\" background=\"images/carte/b3.gif\"></td>
<td width=\"472\" height=\"300\" align=\"center\" background=\"images/carte/herbe.jpg\" >";
echo "<table width=\"472\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"300\" align=\"center\">\n";
echo "<tr>";
while ($latitude >= $latmin ) {
$longitude = $longmin;
while ($longitude <= $longmax) {
// infos personage
$perso = mysql_query("SELECT charname, avatar FROM rpg_membres WHERE latitude='$latitude' AND longitude='$longitude' LIMIT 1");
$persorow = mysql_fetch_array($perso);
//infos map
$query2 = mysql_query("SELECT nom FROM rpg_sol WHERE lati='$latitude' AND longi='$longitude' LIMIT 1");
$fetcht = mysql_fetch_array($query2);
$sol = $fetcht['nom'];
// infos Maisons
$query3 = mysql_query("SELECT name FROM rpg_maison WHERE latitude='$latitude' AND longitude='$longitude' LIMIT 1");
$fetcht = mysql_fetch_array($query3);
$maison = $fetcht['name'];
// infos Villes
$query4 = mysql_query("SELECT name FROM rpg_towns WHERE latitude='$latitude' AND longitude='$longitude' LIMIT 1");
$fetcht = mysql_fetch_array($query4);
$villes = $fetcht['name'];
if($villes !='')
{echo "<td><img src=\"images/carte/ville.jpg\" width=\"30\" height=\"30\" border=\"0\" title=\"".$villes."\"></td>"; }
else {
if($persorow['avatar']!='') {
echo "<td><img src=\"images/avatar/carte/".$persorow['avatar'].".gif\" width=\"30\" height=\"30\" border=\"0\" title=\"".$persorow['charname']." (".$longitude." , ".$latitude.") est ici\"></td>";
} else {
if($maison !='')
{echo "<td><img src=\"images/carte/maison.jpg\" width=\"30\" height=\"30\" border=\"0\" title=\"Maison de ".$maison."\"></td>"; }
else {
if($sol !='') {
echo "<td style=\"background-image:url(images/carte/".$sol.".gif)\" width=\"30\" height=\"30\"></td>"; }
else {
echo "<td width=\"30\" height=\"30\"></td>\n";
}
}
}
}
$longitude++;
}
echo "</td></tr>";
$latitude--;
}
echo "</table>";
echo " </td>
<td height=\"300\" width=\"9\" background=\"images/carte/b4.gif\"></td>
</tr>
<tr>
<td colspan=\"3\" height=\"9\" width=\"490\" background=\"images/carte/b2.gif\"></td>
</tr>
</table>";

Un grand Merci d'avance :p