Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting file path for external tile sets #76

Open
DidierMalenfant opened this issue Oct 11, 2024 · 1 comment
Open

Getting file path for external tile sets #76

DidierMalenfant opened this issue Oct 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@DidierMalenfant
Copy link

I'm feeding the parsed level to a build dependency tool and it would be useful for me to get access to the full file paths for external tile sets so that the built level can depend on those too.

Having looked at the code, and unless I'm mistaken, I don't think that this is accessible already. Would it be ok for me to put together a PR to add this?

Idea would be that when creating a tileset, pass the entire path to the external file instead of just the parent folder, store that and provide an access method to it.

Thanks!

@Cleptomania
Copy link
Member

Hi

Definitely open to any PRs if you have something that works for you. I’d have to see the changes and think about it some more.

Normally all Tiled files use relative paths(relative to the map file), and pytiled-parser resolves them to absolute filepaths, but for external tilesets I don’t think we currently hold a reference to the actual filepath, we just load the tileset and store it into the map directly as if it was embedded.

If you have an idea for how to store that somewhere that will be useful for you, feel free to submit a PR

@Cleptomania Cleptomania added the enhancement New feature or request label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants