Closed setzer22 closed 11 months ago
I've noticed there was an issue with flipping the sprites when sprites have animation (and thus define a source_rect different than the full image). It is now fixed.
As discussed, I'll also be adding some examples :+1:
Alright, finally found some time to take care of this :smile: Here's the new example!
https://github.com/darthdeus/comfy/assets/7241990/aeaf59dd-6341-4e5e-ae58-cd91b64c1f19
thanks!
This brings a more intuitive (IMO, but also as we discussed) API to draw sprites. It supports sprite alignment, scaling (rather, set the sprite size) as well as setting a rotation pivot.
The API is based on this params struct:
and this function
I didn't change anything from the previous API, and I also kind of avoided the
rotated_rectangle
method because it didn't kinda do what I wanted, so the method looks a bit more boilerplatey because of that. But I have tested everything on my end and it seems to be working properly.