Python RGB Matrix games and animations https://www.xythobuz.de/ledmatrix_v2.html
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

splash.py 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env python3
  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. import platform
  23. t = None
  24. if platform.machine() == "armv7l":
  25. from pi import PiMatrix
  26. t = PiMatrix()
  27. else:
  28. from test import TestGUI
  29. t = TestGUI()
  30. s = SplashScreen(t)
  31. s.draw()
  32. t.debug_loop(s.draw)