我重構我的遊戲我想使用AltasTmxMapLoader
來提高我的TiledMaps
的渲染性能。我堅持將地圖集屬性添加到地圖中。例如,我需要把它放在這張地圖上?在哪裏添加AtlasTmxMapLoader的地圖集屬性
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="10" height="10" tilewidth="32" tileheight="32">
<tileset firstgid="1" name="tile2" tilewidth="32" tileheight="32">
<image source="tile2.png" width="512" height="512"/>
</tileset>
<tileset firstgid="257" name="mountain" tilewidth="32" tileheight="32">
<image source="mountain.png" width="512" height="512"/>
</tileset>
<tileset firstgid="513" name="pubdlcnt" tilewidth="32" tileheight="32">
<image source="pubdlcnt.png" width="512" height="512"/>
</tileset>
<tileset firstgid="769" name="snowWit" tilewidth="32" tileheight="32">
<image source="snowWit.png" width="512" height="512"/>
</tileset>
<tileset firstgid="1025" name="tile2" tilewidth="32" tileheight="32">
<image source="tile2.png" width="512" height="512"/>
</tileset>
<tileset firstgid="1281" name="tree+rock" tilewidth="32" tileheight="32">
<image source="tree+rock.png" width="512" height="512"/>
<tile id="129">
<properties>
<property name="blocked" value=""/>
</properties>
</tile>
<tile id="161">
<properties>
<property name="move" value=""/>
</properties>
</tile>
</tileset>
<tileset firstgid="1537" name="trees" tilewidth="32" tileheight="32">
<image source="trees.png" width="512" height="512"/>
</tileset>
<tileset firstgid="1793" name="trees2" tilewidth="32" tileheight="32">
<image source="trees2.png" width="512" height="512"/>
</tileset>
<layer name="background1" width="10" height="10">
<data encoding="base64" compression="zlib">
eJzzZ2Bg8B/FgwYDAFyQHt0=
</data>
</layer>
<layer name="background" width="10" height="10">
<data encoding="base64" compression="zlib">
eJxjYGBgmISEGfDQi5AwAx76KBSPAtxgIysEowMAMnYKLw==
</data>
</layer>
<layer name="background" width="10" height="10">
<data encoding="base64" compression="zlib">
eJybxMDAcBqIJxGgFwHxbSJoUsA1IL6OR/4XlD4KxSMBAAA87BJ0
</data>
</layer>
<layer name="foreground1" width="10" height="10">
<data encoding="base64" compression="zlib">
eJxjYCAOzCdCzTwofQyIj+NR94pIO0m1l5pgoOwFACVaBi8=
</data>
</layer>
<layer name="blocked" width="10" height="10">
<data encoding="base64" compression="zlib">
eJxrYmVgaKIiJgUQ0kOqeUMJLGKFYHQAAKpXDXA=
</data>
</layer>
</map>
我已經嘗試過將它添加到地圖標記和tileset標記,但這不是正確的解決方案。我已經注意到,我需要將圖集放入與tmx文件相同的文件夾中,但我真的不知道要在哪裏放置標籤。
Exception in thread "main" java.lang.NoClassDefFoundError: com/badlogic/gdx/util
s/GdxRuntimeException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getMethod0(Class.java:2774)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: com.badlogic.gdx.utils.GdxRuntimeEx
ception
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more
這會導致刪除。添加了堆棧。我移到了擴展文件夾並輸入了命令。爲此,我添加了文件夾處理/輸入和輸出在同一目錄中,並打包一些tmx文件。將tilesets放入輸入文件夾 – BennX
謝謝我解決了它,但沒有通過命令行。我將它添加到coreprojekt中,所以它開始了。生病編輯您的文章並將其作爲正確答案進行檢查。謝謝。 順便說一句,這確實是毀了地圖。不知道爲什麼。張貼在badlogicgames論壇上 – BennX