0

AndEngine TMXTiledMapExample を模倣するクラスを作成しようとしましたが、単純なクラスでアセットから TMXTiledMap をロードできません。誰かが何が起こっているのか理解するのを手伝ってくれますか? アセットのベース パスを設定し、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);
    }

エラー メッセージ: 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.ジャワ:104)

4

0 に答える 0