Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setBitmapColor() does not work anymore for 1 bit sprite #1776

Closed
alf45tar opened this issue Apr 14, 2022 · 4 comments
Closed

setBitmapColor() does not work anymore for 1 bit sprite #1776

alf45tar opened this issue Apr 14, 2022 · 4 comments

Comments

@alf45tar
Copy link

The following code always display sprite in black and white with the latest version of the library.

    TFT_eSprite sprite = TFT_eSprite(&display);

    sprite.setColorDepth(1);
    sprite.createSprite(display.width(), display.height() - 30);
    sprite.setFreeFont(&DSEG14_Classic_Bold_100);
    switch (currentProfile) {
      case 0:
        p = "A." + ((currentBank > 9  ? "" : "0") + String(currentBank));
        sprite.setBitmapColor(TFT_RED, TFT_BLACK);
        break;
      case 1:
        p = "B." + ((currentBank > 9  ? "" : "0") + String(currentBank));
        sprite.setBitmapColor(TFT_GREEN, TFT_BLACK);
        break;
      case 2:
        p = "C." + ((currentBank > 9  ? "" : "0") + String(currentBank));
        sprite.setBitmapColor(TFT_BLUE, TFT_BLACK);
        break;
    }
    sprite.setTextDatum(MC_DATUM);
    sprite.drawString(p, sprite.width() / 2, sprite.height() / 2);
    sprite.pushSprite(0, 30);
    sprite.deleteSprite();
@Bodmer
Copy link
Owner

Bodmer commented Apr 14, 2022

Can you try the "Sprite_scroll_1bit" example an tell me if it is in just black and white. Thanks.

@Bodmer
Copy link
Owner

Bodmer commented Apr 14, 2022

Just tested the above exmaple and it plots the 1 bit sprite in different colours.

However the "One_bit_Sprite_Demo" does only plot back and white.

I will investigate.

@Bodmer
Copy link
Owner

Bodmer commented Apr 14, 2022

I will fix this. In the meantime the work-around is to always use the tft instance, e.g. tft.setBitmapColor(TFT_GREEN, TFT_BLACK);

@Bodmer Bodmer closed this as completed in f790c86 Apr 14, 2022
Bodmer added a commit that referenced this issue Apr 14, 2022
@Bodmer
Copy link
Owner

Bodmer commented Apr 14, 2022

Fixed in Github master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants