Toggle Navigation
Hatchery
Eggs
Salzamt
__init__.py
Users
Badges
Login
Register
__init__.py
raw
Content
import display import mch22 import nvs import buttons import sys APP_PATH = "/".join(__file__.split("/")[:-1]) # Add Application path to sys path to import modules as if they were root modules sys.path.append(APP_PATH) def btn_home(pressed): if pressed: mch22.exit_python() buttons.attach(buttons.BTN_HOME, btn_home) font = "Roboto_Regular22" nickname = nvs.nvs_getstr('owner','nickname') text_width = display.getTextWidth(nickname, font) display_size = display.size() png_width = 150 offset = ( display_size[0] - png_width ) // 2 text_offset = ( display_size[0] - text_width ) // 2 display.drawFill(0xA2ADB0) display.drawPng(offset, 5, "%s/%s" % (APP_PATH, "rundsiegel_salzamt.png")) display.drawText(text_offset, 175, nickname, 0x000000, font) display.flush()