当我尝试用TmxMapLoader加载地图时,如下所示:
TiledMap map = new TmxMapLoader().load("maps/TestMap.tmx");
我收到这样的东西:
Exception in thread "LWJGL Application" java.lang.NumberFormatException: For input string: "15.1"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.badlogic.gdx.utils.XmlReader$Element.getIntAttribute(XmlReader.java:646)
at com.badlogic.gdx.maps.tiled.TmxMapLoader.loadObject(TmxMapLoader.java:562)
at com.badlogic.gdx.maps.tiled.TmxMapLoader.loadObjectGroup(TmxMapLoader.java:548)
at com.badlogic.gdx.maps.tiled.TmxMapLoader.loadTilemap(TmxMapLoader.java:233)
at com.badlogic.gdx.maps.tiled.TmxMapLoader.load(TmxMapLoader.java:130)
at com.badlogic.gdx.maps.tiled.TmxMapLoader.load(TmxMapLoader.java:109)
at net.desu.Play.show(Play.java:71)
at com.badlogic.gdx.Game.setScreen(Game.java:62)
at net.desu.LevelMenu$1.clicked(LevelMenu.java:63)
at com.badlogic.gdx.scenes.scene2d.utils.ClickListener.touchUp(ClickListener.java:85)
at com.badlogic.gdx.scenes.scene2d.InputListener.handle(InputListener.java:57)
at com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:345)
at com.badlogic.gdx.backends.lwjgl.LwjglInput.processEvents(LwjglInput.java:297)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:209)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
地图由平铺编辑器创建
有人能向我解释一下我做错了什么吗?链接到这里的地图
谢谢!
更新libgdx,该堆栈跟踪与相当旧的版本相关。Floats得到了很长时间的支持。