- Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Problem
For pytiled_parser v.2.2.7,
When I read an int custom property from a TMX file, the result type is float. Is there any reason for that ? I could cast in int in my code but in that case, what the point of setting an int type in Tiled ?
Possible solution
It seems that the following lines in parser/tmx/properties.py cause the problem :
elif type_ == "int" or type_ == "float": value = float(value_) I think they could be replaced by
elif type_ == "int": value = int(value_) elif type_ == "float": value = float(value_) With my few tests, it seems to resolve the problem but one other modification could be useful also in pytiled_parser/properties.py
Property = Union[float, Path, str, bool, Color] -> Property = Union[float, Path, str, bool, Color, int]
I did not test for Json format.
Thanks for your library
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers