u8g2 Transparent Fonts

rthornton
Posts: 1
Joined: Tue Mar 20, 2018 1:31 pm

u8g2 Transparent Fonts

Postby rthornton » Sat Mar 24, 2018 3:01 pm

Hello,

First, I'm not sure if this is the right place to ask this question, but I was hoping someone here has an answer. Second of all, I'm very new to all this, so please forgive my ignorance. I've been following Neil Kolban's examples, which by the way have been very helpful so far, so thanks for those!

I'm trying to draw a dynamic RSSI icon using u8g2 on a monochrome SSD1306 128X64. I can get the current RSSI by registering a call back with esp_wifi_set_promiscuous_rx_cb which I may have another question about later, but for now I'm having trouble with the glyph itself. The icons I would like to use are in the u8g2_font_siji_t_6x10 font set. There are 3 symbols that represent a signal strength, 57880, 57881 and 57882; low, medium and high respectively. I can't figure out how to clear the previous icon before writing the new one. It seems that once I draw the high strength glyph, you never can see the low or medium. I think it might have something to do with them being transparent?

I've looked at trying to set u8g2_SetFontMode and u8g2_SetDrawColor, but can't seem to get what I'm looking for.

Does anyone know how to clear an area of 1 character using u8g2?

Here's what I'm trying to do

Code: Select all

void test_rssi_icon(){
	u8g2_SetFont(&u8g2, u8g2_font_siji_t_6x10);

	int glyph;

	while(1){
		for(int x = 0; x<3; x++)
		{
			glyph=57880+x;
			ESP_LOGI("TESTING", "Drawing Glyph %d", glyph);
			u8g2_DrawGlyph(&u8g2,115, 10, glyph);
			u8g2_SendBuffer(&u8g2);
			vTaskDelay(1500/portTICK_PERIOD_MS);
		}
	}
}

Who is online

Users browsing this forum: No registered users and 61 guests