Ejemplo n.º 1
0
void DMDFrame::drawString(int x, int y, const String &str, DMDGraphicsMode mode, const uint8_t *font)
{
  if(!font)
    font = this->font;
  if (x >= (int)pixel_width() || y >= (int)pixel_height())
    return;
  _drawString(this, x, y, str, mode, font);
}
Ejemplo n.º 2
0
void DMDFrame::drawString(int x, int y, const char *bChars, DMDGraphicsMode mode, const uint8_t *font)
{
  if(!font)
    font = this->font;
  if (x >= (int)width || y >= height)
    return;
  _drawString(this, x, y, bChars, mode, font);
}
Ejemplo n.º 3
0
void DMDFrame::drawString(int x, int y, const char *bChars, bool inverse, const uint8_t *font)
{
  if(!font)
    font = this->font;
  if (x >= (int)pixel_width() || y >= (int)pixel_height())
    return;
  _drawString(this, x, y, bChars, inverse, font);
}
Ejemplo n.º 4
0
void DMDFrame::drawString_P(int x, int y, const char *flashStr, DMDGraphicsMode mode, const uint8_t *font)
{
  if(!font)
    font = this->font;
  if(x >= (int)pixel_width() || y >= (int)pixel_height())
    return;
  _FlashStringWrapper wrapper(flashStr);
  _drawString(this, x, y, wrapper, mode, font);
}
Ejemplo n.º 5
0
void HelloWorld::_drawStringCentered(const GC& gc, const char* str, int x, int y,
                                     int w, int h) {
    int direction, ascent, descent;
    XCharStruct strDimensions;
    XTextExtents(XQueryFont(_display, XGContextFromGC(gc)), str, strlen(str),
            &direction, &ascent, &descent, &strDimensions);

    int newX = x + (w - strDimensions.width) / 2;
    int newY = y + (h + strDimensions.ascent - strDimensions.descent) / 2;
    _drawString(gc, str, newX, newY);
}
Ejemplo n.º 6
0
void OLED::drawString_P(int x, int y, const char *str, OLED_Colour foreground, OLED_Colour background)
{
  _FlashStringWrapper wrapper(str);
  _drawString(this, (void*)this->font, x, y, wrapper, foreground, background);
}
Ejemplo n.º 7
0
void OLED::drawString(int x, int y, const String &str, OLED_Colour foreground, OLED_Colour background)
{
  _drawString(this, (void*)this->font, x, y, str, foreground, background);
}
Ejemplo n.º 8
0
void OLED::drawString(int x, int y, const char *bChars, OLED_Colour foreground, OLED_Colour background)
{
  _drawString(this, (void*)this->font, x, y, bChars, foreground, background);
}