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

Fixed issue where the visible attribute was not correctly converted t… #133

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

justinbeetle
Copy link
Contributor

…o a boolean in TileImageLayer.

pytmx/pytmx.py Outdated
@@ -1271,9 +1271,6 @@ def parse_xml(self, node):
:return: self
"""
self._set_properties(node)
self.name = node.get('name', None)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These attributes get set in the self._set_properties(node) call. That method, in TiledElement, correctly casts the values for these types in the _cast_and_set_attributes_from_node_items method.

subnodes += find_all_visible_nodes(subnode, node_type)
return subnodes

for subnode in find_all_visible_nodes(node, 'layer'):
self.add_layer(TiledTileLayer(self, subnode))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only adds visible layers while previously non-visible layers were also added. If there is utility in also adding the non-visible layers, it has been lost. It could be restored with additional changes.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be ignoring invisible layers. For instance, a map may have a shape layer for boundaries that might be invisible on tiled, but we still want it loaded to get the shapes.

@bitcraft
Copy link
Owner

bitcraft commented Feb 5, 2021 via email

…nd_all_visible_nodes in TiledMap.parse_xml to avoid rendering layers nested inside of invisible groups.
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