doupi3874 2012-11-10 13:56
浏览 42

PHP游戏瓷砖地图图像

i have tile based map

$map = '<table border="1">';
for($i = 0; $i < 4; $i++){
    $map .= '<tr>';
    for($i = 0; $i < 4; $i++){
        $map .='<td width="50" height="50"'.$bgcolor.' align="center" valign="center">
        <div id="move_'.$Tx.':'.$Ty.'">('.$Tx.','.$Ty.')</div>
        </td>'; 
    }
    $map .= '</tr>';
}
$map .= '</table>';

echo $map;

Every cell has different 10x10 pixels image .

 _ _ _ _
|_|_|_|_|
|_|_|_|_|
|_|_|_|_|
|_|_|_|_|

I need that new image apears after every 4th cell, because my images are 40x40 pixels. But

          1.image X|2. image X 
            _ _ _ _ _ _ _ _
           |_|_|_|_|_|_|_|_|
1.image Y  |_|_|_|_|_|_|_|_|
           |_|_|_|_|_|_|_|_|
           |_|_|_|_|_|_|_|_|
           |_|_|_|_|_|_|_|_|
2.image Y  |_|_|_|_|_|_|_|_|
           |_|_|_|_|_|_|_|_|
           |_|_|_|_|_|_|_|_|

I hope that you undestand me, my english is pretty bad Omerimuni

  • 写回答

2条回答 默认 最新

  • doudianhuo1129 2012-11-25 20:19
    关注

    He is trying to tilemap with HTML tables by having a 40px image overlaid onto 4x 10px table cells.

    This is really not the best way to do what you're trying to do as it will create. The main reason for this is that HTML does not like having pictured stacked over tables and the elements will not layer correctly.

    Try looking up tilemaping using HTML5's canvas. you really dont need the HTML table at all and in the end it will just make your life harder.

    评论

报告相同问题?

悬赏问题

  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型
  • ¥15 深度学习中的画图问题
  • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条
  • ¥15 Python报错怎么解决
  • ¥15 simulink如何调用DLL文件
  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了