Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Adafruit_GFX text won't draw on "top" ?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit_GFX text won't draw on "top" ?

by mikew6 on Sun Sep 13, 2020 9:00 am

I am drawing some rectangles and some text on an EPD, but the text always ends up "behind" the rectangles and gets covered up even if I draw it last.

Code: Select all | TOGGLE FULL SIZE
Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
... // draw a bunch of other stuff; works OK
display.setFont(&FreeSansBold9pt7b);
display.fillRect(0 , 135, 152, 15, EPD_RED); // color choice here does not change behavior
display.setCursor(l_x, l_y);
display.setTextColor(EPD_BLACK); // background color parameter does not change behavior
display.print(s_num);

The rect drawn in the code snippet above does cover previously drawn rectangles, as expected. However, the text printed with 'print' does not display where its bounding box overlaps with the rect.
I can adjust the position of the rect to "cover" half the text, so I know the text is being printed. I just cannot figure out why the text appears 'behind' the rect instead of in 'front' of it.

The goal is to have the text appear on top of the rects, but it just won't do it.

Help?!
mikew6
 
Posts: 42
Joined: Thu Jan 09, 2014 11:51 pm

Please be positive and constructive with your questions and comments.