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

track groups, find layers inside groups #153

Merged
merged 2 commits into from
Oct 1, 2021

Conversation

jamesalbert
Copy link
Contributor

@jamesalbert jamesalbert commented Sep 28, 2021

First off, I love pytmx. Been using it forever and it's awesome. much ❤️

lmk if this is something that's needed. In a lot of cases, I'd find this useful and I noticed an issue (cited below) echoing the same. This PR is an initial attempt to track groups and parse the layers within them.

Changes:

  • tile layers (and every other layer type) are found, not just those at the root
  • you can find a group with get_layer_by_name as an issue pointed out did not return groups Layer groups do not appear to be working #124
  • new layer type: TiledGroupLayer

Tested with:

  • empty, populated, and nested group layers in tiled locally
  • passed unittests

The group layer object I implemented is pretty rudimentary, idk if we want it to contain a list of layers inside or transitively pass visible from groups to layers. I figured with feedback I could add that if we want to continue down this route. Or this is complete garbage and we can just close 😄

@bitcraft
Copy link
Owner

bitcraft commented Oct 1, 2021

This looks good! Thanks for your kind words and contribution.

@bitcraft bitcraft merged commit 795905b into bitcraft:master Oct 1, 2021
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.

2 participants