EngoEngine / engo

Engo is an open-source 2D game engine written in Go.
https://engoengine.github.io
MIT License
1.75k stars 136 forks source link

Scale operation seems to move the entity to the wrong position #772

Closed drgomesp closed 3 years ago

drgomesp commented 3 years ago

I have a spritesheet that I'm using to display different character animations, and for some of those animation frames, the spritesheet image cell is the same, except mirrored (walking right is a mirror of walking left).

My assumption for this mirror operation is to perform a simple Scale(-1,1) on the entity, however what happens is that it seems to move to the left for some reason. My guess is that because of the draw order and things being drawn from left to right, top to bottom, but I'm not sure.

Here's how the problem looks like: Peek 2021-03-25 16-41

Does anyone have any idea of how to fix this?