This commit is contained in:
jeremygan2021
2026-03-02 22:43:04 +08:00
parent c0882a93a9
commit e0776a1839
18 changed files with 1331 additions and 82 deletions

View File

@@ -1,6 +1,7 @@
import machine
import st7789py as st7789
from config import CURRENT_CONFIG
import font
class Display:
def __init__(self):
@@ -8,6 +9,7 @@ class Display:
self.width = 240
self.height = 240
self._init_display()
self.font = font.Font()
def _init_display(self):
print(">>> Initializing Display...")
@@ -41,6 +43,14 @@ class Display:
if self.tft:
self.tft.fill_rect(x, y, w, h, color)
def set_ws(self, ws):
if self.font:
self.font.set_ws(ws)
def text(self, text, x, y, color):
if self.tft:
self.font.text(self.tft, text, x, y, color)
def init_ui(self):
"""初始化 UI 背景"""
if self.tft: