forked from marian42/pixelpi
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample_text.py
More file actions
25 lines (19 loc) · 720 Bytes
/
example_text.py
File metadata and controls
25 lines (19 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import time
import string
from screenfactory import create_screen
from modules.text_scroller import TextScroller
from helpers import Color
import config
if config.virtual_hardware:
import pygame
screen = create_screen()
text = "In a hole in the ground, there lived a Hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort."
scroller = TextScroller(screen, text, color=Color(0, 255, 0), speed=0.1, y_position=4)
scroller.start()
while True:
if config.virtual_hardware:
pygame.time.wait(10)
for event in pygame.event.get():
pass
else:
time.sleep(0.1)