Skip to content
Snippets Groups Projects
Commit ed827e7b authored by q3k's avatar q3k
Browse files

py: about WIP

parent 3aaa641b
No related branches found
No related tags found
No related merge requests found
......@@ -94,12 +94,104 @@ menu_badge = SimpleMenu(
],
vm,
)
from st3m import InputState, Ctx
from st3m.ui.view import ViewWithInputState
from st3m.utils import tau
import math
class About(ViewWithInputState):
def __init__(self):
self.ts = 0.0
super().__init__()
def think(self, ins: InputState, delta_ms: int) -> None:
super().think(ins, delta_ms)
self.ts += delta_ms / 1000
if self.input.left_shoulder.middle.pressed:
print("exiting")
def draw(self, ctx: Ctx) -> None:
ctx.rectangle(-120, -120, 240, 240)
ctx.rgb(117 / 255, 255 / 255, 226 / 255)
ctx.fill()
ctx.arc(0, 350, 300, 0, tau, 0)
ctx.rgb(61 / 255, 165 / 255, 30 / 255)
ctx.fill()
ctx.save()
y = -40 + math.cos(self.ts * 2 + 10) * 10
ctx.translate(0, y)
for i in range(5):
a = i * tau / 5 + self.ts
size = 30 + math.cos(self.ts) * 5
ctx.save()
ctx.rotate(a)
ctx.translate(30, 0)
ctx.arc(0, 0, size, 0, tau, 0)
ctx.gray(1)
ctx.fill()
ctx.restore()
ctx.arc(0, 0, 20, 0, tau, 0)
ctx.rgb(255 / 255, 247 / 255, 46 / 255)
ctx.fill()
ctx.restore()
ctx.start_group()
ctx.global_alpha = 0.5
ctx.rgb(0, 0, 0)
ctx.arc(0, 0, 80, 0, tau, 0)
ctx.fill()
ctx.end_group()
ctx.start_group()
ctx.global_alpha = 1.0
ctx.gray(1)
ctx.text_align = ctx.MIDDLE
ctx.font = "Camp Font 2"
ctx.font_size = 50
ctx.move_to(0, -33)
ctx.text("flow3r")
ctx.move_to(0, -3)
ctx.text("badge")
ctx.font = "Camp Font 3"
ctx.font_size = 15
ctx.move_to(0, 25)
ctx.text("Chaos")
ctx.move_to(0, 40)
ctx.text("Communication")
ctx.move_to(0, 55)
ctx.text("Camp 2023")
ctx.end_group()
menu_system = SimpleMenu(
[
MenuItemBack(),
MenuItemForeground("Settings", menu_settings),
MenuItemNoop("Disk Mode"),
MenuItemForeground("About", About()),
MenuItemNoop("Reboot"),
],
vm,
)
menu_main = SunMenu(
[
MenuItemForeground("Badge", menu_badge),
MenuItemForeground("Music", menu_music),
MenuItemForeground("Apps", menu_apps),
MenuItemForeground("Settings", menu_settings),
MenuItemForeground("System", menu_system),
],
vm,
)
......
  • q3k @q3k

    mentioned in commit f19bf6d5

    ·

    mentioned in commit f19bf6d5

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment