Skip to content

Commit

Permalink
Added colorful splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
siliconwitch committed Aug 7, 2023
1 parent e3eb1e8 commit 2ef2673
Showing 1 changed file with 65 additions and 4 deletions.
69 changes: 65 additions & 4 deletions modules/_splashscreen.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,69 @@
import fpga, display


def __splashscreen():
logo = display.Text(
"MONOCLE", 320, 200, display.WHITE, justify=display.MIDDLE_CENTER
)
bars_top = []
bars_bottom = []

starting_location = 185

ax = 68 + starting_location + 70
bx = 40 + starting_location + 70
cx = 0 + starting_location + 70
dx = 28 + starting_location + 70

for i in range(6):
if i == 0:
color = 0xFF0000
elif i == 1:
color = 0xFFAA00
elif i == 2:
color = 0xFFFF00
elif i == 3:
color = 0x008800
elif i == 4:
color = 0x0000FF
else:
color = 0xAA00FF

bars_top.append(display.Polygon([ax, 100, bx, 100, cx, 170, dx, 170], color))
ax += 28
bx += 28
cx += 28
dx += 28

ax = 68 + starting_location
bx = 40 + starting_location
cx = 0 + starting_location
dx = 28 + starting_location

for i in range(6):
if i == 0:
color = 0xFF0000
elif i == 1:
color = 0xFFAA00
elif i == 2:
color = 0xFFFF00
elif i == 3:
color = 0x008800
elif i == 4:
color = 0x0000FF
else:
color = 0xAA00FF

bars_bottom.append(display.Polygon([ax, 230, bx, 230, cx, 300, dx, 300], color))
ax += 28
bx += 28
cx += 28
dx += 28

display.show(logo, bars_top, bars_bottom)


if fpga.read(1, 4) == b"Mncl":
t = display.Text("MONOCLE", 320, 200, display.WHITE, justify=display.MIDDLE_CENTER)
display.show(t)
del t
__splashscreen()

del fpga, display
del fpga, display, __splashscreen

0 comments on commit 2ef2673

Please sign in to comment.