-
Notifications
You must be signed in to change notification settings - Fork 147
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
Handling of relative paths in TMX conflicts with Tiled #280
Comments
I volunteer to work on this, if it isn't objected to or otherwise resolved by the time I get around to it. |
Sounds as a good feature, and I will be glad to merge if you implement it. |
Hello, I'm probably missing the issue here... If I take test/test_plarformer.py and I remove lines 14-15, the script still works. And it works because when cocos tries to load the resource here it's looking if the given filename is an absolute one, then it's looking if it's a relative one and finally it tries to find it in pyglet.resource. Sorry for not seeing the obvious. |
Example is SourceComb/game-off-2016 - the maps are stored under If you wanna see it in practice, for now try cloning that repository and modifying |
The current version of Tiled (0.17.1) only supports relative resource paths (e.g. to tileset images) in the same directory as the map file itself. When Cocos tries to load these resources, however, it passes the resource path directly to the Pyglet resource loader, which then fails to find the resource (if your map isn't directly on the resource path). I'm currently using a workaround involving manipulating the Pyglet resource path (which IMO is an ugly way to do things).
Ideally, Tiled would have better handling of relative paths. Failing that, I believe Cocos should load resources relative to the map file.
As this would probably be considered a breaking change, it should perhaps be enabled via a parameter on the load function.
The text was updated successfully, but these errors were encountered: