读书人

对于TiledLayer的-gt;来看吧

发布时间: 2011-11-23 23:51:20 作者: rapoo

关于TiledLayer的->来看吧
TiledLayer t=new TiledLayer(30, 20, im, 32, 32);
这个第四个参数同第五个参数要怎么计算的啊。乱写一个数字是错误的。 要怎么计算啊?第四个参数同第五个参数的值

[解决办法]
楼主多看看api手册吧,里面有写
public TiledLayer(int columns,int rows,Image image,int tileWidth,int tileHeight)

IllegalArgumentException - if the image width is not an integer multiple of the tileWidth
IllegalArgumentException - if the image height is not an integer multiple of the tileHeight

图片大小必须是这两个参数的整数倍

读书人网 >J2ME开发

热点推荐