Skip to content

Template Support #171

@JiffyRob

Description

@JiffyRob

It looks like pytmx can't load templates.

When an object with a template is loaded, I see a TiledObject.template attribute which corresponds to the path of the template's .tx file (relative to the path of the map), but there does not seem to be a way to get any meaningful data out of it without parsing the file separately, which (a) could generate a mess, and (b) really seems like it should be part of pytmx, since it takes care of everything else.

The desired behavior would either be replacing the TiledObject.template attribute with a TiledTemplate object or similar, or straight up overriding the object's attributes (most intuitive, in my opinion).

Theoretically, adding support would not be too difficult. I'd be willing to try an implement it myself if necessary, but this seems to be a pretty simple feature to not have around. Am I missing something?

Here's my current tiled project as a test case. The assets are from here (CC0).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions