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

Feature Request: Allow independent parse of tsx to TileMap. #129

Open
brandon-reinhart opened this issue Jun 30, 2023 · 2 comments
Open

Comments

@brandon-reinhart
Copy link

Currently tsx loading is embedded in map loading. This is fine for a game runtime, but your library is a pretty good interface to an asset import process (I'm using it for my custom importer to Unreal). I'd like to be able to treat tsx (tileset) files as their own asset and write a separate importer for them. I could trick your interface by loading the tsx, parsing it into an xml node, then calling parse with an empty map, but this is shady.

Would be nice to be able to create a TileMap object independent of any Map. Multiple maps may refer to the same tsx, so this allows us to manage each asset for import/reimport independently.

@brandon-reinhart
Copy link
Author

// Abuse tmxlite by parsing this tileset into a fake map.
// There's no way to tell if this worked... :/
auto attr = node.prepend_attribute("firstgid"); // fake! OMG! BAD CODER!
attr.set_value(1); // wtf this is so awful!
TileSet.parse( node, &Map );

Here is an example of the bad thing I'd like not to do.

@fallahn
Copy link
Owner

fallahn commented Jul 1, 2023

That's not a bad idea - could also possibly combine it with #128 . I'll have a think about the best way to do this, as it'll likely require a not insignificant refactor.

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

No branches or pull requests

2 participants