mapeditor / rs-tiled

Reads files from the Tiled editor into Rust
https://crates.io/crates/tiled
MIT License
268 stars 103 forks source link

Use absolute path for image source, or include path of tileset files as well. #127

Closed Aposhian closed 2 years ago

Aposhian commented 2 years ago

image sources for a tileset are given relative to the tileset, but if the map is in a different directory than the tileset file, there is not a programmatic way to resolve where the tileset came from, and therefore a way to resolve the image source path.

This could be resolved by adding a source attribute to tileset, or by resolving the image source path to an absolute path.

bjorn commented 2 years ago

This is a duplicate of #94, which was resolved in #106. Not only does it add a source attribute to Tileset, but the source of Image is now also an absolute path:

https://github.com/mapeditor/rs-tiled/blob/789865ae054ba2cad4f2569b6bb1f66652015dcd/src/image.rs#L46-L51