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

Add support for TSX files through parsefile method for Maps and TileSets #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jjatria
Copy link

@jjatria jjatria commented Mar 1, 2019

This patch implements a parsefile method for both Map and TileSet objects that allows them to read TMX and TSX files respectively. It also makes changes to the way the Map class instantiates its children TileSets, by detecting when the tileset needs to be read from an external (source) file, and does the right thing.

I've included some tests files, and some tests.

It does not include any documentation changes, since this change should be transparent to users, and users are not currently allowed to instantiate their own TileSet objects.

Since TileSet objects will also reference files (eg. the image file), this change adds a root_dir to both Map and TileSet classes so they know where to load these files from. This is inherited from the map_dir attribute of the parent Parser object.

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

Successfully merging this pull request may close these issues.

1 participant