StarArawn / bevy_tiled

A plugin for rendering tiled maps.
MIT License
151 stars 40 forks source link

tiles keep the flip flags until UV ordering happens #34

Closed dmtaub closed 3 years ago

dmtaub commented 3 years ago

I found that rotation of tiles didn't work except in 180 degree case (both horizontal and vertical flipping). Investigating this issue, I found there was no handling for the diagonal flip bit.

In order to provide for other cases, we can propagate the three flip flags via the Tile object until the section of code where the UV-mapping is applied. Then, reordering of UVs via the procedure set out in the tiled documentation results in the correct rotation.