Space_Shift
Space_Shift

Reputation: 83

Exporting Tiled maps on Eclipse with Libgdx

i'm having some problems loading the levels of a project i'm doing. I already put the .tmx files and the .png images from the level on the "Assets" folder but i keep having this error:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: Downloads/simpleGraphics_tiles16x16.png
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:147)
at com.badlogic.gdx.graphics.TextureData$Factory.loadFromFile(TextureData.java:98)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:100)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:96)
at com.badlogic.gdx.maps.tiled.TmxMapLoader.load(TmxMapLoader.java:84)
at com.badlogic.gdx.maps.tiled.TmxMapLoader.load(TmxMapLoader.java:65)
at com.proyecto.game.Screens.PlayScreen.<init>(PlayScreen.java:28)
at com.proyecto.game.MainMenuScreen.MainMenuScreen.render(MainMenuScreen.java:57)
at com.badlogic.gdx.Game.render(Game.java:46)
at com.proyecto.game.miProject.render(miProject.java:21)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:225)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: 
Downloads\simpleGraphics_tiles16x16.png (Internal)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:136)
at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:222)
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:144)
... 11 more

I'm using also this call the map:

    maploader = new TmxMapLoader();
    map = maploader.load("Nivel1.tmx");
    renderer = new OrthogonalTiledMapRenderer(map);

What can be causing the error?

Upvotes: 1

Views: 147

Answers (1)

AAryan
AAryan

Reputation: 20140

.tmx file having entry of your .png file. You kept .tmx file inside Assets with all associated .png but you not edited path in .tmx file

May be you've entry in .tmx entry like this :

<image source="Downloads\simpleGraphics_tiles16x16.png" width="64" height="64"/>

so change it to :

<image source="simpleGraphics_tiles16x16.png" width="64" height="64"/>

I assume simpleGraphics_tiles16x16.png and .tmx file are in same folder inside Assets.

Upvotes: 1

Related Questions