That's a menu. And I'm happy with it.

This commit is contained in:
KikooDX 2020-04-27 19:00:34 +02:00
parent 9eddd23de8
commit d749c51361
4 changed files with 37 additions and 36 deletions

View File

@ -8,13 +8,17 @@ function int_hex(nb)
return [[\x]]..add..string.format("%x", nb)
end
file = io.open("output.py", "w")
file = io.open("imagination.py", "w")
first = true
pallet = {} --will store colors
pallet_last = 0
mem_pallet_last = 0
file:write([[from draw import *
black=(0,0,0)
for x in range(384):
for y in range(192):
S(x,y,black)
while 1:
]])

32
menu.py Normal file
View File

@ -0,0 +1,32 @@
from casioplot import *
choices = ("imagination", "tron", "image_clef_usb", "exit")
selection = 0
cursor = 0
try:
while 1:
try:
while 1:
clear_screen()
draw_string(0, 0, choices[selection].upper().replace("_", " "))
show_screen()
cursor += 1
if cursor == 64:
cursor = 0
selection += 1
if selection == len(choices):
selection = 0
except KeyboardInterrupt:
if choices[selection] == len(choices) - 1:
assert False
draw_string(0, 16, "Loading...")
show_screen()
try:
play = __import__(choices[selection])
except KeyboardInterrupt:
pass
clear_screen()
del play
except AssertionError:
pass

File diff suppressed because one or more lines are too long