Python RGB Matrix games and animations https://www.xythobuz.de/ledmatrix_v2.html
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

solid.py 646B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python
  2. import time
  3. class Solid:
  4. def __init__(self, g, t = 1.0, c = (0, 0, 0)):
  5. self.gui = g
  6. self.time = t
  7. self.color = c
  8. self.start = time.time()
  9. def restart(self):
  10. self.start = time.time()
  11. def finished(self):
  12. return (time.time() - self.start) >= self.time
  13. def draw(self):
  14. for x in range(0, self.gui.width):
  15. for y in range(0, self.gui.height):
  16. self.gui.set_pixel(x, y, self.color)
  17. if __name__ == "__main__":
  18. from test import TestGUI
  19. t = TestGUI(32, 32)
  20. d = ScrollText(t, "Hello, World!")
  21. t.debug_loop(d.draw)