mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-05 20:40:25 -08:00
Change banner render method
This commit is contained in:
@@ -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...
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user