Beispiel #1
0
void CButton::coreDraw()
{
    const SDimensions dim(getDimensions());
    const uint8_t right = dim.x + dim.w - 1;
    const uint8_t bottom = dim.y + dim.h - 1;

    for (uint8_t x=dim.x+1; x<right; ++x)
    {
        GD.wr(atxy(x, dim.y),
              (highlight) ? CHAR_BUTTON_HORIZ_TOP_HL : CHAR_BUTTON_HORIZ_TOP);
        GD.wr(atxy(x, bottom),
              (highlight) ? CHAR_BUTTON_HORIZ_BOTTOM_HL : CHAR_BUTTON_HORIZ_BOTTOM);
    }

    for (uint8_t y=dim.y+1; y<bottom; ++y)
    {
        GD.wr(atxy(dim.x, y),
              (highlight) ? CHAR_BUTTON_VERT_LEFT_HL : CHAR_BUTTON_VERT_LEFT);
        GD.wr(atxy(right, y),
              (highlight) ? CHAR_BUTTON_VERT_RIGHT_HL : CHAR_BUTTON_VERT_RIGHT);
    }

    if (flashText)
        putstr_P(dim.x + 2, dim.y + 1, text);
    else
        putstr(dim.x + 2, dim.y + 1, text);
}
Beispiel #2
0
void setup()
{
  GD.begin();
  GD.uncompress(RAM_CHR, cp437_chr);
  GD.uncompress(RAM_PAL, cp437_pal);
  drawstr(atxy(0, 0), "Hello");
  drawstr(atxy(10, 2), "This is the cp437 font");
  for (byte i = 0; i < 14; i++) {
    drawstr(atxy(i, 4 + i), " *Gameduino* ");
  }
}