Toggle Navigation
Hatchery
Eggs
Dating
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
import dialogs, ugfx, badge ugfx.clear(ugfx.BLACK) ugfx.flush() ugfx.clear(ugfx.WHITE) ugfx.flush() name = badge.nvs_get_str("dating", "name", "") nick = dialogs.prompt_text("What will you date?", name) if nick: badge.nvs_set_str("dating", "name", nick) #Nice clean screen ugfx.clear(ugfx.BLACK) ugfx.flush() ugfx.clear(ugfx.WHITE) ugfx.flush() ugfx.string_box(0,10,296,26, "I'm still looking for hot single", "Roboto_Regular12", ugfx.BLACK, ugfx.justifyCenter) ugfx.string_box(0,45,296,38, nick, "PermanentMarker36", ugfx.BLACK, ugfx.justifyCenter) ugfx.string_box(0,94,296,26, "Anyway", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter) #the line under the text str_len = ugfx.get_string_width(nick,"PermanentMarker36") line_begin = int((296-str_len)/2) line_end = str_len+line_begin ugfx.line(line_begin, 83, line_end, 83, ugfx.BLACK) #the cursor past the text cursor_pos = line_end+5 ugfx.line(cursor_pos, 46, cursor_pos, 81, ugfx.BLACK) ugfx.flush(ugfx.LUT_FULL) import deepsleep, badge badge.eink_busy_wait() deepsleep.start_sleeping(60000)