java和引擎无法从资产中加载TMXTiledMap错误
我一直在尝试创建一个模仿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):阿托格。和发动机。扩大tmx。TMXLoader。loadFromAsset(TMXLoader.java:104)
共 (0) 个答案