Skip to content
This repository has been archived by the owner on May 24, 2018. It is now read-only.

Solve the path problem #13

Closed
atomicptr opened this issue Jan 13, 2013 · 4 comments
Closed

Solve the path problem #13

atomicptr opened this issue Jan 13, 2013 · 4 comments

Comments

@atomicptr
Copy link
Owner

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

atomicptr pushed a commit that referenced this issue Jan 20, 2014
… class which implements AssetLoader and use Helper.setAssetLoader(myAssetLoader) somewhat improves #13
@Schtee
Copy link
Contributor

Schtee commented Jan 26, 2014

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:

  • assets
    • images <-- map texture lives in here
    • maps <-- map lives in here

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
Copy link
Owner Author

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
Copy link
Contributor

Schtee commented Jan 26, 2014

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
Copy link
Owner Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants