Skip to content

Commit

Permalink
Complete scene menu rendition implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Sep 1, 2023
1 parent 6e738ed commit 32ae3b9
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/planet096_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,25 @@ void Planet096Scene::renderMenu() {
this->display.drawLine(43, 52, 43, 64, WHITE);
this->display.drawLine(85, 52, 85, 64, WHITE);

this->display.setTextSize(1);
this->display.setTextColor(WHITE);
this->display.setCursor(6 + ((32 - (strlen(this->menu_left) * 5)) / 2), 54);
this->display.println(this->menu_left);

this->display.setTextSize(1);
this->display.setTextColor(WHITE);
this->display.setCursor(48 + ((32 - (strlen(this->menu_center) * 5)) / 2), 54);
this->display.println(this->menu_center);

this->display.setTextSize(1);
this->display.setTextColor(WHITE);
this->display.setCursor(90 + ((32 - (strlen(this->menu_right) * 5)) / 2), 54);
this->display.println(this->menu_right);
}
else {
this->display.drawLine(0, 52, 128, 52, WHITE);
this->display.drawLine(64, 52, 64, 64, WHITE);

this->display.setCursor(6 + ((50 - (strlen(this->menu_left) * 5)) / 2), 54);
this->display.println(this->menu_left);

this->display.setCursor(70 + ((50 - (strlen(this->menu_right) * 5)) / 2), 54);
this->display.println(this->menu_right);
}

break;

Expand All @@ -202,21 +206,22 @@ void Planet096Scene::renderMenu() {

case SCENE_MENU_PLAIN:
if(this->menu_center != NULL) {
this->display.setTextSize(1);
this->display.setTextColor(WHITE);
this->display.setCursor(6 + ((32 - (strlen(this->menu_left) * 5)) / 2), 54);
this->display.println(this->menu_left);

this->display.setTextSize(1);
this->display.setTextColor(WHITE);
this->display.setCursor(48 + ((32 - (strlen(this->menu_center) * 5)) / 2), 54);
this->display.println(this->menu_center);

this->display.setTextSize(1);
this->display.setTextColor(WHITE);
this->display.setCursor(90 + ((32 - (strlen(this->menu_right) * 5)) / 2), 54);
this->display.println(this->menu_right);
}
else {
this->display.setCursor(6 + ((50 - (strlen(this->menu_left) * 5)) / 2), 54);
this->display.println(this->menu_left);

this->display.setCursor(70 + ((50 - (strlen(this->menu_right) * 5)) / 2), 54);
this->display.println(this->menu_right);
}

break;
}
Expand Down

0 comments on commit 32ae3b9

Please sign in to comment.