0

10-24 10:05:24.576: E/MAP(16278): Error loading file: tmx/tess.tmx 10-24 10:05:24.576: E/MAP(16278): org.andengine.extension.tmx.util.exception.TMXLoadException: org.andengine.extension.tmx.util.exception.TMXParseException: Unexpected start tag: 'imagelayer'. 10-24 10:05:24.576: E/MAP(16278): at org.andengine.extension.tmx.TMXLoader.load(TMXLoader.java:256) 10-24 10:05:24.576: E/MAP(16278): at org.andengine.extension.tmx.TMXLoader.loadFromAsset(TMXLoader.java:213)

......

Here my code

public MainMap(Activity activity, Engine engine, String mapName) {

    super();
    String location = "tmx/" + mapName + ".tmx";
    try {
        tmxLoader = new TMXLoader(activity.getAssets(),
                engine.getTextureManager(),
                engine.getVertexBufferObjectManager());
        this.mTMXTiledMap = tmxLoader.loadFromAsset(location);
        this.mTMXTiledMap
                .setIsometricDrawMethod(TMXIsometricConstants.DRAW_METHOD_ISOMETRIC_ALL);
        this.mTMXLayer = this.mTMXTiledMap.getTMXLayers().get(0);
        this.mTMXLayer2 =this.mTMXTiledMap.getTMXLayers().get(1);


        createBlockedTile(mTMXTiledMap.getTileColumns(), mTMXTiledMap.getTileRows());

    } catch (final TMXLoadException e) {
        Log.e("MAP", String.format("Error loading file: %s", location), e);
    }

use

this.attachChild(mainMap.getmTMXLayer());
this.attachChild(mainMap.getmTMXLayer2());

1 Answers1

0

The image layer is a layer type that was added in Tiled 0.9.0. It is documented at https://github.com/bjorn/tiled/wiki/TMX-Map-Format#imagelayer.

Most likely, AndEngine has not been updated to support this layer type yet. For this you could either patch it up yourself or report an issue to the author(s) to make sure they are aware of this missing feature.

Alternatively, don't use an image layer in your map to make sure you can load it with the current version of AndEngine.

Thorbjørn Lindeijer
  • 2,022
  • 1
  • 17
  • 22