9#include "DrawContext.h"
14typedef std::string String;
17const int16_t TEXT_HEIGHT = 8;
18const int16_t TEXT_SIZE = 2;
19const int16_t MIN_WIDTH = 40;
33 String text = drawContext->getspeechText();
34 const lgfx::IFont *font = drawContext->getSpeechFont();
35 if (text.length() == 0) {
39 uint16_t primaryColor = cp->get(COLOR_BALLOON_FOREGROUND);
40 uint16_t backgroundColor = cp->get(COLOR_BALLOON_BACKGROUND);
41 M5.Lcd.setTextSize(TEXT_SIZE);
42 M5.Lcd.setTextDatum(MC_DATUM);
43 spi->setTextSize(TEXT_SIZE);
44 spi->setTextColor(primaryColor, backgroundColor);
45 spi->setTextDatum(MC_DATUM);
47 int textWidth = M5.Lcd.textWidth(text.c_str());
48 int textHeight = TEXT_HEIGHT * TEXT_SIZE;
49 spi->fillEllipse(cx - 20, cy,textWidth + 2, textHeight * 2 + 2,
51 spi->fillTriangle(cx - 62, cy - 42, cx - 8, cy - 10, cx - 41, cy - 8,
53 spi->fillEllipse(cx - 20, cy, textWidth, textHeight * 2,
55 spi->fillTriangle(cx - 60, cy - 40, cx - 10, cy - 10, cx - 40, cy - 10,
57 spi->drawString(text.c_str(), cx - textWidth / 6 - 15, cy, font);
Definition: BoundingRect.h:10
Definition: ColorPalette.h:50
Definition: DrawContext.h:22
Definition: Drawable.h:13