Add drawCenteredText to GfxRenderer

This commit is contained in:
Dave Allie
2025-12-08 22:52:19 +11:00
parent 07cc589e59
commit 02b157c02b
7 changed files with 19 additions and 21 deletions

View File

@@ -10,11 +10,8 @@ void BootLogoScreen::onEnter() {
const auto pageHeight = GfxRenderer::getScreenHeight();
renderer.clearScreen();
// Location for images is from top right in landscape orientation
renderer.drawImage(CrossLarge, (pageHeight - 128) / 2, (pageWidth - 128) / 2, 128, 128);
const int width = renderer.getTextWidth(UI_FONT_ID, "CrossPoint", BOLD);
renderer.drawText(UI_FONT_ID, (pageWidth - width) / 2, pageHeight / 2 + 70, "CrossPoint", true, BOLD);
const int bootingWidth = renderer.getTextWidth(SMALL_FONT_ID, "BOOTING");
renderer.drawText(SMALL_FONT_ID, (pageWidth - bootingWidth) / 2, pageHeight / 2 + 95, "BOOTING");
renderer.drawImage(CrossLarge, (pageWidth - 128) / 2, (pageHeight - 128) / 2, 128, 128);
renderer.drawCenteredText(UI_FONT_ID, pageHeight / 2 + 70, "CrossPoint", true, BOLD);
renderer.drawCenteredText(SMALL_FONT_ID, pageHeight / 2 + 95, "BOOTING");
renderer.displayBuffer();
}