(3).建立Draw类用来显示图形:
public class Draw {
/** Creates a new instance of Draw */
public Draw(Canvas canvas) {
}
public static boolean paint(Graphics g, byte img, int x, int y) {
//在地图的x,y点绘制img指定的图片
try {
paint(g, img, x, y, Images.UNIT);//把地图x,y点转化成画布的绝对坐标,绘图
return true;
}
catch (Exception ex) {
return false;
}
}
public static boolean paint(Graphics g, byte img, int x, int y, i...[ 查看全文 ]