pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Face Gameboy

Example

from m5stack import *
from m5ui import *
from uiflow import *
import face

setScreenColor(0x222222)

faces_boy = face.get(face.GAMEBOY)

while True:
  if faces_boy.getStatus(0):
    print('up')
  if faces_boy.getStatus(1):
    print('down')
  if faces_boy.getStatus(2):
    print('left')
  if faces_boy.getStatus(3):
    print('right')
  if faces_boy.getStatus(4):
    print('Button A')
  if faces_boy.getStatus(5):
    print('Button B')
  if faces_boy.getStatus(6):
    print('Button Select')
  if faces_boy.getStatus(7):
    print('Button Start')
  wait_ms(2)

API

faces_boy.getPressed(key)
faces_boy.getReleased(key)
  • Detecting gameboy key click, release events.
    • key:
      • 0:up
      • 1:down
      • 2:left
      • 3:right
      • 4:BtnA
      • 5:BtnB
      • 6:Btn Select
      • 7:Btn Start
faces_boy.getStatus(key)
  • Detecting gameboy keyboard key press status
    • key:
      • 0:up
      • 1:down
      • 2:left
      • 3:right
      • 4:BtnA
      • 5:BtnB
      • 6:Btn Select
      • 7:Btn Start
On This Page