I have written some code to rotate 16x16 Sprites and have modified the Sprites library to render from PROGMEM or RAM. My efforts are here > https://github.com/filmote/RotateImages
I have included a simple app that rotates an image in PROGMEM and one that does the same in RAM. The new commands in the Sprites library are below:
I don’t … however, I was thinking of writing a Galaga game. To get smooth graphics, I would need 16 images of the same enemy in all rotations and I could achieve the ame by having only 4 images and rotating them. In Galaga, there are 6 or 7 different enemies so this added up.
Rotating the images into a pre-defined 16x16 pixel array using separate rotate functions and simply changing the draw…() functions in the Sprite class meant that the changes to the drawSprite function was minimal. If you do not need the rotate functions then they would not get compiled into the code. Including it within the drawSprite function probably would increase the code size even if you didn’t need it.
Most likely copying an image into a buffer and then rotating the isolated buffer is easier than trying to rotate and draw to the screen buffer at the same time. One less problem to solve as it were.