Kadoba / Advanced-Tiled-Loader

Imports Tiled maps into Lua for the LÖVE game engine. (NO LONGER IN DEVELOPMENT)
183 stars 30 forks source link

Loader.path and relative images path on .tmx not working #40

Open vitto opened 9 years ago

vitto commented 9 years ago

I'm trying to load a .tmx file with this files structure:

gfx/locations/walls.png
stages/locations/LocationName.tmx
stages/Stage.lua

Inside the .tmx files the images point to gfx/locations/:

<image source="../../gfx/stages/temple-maya/walls.png" ...

Basically, Stage.lua uses ATL to load the .tmx file and this is the script I use

ATL.Loader.path = 'stages/locations/'
local map = ATL.Loader.load(name)
map.useSpriteBatch = true

LOVE now throws this error:

Error:
... Could not open file stages//..gfx/stages/temple-maya/walls.png.
Does not exists.

It seems that ALT have some problem parsing on relative paths if I don't want to keep different assets and code resources in the same location, does exists a way to fix it?

Kadoba commented 9 years ago

I haven't had a problem with relative paths before but ATL has been out of development for a while so it is probably very error prone now. Are you sure the image source in your tmx file is correct? It doesn't match up with what you listed as your directory structure.