First Git Push

This commit is contained in:
2026-10-23 21:46:37 +02:00
commit c7b8c89c2d
12 changed files with 800 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#include "Emotes.h"
JackBot::Emotes::Emotes(Adafruit_GFX* display) {
tft = display;
}
void JackBot::Emotes::clearScreen() {
tft->fillScreen(0x0000); // black
}
// Draw centered text
void JackBot::Emotes::drawCenteredText(const char* text, uint16_t color) {
clearScreen();
tft->setTextSize(2);
tft->setTextColor(color);
int16_t x1, y1;
uint16_t w, h;
// Measure the text
tft->getTextBounds(text, 0, 0, &x1, &y1, &w, &h);
// Calculate center
int16_t cx = (tft->width() - w) / 2;
int16_t cy = (tft->height() - h) / 2;
tft->setCursor(cx, cy);
tft->print(text);
}