bitcraft / pytmx

Python library to read Tiled Map Editor's TMX maps.
GNU Lesser General Public License v3.0
384 stars 81 forks source link

Flipped version of the tile image can't be loaded #166

Closed Grimmys closed 1 year ago

Grimmys commented 2 years ago

Context:

I have two objects in my object layer, that have the same image but one should have it vertically flipped.

At the end, when loading the objects of this layer, I see that only one of them as an image correctly loaded as pygame Surface, the other one is None.

I would expect to be able to get the flipped version of the image somehow (maybe I'm missing something).

The concerned TMX data:

<objectgroup id="5" name="dynamic_data">
  <object id="14" type="objective" gid="1099" x="0" y="96" width="32" height="32">
   <properties>
    <property name="mission" value="main"/>
    <property name="walkable" type="bool" value="true"/>
   </properties>
  </object>
  <object id="103" type="objective" gid="1073742923" x="0" y="128" width="32" height="32">
   <properties>
    <property name="mission" value="main"/>
    <property name="walkable" type="bool" value="true"/>
   </properties>
  </object>
 </objectgroup>

First object has the original image, and the second the flipped version.

At the end, PyTmx loads the objects as such:

pycharm_loaded_objects

bitcraft commented 1 year ago

fixed here 5a3a39a2902868401569c6a36aa8e68209fb5a8b