0

I've been trying to create a class that mimics the AndEngine TMXTiledMapExample and I cannot get my simple class to load a TMXTiledMap from my assets. Can someone help me understand what's going on? I've set up my asset base path and almost duplicated the TMXTiledMapExample.

@Override
protected void onCreateResources() {
    //page 28
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");


    mBitmapTextureAtlas = new BitmapTextureAtlas(getTextureManager(),  512, 1024,  TextureOptions.DEFAULT);
    this.playerTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mBitmapTextureAtlas, this, "Boost.png", 100, 100);
    mBitmapTextureAtlas.load();

}

@Override
protected Scene onCreateScene() {
    this.mEngine.registerUpdateHandler(new FPSLogger());
    final Scene scene = new Scene();

    //Create tmxLoader with internal listener that can listen for properties of tiles (such as collisions, item pickups etc.)
    try{

        final TMXLoader tmxLoader = new TMXLoader(this.getAssets(), this.mEngine.getTextureManager(), TextureOptions.BILINEAR_PREMULTIPLYALPHA, this.getVertexBufferObjectManager());

        //Get instance of the map   
        this.mTMXTiledMap = tmxLoader.loadFromAsset("level1.tmx");



    }catch(final TMXException tmxe){
        Debug.e(tmxe);
    }

Error message: 03-13 23:49:11.057: E/AndEngine(27801): AndEngine 03-13 23:49:11.057: E/AndEngine(27801): atorg.andengine.extension.tmx.TMXLoader.loadFromAsset(TMXLoader.java:104)

4

0 回答 0