首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2ME开发 >

对于TiledLayer的->来看吧

2011-11-23 
关于TiledLayer的-来看吧TiledLayer tnew TiledLayer(30, 20, im, 32, 32)这个第四个参数同第五个参数

关于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

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

热点排行