Add birthday mode

andrejusk/bday
Andrejus 2018-08-31 19:10:07 +01:00
parent 89a4ee789d
commit 5df9adffe4
2 changed files with 12 additions and 13 deletions

View File

@ -8,7 +8,7 @@ newly activated or reset.
___name___ = "Homescreen (Default)"
___license___ = "MIT"
___categories___ = ["Homescreens"]
___dependencies___ = ["homescreen", "shared/logo.png"]
___dependencies___ = ["homescreen", "shared/cake.png"]
___launchable___ = False
___bootstrapped___ = True
@ -22,39 +22,38 @@ intro_text = "Hi! I'm"
name_height = 60
status_height = 20
info_height = 30
logo_path = "shared/logo.png"
logo_height = 150
logo_width = 56
logo_path = "shared/cake.png"
logo_height = 120
logo_width = 120
# Maximum length of name before downscaling
max_name = 8
# Background stuff
init()
ugfx.clear(ugfx.html_color(0x800080))
ugfx.clear(ugfx.html_color(0xD50000))
# Colour stuff
style = ugfx.Style()
style.set_enabled([ugfx.WHITE, ugfx.html_color(0x800080), ugfx.html_color(0x800080), ugfx.html_color(0x800080)])
style.set_background(ugfx.html_color(0x800080))
style.set_enabled([ugfx.WHITE, ugfx.html_color(0xD50000), ugfx.html_color(0xD50000), ugfx.html_color(0xD50000)])
style.set_background(ugfx.html_color(0xD50000))
ugfx.set_default_style(style)
# Draw for people to see
ugfx.orientation(90)
# Logo stuff
ugfx.display_image(
int((ugfx.width() - logo_width) / 2),
int((ugfx.height() - logo_height) / 2),
logo_path
)
# Draw for people to see
ugfx.orientation(90)
# Draw introduction
ugfx.set_default_font(ugfx.FONT_TITLE)
ugfx.Label(0, ugfx.height() - name_height - intro_height, ugfx.width(), intro_height, intro_text, justification=ugfx.Label.CENTER)
# Process name
name_setting = name("Set your name in the settings app")
name_setting = name("Birthday kid")
if len(name_setting) <= max_name:
ugfx.set_default_font(ugfx.FONT_NAME)
else:

BIN
shared/cake.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB