Change banner render method

This commit is contained in:
Just Call Me Koko
2023-09-05 13:34:58 -04:00
parent 3337c3e7a2
commit 5d4f73dbc8
3 changed files with 6 additions and 5 deletions

View File

@@ -319,7 +319,7 @@ void Display::displayBuffer(bool do_clear)
void Display::showCenterText(String text, int y)
{
tft.setCursor((SCREEN_WIDTH - (text.length() * 6)) / 2, y);
tft.setCursor((SCREEN_WIDTH - (text.length() * (6 * BANNER_TEXT_SIZE))) / 2, y);
tft.println(text);
}
@@ -773,10 +773,11 @@ void Display::buildBanner(String msg, int xpos)
int h = TEXT_HEIGHT;
this->tft.fillRect(0, STATUS_BAR_WIDTH, SCREEN_WIDTH, TEXT_HEIGHT, TFT_BLACK);
this->tft.setFreeFont(NULL); // Font 4 selected
this->tft.setTextSize(BANNER_TEXT_SIZE); // Font size scaling is x1
this->tft.setTextFont(0); // Font 4 selected
this->tft.setTextColor(TFT_WHITE, TFT_BLACK); // Black text, no background colour
this->tft.drawCentreString(msg.c_str(), SCREEN_WIDTH / 2, TEXT_HEIGHT, 2);
//this->tft.drawCentreString(msg.c_str(), SCREEN_WIDTH / 2, TEXT_HEIGHT, BANNER_TEXT_SIZE);
this->showCenterText(msg, STATUS_BAR_WIDTH);
/*
// We could just use fillSprite(color) but lets be a bit more creative...

View File

@@ -125,7 +125,7 @@ esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, b
LinkedList<int>* stations;
};*/
#define mac_history_len 93
#define mac_history_len 512
struct mac_addr {
unsigned char bytes[6];

View File

@@ -338,7 +338,7 @@
#define SCREEN_CHAR_WIDTH 40
#define HAS_ILI9341
#define BANNER_TEXT_SIZE 1
#define BANNER_TEXT_SIZE 2
#ifndef TFT_WIDTH
#define TFT_WIDTH 240