mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-12-24 11:21:44 +00:00
cleaned up test script
This commit is contained in:
parent
331204c196
commit
0c6b7c194e
15
API/main.py
15
API/main.py
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
from samplebase import SampleBase
|
||||
from deps.samplebase import SampleBase
|
||||
from rgbmatrix import graphics
|
||||
import time
|
||||
|
||||
@ -12,21 +12,18 @@ class Test(SampleBase):
|
||||
def run(self):
|
||||
offscreen_canvas = self.matrix.CreateFrameCanvas()
|
||||
font = graphics.Font()
|
||||
font.LoadFont("deps/fonts/7x13.bdf")
|
||||
textColor = graphics.Color(255, 255, 0)
|
||||
pos = offscreen_canvas.width
|
||||
my_text = self.args.text
|
||||
font.LoadFont("deps/fonts/9x18B.bdf")
|
||||
text_color = graphics.Color(255, 255, 255)
|
||||
|
||||
offscreen_canvas.Clear()
|
||||
graphics.DrawText(offscreen_canvas, font, pos, 10, textColor, my_text)
|
||||
offscreen_canvas = self.matrix.SwapOnVSync(offscreen_canvas)
|
||||
graphics.DrawText(offscreen_canvas, font, 0, 18, text_color, self.args.text)
|
||||
self.matrix.SwapOnVSync(offscreen_canvas)
|
||||
|
||||
while True:
|
||||
time.sleep(0.05)
|
||||
|
||||
|
||||
# Main function
|
||||
if __name__ == "__main__":
|
||||
test = Test()
|
||||
if (not test.process()):
|
||||
if not test.process():
|
||||
test.print_help()
|
||||
|
Loading…
Reference in New Issue
Block a user