-
Notifications
You must be signed in to change notification settings - Fork 0
/
getFile.py
37 lines (26 loc) · 900 Bytes
/
getFile.py
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
from pygame import *
from getName import*
screen = display.set_mode((1000,600))
display.set_caption("Right Click to type")
font.init() # must have this in your program for my font to work
comicFont = font.SysFont("Comic Sans MS", 20)
screen.fill((222,222,222))
running =True
y = 20
message = ""
while running:
click = False
for e in event.get():
if e.type == QUIT:
running = False
mb = mouse.get_pressed()
mx,my = mouse.get_pos()
if mb[0]==1:
txt = getName(screen,False) # this is how you would call my getName function
# your main loop will stop looping until user hits enter
txtPic = comicFont.render(txt, True, (255,0,0))
screen.blit(txtPic,(mx,my))
display.flip()
font.quit()
del comicFont
quit()