Hello,
Thank you Bodmer for your awesome library.
I'm trying to draw part of an image ( a sprite from a spritesheet ).
My image is 64 by 64.
I can draw the image entirely, the top half ( 64x32 ) but when i try to draw the left half (32x64) or juste the top-left square (32x32) it seems to take part of the image and mix it and stretch it.
Original image:
Code:
// Set delay after plotting the sprite
#define DELAY 30
#include "sample_images.h"
TFT_eSPI tft = TFT_eSPI(); // Declare object "tft"
TFT_eSprite spr2 = TFT_eSprite(&tft);
TFT_eSprite spr3 = TFT_eSprite(&tft);
TFT_eSprite spr4 = TFT_eSprite(&tft);
TFT_eSprite spr5 = TFT_eSprite(&tft);
void setup()
{
Serial.begin(9600);
Serial.println();
delay(50);
tft.init();
tft.setRotation(0);
spr2.setColorDepth(8);
spr3.setColorDepth(8);
spr4.setColorDepth(8);
spr5.setColorDepth(8);
spr2.createSprite(64,64);
spr2.setSwapBytes(true);
spr3.createSprite(64,32);
spr3.setSwapBytes(true);
spr4.createSprite(32,64);
spr4.setSwapBytes(true);
spr5.createSprite(32,32);
spr5.setSwapBytes(true);
tft.fillScreen(TFT_CYAN);
spr2.pushImage(0, 0, 64,64, (uint16_t *)stars2);
spr2.pushSprite(0, 0, 0);
spr3.pushImage(0, 0, 64,32, (uint16_t *)stars2);
spr3.pushSprite(0, 96, 0);
spr4.pushImage(0, 0, 32, 64, (uint16_t *)stars2);
spr4.pushSprite(0, 160, 0);
spr5.pushImage(0, 0, 32,32, (uint16_t *)stars2);
spr5.pushSprite(0, 256, 0);
}
void loop(void)
{
}
Am i using the correct method ?
If i'm using the wrong method i can't unterstand why sp3 would work but not sp4 and spr 5.
Any help is welcome.

