我有一个tiled.tmx文件我加载到引擎。但我一直得到这个零指针NullPointer与tiled.tmx
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);