pytmx icon indicating copy to clipboard operation
pytmx copied to clipboard

Custom Types Support

Open xivol opened this issue 1 year ago • 2 comments

It seems that support for custom types in Tiled Project files is broken. The code is all there for it to work but it doesn't pass the right arguments around.

546            self.parse_json(json.load(open(custom_property_filename))["propertyTypes"])

559        TiledElement._set_properties(self, node, self.custom_types)

1262            p.update(parse_properties(child, self.parent.custom_types))

I fixed it in couple of lines, should we do a PR or can the author just fix it? Idk how community works here.

xivol avatar Mar 13 '24 21:03 xivol

Raise a PR and then others will potentially benefit from it :)

joereynolds avatar Jul 25 '24 12:07 joereynolds

Just a bump to say this is also happening on custom classes. I imagine they're closely linked.

If I create a custom class type and then run my game, I get

    return deepcopy(custom_types[value])
                    ~~~~~~~~~~~~^^^^^^^
KeyError: 'state-returning'

joereynolds avatar Aug 12 '24 16:08 joereynolds