描述:
//map.tmx文件的配置:
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" renderorder="right-down" width="30" height="30" tilewidth="32" tileheight="32" nextobjectid="1">
<tileset firstgid="1" name="tiledMap" tilewidth="32" tileheight="32" spacing="1" margin="1" tilecount="66">
<image source="tmx/tildMap.jpg" width="385" height="220"/>
</tileset>
<layer name="layer1" width="30" height="30">
<data encoding="base64" compression="gzip">
H4sIAAAAAAAAC+3St1JCYRhF0YuImBWVZFaSCRQkqSDq+z+Uq6C1YOavnK9YxZk55c5lWbZGnnUKbFAkxxbb7Cz3X9/NFb+77LHPAYeUOOKYE8pUEn+r1KhzyhnnXHDJFdfcJP7e0qBJizYd7rjngUeeEn+79HjmhT4DXhkyYswk8XfKG+98MGPOJwu++OYn8Tdlo9Fz9Bw9R8/Rc/QcPUfP0XP0/N97/gVGh3UfEA4AAA==
</data>
</layer>
</map>
BaseGameActivity类
public Scene onLoadScene() {
Scene scene=new Scene(1);
try {
final TMXLoader tmxLoader = new TMXLoader(this,
mEngine.getTextureManager(),
TextureOptions.BILINEAR_PREMULTIPLYALPHA,
new ITMXTilePropertiesListener() {
@Override
public void onTMXTileWithPropertiesCreated(
final TMXTiledMap pTMXTiledMap,
final TMXLayer pTMXLayer,
final TMXTile pTMXTile,
final TMXProperties<TMXTileProperty> pTMXTileProperties) {
/*
* We are going to count the tiles that have the
* property "cactus=true" set.
*/
if (pTMXTileProperties.containsTMXProperty(
"cactus", "true")) {
}
}
});
tiledMap = tmxLoader.loadFromAsset(this, "tmx/map.tmx");
} catch (final TMXLoadException tmxle) {
Debug.e(tmxle);
}
final TMXLayer tmxLayer = tiledMap.getTMXLayers().get(0);
scene.attachChild(tmxLayer);
return scene;
问题:我用的是安卓AndEngine.jar,在开发过程中遇到tiledMap图片加载异常,出现错位现象,还伴有黑色框框,有哪位先辈碰到过这样的问题,求解答!