void loop()
{
Serial.printf("\nRotation: %d\n", test_screen_rotation);
tft.setRotation(test_screen_rotation);
tft.fillScreen(RED);
tft.setCursor(tft.width() / 2, tft.height() / 2, true);
tft.printf("Rotation: %d", test_screen_rotation);
test_screen_rotation = (test_screen_rotation + 1) & 0x3;
tft.setCursor(200, 300);
Serial.printf(" Set cursor(200, 300), retrieved(%d %d)",
tft.getCursorX(), tft.getCursorY());
tft.setCursor(50, 50);
tft.write('0');
tft.setCursor(tft.width() - 50, 50);
tft.write('1');
tft.setCursor(50, tft.height() - 50);
tft.write('2');
tft.setCursor(tft.width() - 50, tft.height() - 50);
tft.write('3');
for (uint8_t font_index = 0; font_index < (sizeof(font_test_list) / sizeof(font_test_list[0])); font_index++) {
nextPage();
if (font_test_list[font_index].font_fg_color != font_test_list[font_index].font_bg_color)
tft.setTextColor(font_test_list[font_index].font_fg_color, font_test_list[font_index].font_bg_color);
else
tft.setTextColor(font_test_list[font_index].font_fg_color);
if (font_test_list[font_index].ili_font) tft.setFont(*font_test_list[font_index].ili_font);
else if (font_test_list[font_index].gfx_font) tft.setFont(font_test_list[font_index].gfx_font);
else if (test_screen_rotation != 1) {
tft.setFont(Chancery_24_Italic);
tft.setTextColor(GREEN);
tft.println(font_test_list[font_index].font_name);
tft.setCursor(CENTER, CENTER);
tft.println("*** Only works in Rotation 0 ***");
continue; // only on Page 0
}
else tft.setFontDef();
tft.println(font_test_list[font_index].font_name);
displayStuff1();
}
nextPage();
}