我想使用平铺来绘制我的地图。为了在 libgdx 中使用此地图,我必须构建一个关卡包文件,但我无法构建它。我使用这些方式来构建它,但它们都在执行时出错......这是我的方式:Source for this way
java -jar TexturePacker.java inputdirectory outputdirectory level
对于这个,我总是从 TexturePacker 类中得到一个 jar 导出,然后在它上面打开一个命令窗口(它的文件夹)然后这样写:
java -jar TexturePacker.jar c:\MySideScrollGame\data\world\level1 c:\ level.tmx
等等......还有这个:这种方式的来源
java -classpath libs/gdx.jar:libs/gdx-tools.jar:libs/gdx-tiled-preprocessor.jar
com.badlogic.gdx.tiledmappacker.TiledMapPacker
mygame/maps
mygame-android/assets/maps
--strip-unused
我的方式:
java -classpath libs\gdx.jar;libs\gdx-tools.jar;libs\gdx-tiled-preprocessor.jar com.badlogic.gdx.tiledmappacker.TiledMapPacker c:\MySideScrollGame\data\packer c:\MySideScrollGame\data\packer
但这对也是如此。错误。所以请告诉我,如果有人知道我的问题出在哪里或谁以前做过,请告诉我。多谢。
编辑 :
Exception in thread "Thread-2" javax.media.opengl.GLException: com.badlogic.gdx.utils.GdxRuntimeException: File not found: data\packer\input\level_1 packfile (Internal)
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:271)
at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:410)
at javax.media.opengl.GLCanvas.display(GLCanvas.java:244)
at com.badlogic.gdx.backends.jogl.JoglAnimator.display(JoglAnimator.java:137)
at com.badlogic.gdx.backends.jogl.JoglAnimator$MainLoop.run(JoglAnimator.java:174)
at java.lang.Thread.run(Unknown Source)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: data\packer\input\level_1 packfile (Internal)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:108)
at com.badlogic.gdx.graphics.g2d.TextureAtlas$TextureAtlasData.<init>(TextureAtlas.java:99)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:215)
at com.badlogic.gdx.graphics.g2d.tiled.TileAtlas.<init>(TileAtlas.java:49)
at com.example.jumpertutorial.TiledMapHelper.loadMap(TiledMapHelper.java:111)
at com.example.jumpertutorial.JumperTutorial.create(JumperTutorial.java:78)
at com.badlogic.gdx.backends.jogl.JoglGraphics.init(JoglGraphics.java:87)
at com.sun.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:72)
at javax.media.opengl.GLCanvas$InitAction.run(GLCanvas.java:418)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:189)
at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:452)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)