Problems with Sprite Transparency (Bodmer TFT lib)

Hi,
I am using Bodmers great "TFT_eSPI" lib.
I am loading some image into sprites and show them on my 240x240 tft.
Unfortunately I cannot manage to make the Transparency work with my sprites.

My Code:

TFT_eSprite sprite_green_tick = TFT_eSprite(&tft);

loop(){
    // Green Tick Sprite
    // Create a sprite of defined size
    sprite_green_tick.createSprite(green_tick_width, green_tick_height);
    sprite_green_tick.fillSprite(TFT_RED);

    sprite_green_tick.pushImage(0, 0, green_tick_width, green_tick_height, (uint16_t *)green_tick);
    sprite_green_tick.pushSprite(tft.width() / 2 - green_tick_width / 2, 40, 0xdfff);
}

I have included a header file with my "green_tick" image:

int green_tick_width = 50;
int green_tick_height = 57;
const unsigned short PROGMEM green_tick[] = {0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, ............. 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff};

I thought, if I give "0xdfff" as transparency color, the pixels of my image with this color will not be rendered.
Unfortunately, they will be rendered and the background is not "transparent".

Can anyone help me getting the background of my image transparent?

Solved it by creating a new image where "background color" is 0x0000.
With 0x000 everything works.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.