-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
38 lines (27 loc) · 696 Bytes
/
example.py
File metadata and controls
38 lines (27 loc) · 696 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
26
27
28
29
30
31
32
33
34
35
36
37
38
from pytermrender import *
from colorama import Fore, Back, Style
Screen = TermScreen(height=24, width=80, framerate=30)
def setup():
print("Setup")
print("Clearing")
clearScreen()
return
def teardown():
clearScreen()
print("Teardown")
print("Teardown Complete")
return
#not strictly needed, but useful
def tick():
Screen.frame_no+=1
return
def draw():
clearScreen()
clearAllBuffers()
frame = Screen.frame_no
drawBox(0,0,Screen.width,Screen.height,'#')
printBuffer(1,1,str(Screen.framerate)+'fps -'+str(frame)+'-')
for ix, c in enumerate(str(frame)):
putBuffer(8+ix,1, Fore.BLUE, buffer="color")
return
run()