Is there any way to Rotate or Flip horizontally/vertically Image by drawImage function? I cannot see any options in the api reference.
You can flip images horizontally and vertically with this version of the drawImage()
function:
void drawImage(int16_t x, int16_t y, Image& img, int16_t w2, int16_t h2);
You just have to use negative values for w2
and/or h2
.
For the rotations, you will have to code them by yourself…
But you can take inspiration from the work of @bfx for this.
Omg that’s exactly what I was looking for In my new project i have a lot of image arrays which are only ‘mirrors’ of the current sprites. Now I can remove them to save a lot sketch and memory place using this little trick. Thank you so much for solution @Steph
Yes, this is precisely the trick to apply to drastically reduce the number of sprites or tiles. And don’t declare your images as global variables to save RAM!
Take a look at this tutorial. You might find some other tips.
I also recommend the tutorial made and linked here by @Steph. It has helped me a lot so far, getting acquainted with the platform.
API documentation updated