adrien-bon / bevy_ecs_tiled

Helpers for working with 2D tilemaps created with the Tiled map editor
MIT License
31 stars 7 forks source link

Do we need to convert the Y axis? #41

Open darkautism opened 1 week ago

darkautism commented 1 week ago

I'm on the way to resolve #39 . But I found something weird. image Left Top should been 0,0 image InGame: image

darkautism commented 1 week ago

Yes, this cause bugs. image image Since we are rendering from the bottom left, this will cause the sort order to be abnormal.

In Game: image image

darkautism commented 1 week ago

Ok, I found something in my old PR: https://github.com/StarArawn/bevy_ecs_tilemap/pull/405. It seems that bevy_ecs_tilemap does not support reversing the y-axis. This means that even if I perform the correct calculations, I can’t get the texture to display correctly. Or can we actually flip the y-axis ourselves?

adrien-bon commented 1 week ago

Hey! I just tried both your tiledtest_y_even and tiledtest_y_odd maps from #39 and I actually see the expected rendering. I don't understand what is the issue. What's the problem with not having the same reference between Tiled and bevy_ecs_tilemap ? If you really want, you could have some kind of translation function and convert from one reference to the other.

darkautism commented 1 week ago

The map high will cause render bug. You can change map high to odd/even to check render effect.