diff --git a/SoundslabDisplay.py b/SoundslabDisplay.py index 44b1ab2..1b00bef 100644 --- a/SoundslabDisplay.py +++ b/SoundslabDisplay.py @@ -97,8 +97,8 @@ class SoundslabDisplay: menu_overlay.rectangle([(21, offset_from_top),(self.screen_size[0] - 21, offset_from_top + 40)], self.bg_color) # highlight background for selected menu item output_size = menu_overlay.textsize(row["output"]) # get the size of the text to draw so we can center it in our rectangle for this row - print("showing '" + row["output"] + "' at (" + str(21 + floor(output_size[0] / 2)) + ", " + str(offset_from_top + 40 - floor(output_size[1])) + ")") - menu_overlay.text((21 + floor(output_size[0] / 2), offset_from_top + (40 - floor(output_size[1]))), row["output"], font=font, fill=self.fg_color if row["selected"] else self.bg_color) # draw output text in appropriate color + print("showing '" + row["output"] + "' at (" + str((self.screen_size[0] / 2) - floor(output_size[0] / 2)) + ", " + str(offset_from_top + 20 - floor(output_size[1])) + ")") + menu_overlay.text(((self.screen_size[0] / 2) - floor(output_size[0] / 2), offset_from_top + (20 - floor(output_size[1]))), row["output"], font=font, fill=self.fg_color if row["selected"] else self.bg_color) # draw output text in appropriate color offset_from_top += 40 # finally, set the current_menu image