atomicptr / openfl-tiled

openfl-tiled is a library which gives OpenFL developers the ability to use the TILED map editor.
Other
45 stars 21 forks source link

Solve the path problem #13

Closed atomicptr closed 10 years ago

atomicptr commented 11 years ago

You need to be very careful with paths if you don't want to edit the tmx file later (with a text editor), which actually sucks so i need to solve this! rynti mentioned an approach he used in Rygal.

related to #36

Schtee commented 10 years ago

I'm using a pretty poor solution to this issue that won't fit everyone's work flow, but might help some people: My folder structure is:

Saving in Tiled will default the texture path back to "../images", which OpenFL won't like. I have a sym link in the "maps" directory to "assets" ("../"), so from OpenFL and Tiled the path "assets/images/texture.png" makes sense. Then in my project.xml I exclude the symlinked assets directory, so we don't end up in some crazy recursive purgatory. Now I can save in Tiled and run the game without the need to edit the map file by hand. Lovely!

atomicptr commented 10 years ago

I like my approach more ;).

My folder structure:

assets/
    maps <--- contains all my tmx files
        map_textures <--- contains all map textures

Then I add one line to the project.xml file of OpenFL:

<assets path="assets/maps/map_textures" rename="map_textures" />

So I also never need to edit the map files ;)..

Schtee commented 10 years ago

That approach is definitely less of a pain to work with, but I guess I like having all my textures in the same directory. I guess it doesn't really matter though! :D

atomicptr commented 10 years ago

You could create a symbolic link from map_textures to your "images" folder though.