我有一个 tiled.tmx 文件正在加载到 andengine 中。但我不断得到这个空指针
10-31 21:15:08.383: ERROR/AndroidRuntime(6508): FATAL EXCEPTION: main
10-31 21:15:08.383: ERROR/AndroidRuntime(6508): java.lang.NullPointerException
10-31 21:15:08.383: ERROR/AndroidRuntime(6508): at com.fttech.test_ninja.Ninja_FightActivity.onLoadScene(Activity.java:117)
这是空指针指向我的地方,我不知道为什么。
try {
final TMXLoader tmxLoader = new TMXLoader(this, this.mEngine
.getTextureManager(), // TextureOptions.BILINEAR_PREMULTIPLYALPHA,
TextureOptions.NEAREST);
this.mTMXTiledMap = tmxLoader.loadFromAsset(this, "tmx/TileMao.tmx");
} catch (final TMXLoadException tmxle) {
Debug.e(tmxle);
}
tmxLayer = this.mTMXTiledMap.getTMXLayers().get(0);
SceneMainScene.attachChild(tmxLayer);