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

First GID property is always null when using TMXMapReader #2933

Open
csueiras opened this issue Nov 8, 2020 · 4 comments
Open

First GID property is always null when using TMXMapReader #2933

csueiras opened this issue Nov 8, 2020 · 4 comments

Comments

@csueiras
Copy link

csueiras commented Nov 8, 2020

The first gid property is always null when using the TMXMapReader, the older MapReader used to set it in the buildMap method

tileset = readTileset(xmlPath + tileSetSource);
tileset.setFirstgid(firstGid);
tileset.setSource(tileSetSource);
tilesets.set(i, tileset);

I'll create a PR to also set this property in the TMXMapReader.

@bjorn
Copy link
Member

bjorn commented Nov 10, 2020

The first gid property is always null when using the TMXMapReader, the older MapReader used to set it in the buildMap method

Actually, TMXMapReader is the older reader, though it appears to be still used and has seen further changes after MapReader was introduced in e950500 (as part of #1637).

@mikepthomas Was the MapReader class supposed to replace TMXMapReader? Is there a reason to have both? Ideally we would only have a single reader class.

@mikepthomas
Copy link
Contributor

Completely agree. MapReader was intended to replace TMXMapReader however it is using JaxB simplify the code to load the the map. JaxB was deprecated and removed in JDK 11 (However it is still available as an external dependecy) my preference would be to remove the MapReader I created and use the TMXMapReader

@bjorn
Copy link
Member

bjorn commented Nov 10, 2020

Alright, let's remove MapReader again then. :-)

@csueiras
Copy link
Author

Wouldn't this still be a bit of a fix since otherwise there's no way to access the firstgid property?

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

No branches or pull requests

3 participants