Closed scott-asdfasdf closed 1 year ago
The pyglet code is pretty old. I think the problem with it is that for pyglet is that its inefficient to handle the images like pygame. Pygame works better with images rotated ahead-of-time, but pyglet can easily rotate it at render time. So I kinda think that something in the pytmx API needs to change, so that rotation/transformation information can be iterated along with a texture.
But looking at the code here, I do see where the flags are not passed to the loader and that looks like a bug. Ill take a look, thanks for opening the issue.
please open a new issue and share the maps and images so i can take a look and help find a solution. closing for now.
Firstly, thanks for pytmx, it seems like it makes loading levels for a game much easier.
We were trying to use pytmx last week for a pyglet-based entry into pyweek last week, and I was trying to add support for rotations to the pyglet image loader, but I found the flags were not passed through at all, seemingly because my tilemap was multiple images.
Specifically, on lines 644 and 656 of pytmx.py (Current master at time of this report - https://github.com/bitcraft/pytmx/blob/2ef7dcac8526d9b5085c147b70b1078666542f12/pytmx/pytmx.py), the image loader is called without passing in any flags, so presumably rotations will be ignored for any library.
For our entry, I replaced the
loader()
call with the following:which seemed to fix rotation for me, but I imagine there's a less hacky way to do this?