TmxMapLoader并不了解浮点数

时间:2015-06-30 23:03:11

标签: java libgdx tiled tmx

当我尝试使用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)

地图由Tiled编辑

创建

有人可以向我解释我做错了什么吗?链接到地图here

谢谢!

1 个答案:

答案 0 :(得分:1)

更新libgdx,该堆栈跟踪与一个相当旧的版本相关联。很长一段时间都支持浮动。