Requested Functionality - Sprite Mirroring
Request: Sprites should be able to mirror itself.
Workarounds: PIL and textured pairs offer this functionality, but it can be misunderstood or overlooked by newer programmers.
Solution: Add something like Sprite.mirror()
This was discussed on discord as well. It could be an idea to support all the flip functions Sprite currently support. The Texutre class could implement most of these functions. A big part of this is also making sure the texture atlas re-use the same texture instead of repeating it in the atlas itself.
There's definitely some cleanup that can be done around this. Still, this is kind of supported already by passing the texture parameter to Sprite, but I'm not sure how that works with hit boxes etc.
Might look into this when we do the texture texture cache in 2.7. The main problem is that we need proper control of the cached images. When that is done it should be much easier to clone(), .mirror() and other things.
Unless I misunderstood something, this can now be done in the dev branch by multiplying a channel of scale_xy by -1.
Unless I misunderstood something, this can now be done in the dev branch by multiplying a channel of
scale_xyby -1.
This is 100% correct
You can just flip the texture on the sprite now and it's fast, self.texture = self.texture.flip_horizontally()