Python RGB Matrix games and animations https://www.xythobuz.de/ledmatrix_v2.html
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

splash.py 1.2KB

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python
  2. class SplashScreen:
  3. def __init__(self, g, width = 32, height = 32):
  4. self.gui = g
  5. self.width = width
  6. self.height = height
  7. def draw(self):
  8. self.gui.set_pixel( 0, 0, (255, 255, 255))
  9. self.gui.set_pixel( 0, self.height - 1, ( 0, 0, 255))
  10. self.gui.set_pixel(self.width - 1, 0, (255, 0, 0))
  11. self.gui.set_pixel(self.width - 1, self.height - 1, ( 0, 255, 0))
  12. for i in range(0, int(min(self.width, self.height) / 3)):
  13. self.gui.set_pixel((self.width / 2) - 1 + i, (self.height / 2) - 1 + i, (255, 255, 255))
  14. self.gui.set_pixel((self.width / 2) - 1 - i, (self.height / 2) - 1 - i, (255, 255, 255))
  15. self.gui.set_pixel((self.width / 2) - 1 + i, (self.height / 2) - 1 - i, (255, 255, 255))
  16. self.gui.set_pixel((self.width / 2) - 1 - i, (self.height / 2) - 1 + i, (255, 255, 255))
  17. def finished(self):
  18. return True
  19. def restart(self):
  20. pass
  21. if __name__ == "__main__":
  22. from test import TestGUI
  23. t = TestGUI()
  24. s = SplashScreen(t)
  25. s.draw()
  26. t.debug_loop(s.draw)