parent
a45da71815
commit
d33e39d894
|
@ -3,17 +3,14 @@ import random
|
|||
import threading
|
||||
import time
|
||||
from PIL import Image,ImageTk
|
||||
from pygame.examples.cursors import image
|
||||
|
||||
from 二维码生成器 import text_input, window
|
||||
|
||||
|
||||
class MovingLabel(threading.Thread):
|
||||
def __init__(self,window,text):
|
||||
threading.Thread.__init__(self)
|
||||
self.text=text
|
||||
self.label=tk.label(window,image=kuang,text=self.text,compound="center",font=("黑体",20),fg="white",width=190,height=45)
|
||||
self.label=tk.Label(window,image=kuang,text=self.text,compound="center",font=("黑体",20),fg="white",width=190,height=45)
|
||||
self.label.place(x=800,y=random.randint(10,550))
|
||||
|
||||
def run(self):
|
||||
x=800
|
||||
while x>-200:
|
||||
|
@ -21,6 +18,24 @@ class MovingLabel(threading.Thread):
|
|||
self.label.place(x=x)
|
||||
time.sleep(0.02)
|
||||
self.label.destroy()
|
||||
|
||||
|
||||
def send():
|
||||
text=e1.get()
|
||||
m1=MovingLabel(window,text)
|
||||
m1=MovingLabel(window,text)
|
||||
m1.start()
|
||||
|
||||
|
||||
window=tk.Tk()
|
||||
window.geometry("1000x670")
|
||||
window.resizable(0,0)
|
||||
kuang=ImageTk.PhotoImage(file="kuang.png")
|
||||
bg_image=Image.open("tv.png")
|
||||
bg_image=ImageTk.PhotoImage(bg_image)
|
||||
bg_label=tk.Label(window,image=bg_image)
|
||||
bg_label.pack()
|
||||
e1=tk.Entry(window,font=("黑体",20))
|
||||
e1.place(x=280,y=620)
|
||||
b1=tk.Button(window,text="发送弹幕",font=("黑体",20),command=send)
|
||||
b1.place(x=580,y=613)
|
||||
window.mainloop()
|
Loading…
Reference in New Issue