我在andengine中加载我的tmx级别时遇到问题
TMXLoader mLoader = new TMXLoader(getAssets(), getTextureManager(),
TextureOptions.NEAREST, getVertexBufferObjectManager(),
new ITMXTilePropertiesListener() {
@Override
public void onTMXTileWithPropertiesCreated(TMXTiledMap pTMXTiledMap,
TMXLayer pTMXLayer, TMXTile pTMXTile,
TMXProperties<TMXTileProperty> pTMXTileProperties) {
// TODO Auto-generated method stub
}
});
try {
mTiledMap = mLoader.loadFromAsset("mrsai_demo.tmx");
} catch (TMXLoadException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
运行它会在此行mTiledMap = mLoader.loadFromAsset("mrsai_demo.tmx");
答案 0 :(得分:0)
所以事实证明,如果瓷砖没有填充,andengine会给你一个空指针。要修复它,只需用Tiled填充你图层上的每个瓷砖。