Toggle Navigation
Hatchery
Eggs
demo
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
import display, buttons display.drawFill(0x000000) display.drawCircle(60, 60, 50, 0, 360, True, 0xFFFFFF) display.drawCircle(60, 60, 40, 0, 360, True, 0x000000) display.drawCircle(60, 60, 30, 0, 360, True, 0xFFFFFF) display.drawCircle(60, 60, 20, 0, 360, True, 0x000000) display.drawCircle(60, 60, 10, 0, 360, True, 0xFFFFFF) display.drawLine(1, 1, 100, 100, 0xFFFFFF) display.drawRect(30, 30, 50, 50, True, 0xFFFFFF) display.drawText(150,25,"STILL",0xFFFFFF,"Roboto_BlackItalic24") display.drawText(130,50,"Hacking",0xFFFFFF,"PermanentMarker22") l = display.getTextWidth("Hacking","PermanentMarker22") display.drawLine(130, 72, 144 + l, 72, 0xFFFFFF) display.drawLine(140 + l, 52, 140 + l, 70, 0xFFFFFF) display.drawText(140,75,"Anyway",0xFFFFFF,"Roboto_BlackItalic24") display.flush() def render(text, pushed): if(pushed): display.drawText(100, 10, text, 0xFFFFFF, "PermanentMarker22") else: display.drawText(100, 10, text, 0xFFFFFF, "PermanentMarker22") display.flush() buttons.attach(buttons.BTN_UP, lambda pressed: render('UP', pressed)) buttons.attach(buttons.BTN_DOWN, lambda pressed: render('DOWN', pressed)) buttons.attach(buttons.BTN_LEFT, lambda pressed: render('LEFT', pressed)) buttons.attach(buttons.BTN_RIGHT, lambda pressed: render('RIGHT', pressed)) buttons.attach(buttons.BTN_A, lambda pressed: render('A', pressed)) buttons.attach(buttons.BTN_B, lambda pressed: render('B', pressed)) buttons.attach(buttons.BTN_START, lambda pressed: render('Start', pressed)) buttons.attach(buttons.BTN_SELECT, lambda pressed: render('Select', pressed))