updated main launcher for 7

pull/695/head
thirdr 2023-02-06 15:27:47 +00:00
rodzic 9c1c9e6b8d
commit 93dff218dc
1 zmienionych plików z 12 dodań i 4 usunięć

Wyświetl plik

@ -4,8 +4,9 @@ from machine import reset
import inky_helper as ih
# Uncomment the line for your Inky Frame display size
from picographics import PicoGraphics, DISPLAY_INKY_FRAME_4 as DISPLAY # 4.0"
# from picographics import PicoGraphics, DISPLAY_INKY_FRAME_4 as DISPLAY # 4.0"
# from picographics import PicoGraphics, DISPLAY_INKY_FRAME as DISPLAY # 5.7"
from picographics import PicoGraphics, DISPLAY_INKY_FRAME_7 as DISPLAY # 4.0"
# Create a secrets.py with your Wifi details to be able to get the time
#
@ -27,6 +28,10 @@ def launcher():
# Apply an offset for the Inky Frame 5.7".
if HEIGHT == 448:
y_offset = 20
# Inky Frame 7.3"
elif HEIGHT == 480:
y_offset = 35
# Inky Frame 4"
else:
y_offset = 0
@ -38,8 +43,9 @@ def launcher():
graphics.set_pen(5)
graphics.rectangle(0, 0, WIDTH, 50)
graphics.set_pen(0)
len = graphics.measure_text("Launcher", 4) // 2
graphics.text("Launcher", (WIDTH // 2 - len), 10, WIDTH, 4)
title = "Launcher"
title_len = graphics.measure_text(title, 4) // 2
graphics.text(title, (WIDTH // 2 - title_len), 10, WIDTH, 4)
graphics.set_pen(4)
graphics.rectangle(30, HEIGHT - (340 + y_offset), WIDTH - 100, 50)
@ -74,7 +80,9 @@ def launcher():
graphics.rectangle(WIDTH - 300, HEIGHT - (100 + y_offset), 270, 50)
graphics.set_pen(0)
graphics.text("Hold A + E, then press Reset, to return to the Launcher", 65, HEIGHT - 30, 600, 2)
note = "Hold A + E, then press Reset, to return to the Launcher"
note_len = graphics.measure_text(note, 2) // 2
graphics.text(note, (WIDTH // 2 - note_len), HEIGHT - 30, 600, 2)
ih.led_warn.on()
graphics.update()