-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
53 lines (38 loc) · 1.05 KB
/
main.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import multiprocessing as mp
import game_info
import screen_capture
import tkinter as tk
from PIL import Image, ImageTk
import time
import threading
import globby
import controls
gui = tk.Tk()
gui.title("Map Awareness")
gui.geometry('690x350')
# Have to use a label to display image?
img = tk.Label(gui)
img.grid(row=0, column=1)
mm_canvas = tk.Canvas(gui, width=348, height=348, bg="red")
mm_canvas.grid(row=0, column=0)
controls.render_frame(gui)
def clock():
pilImage = globby.image
pImage = ImageTk.PhotoImage(pilImage)
imagesprite = mm_canvas.create_image(0, 0, anchor=tk.NW, image=pImage)
img.image = pImage
gui.after(5, clock) # run itself again after 5 ms
def on_closing():
globby.closing = True
gui.destroy()
def init_ui():
clock()
gui.protocol("WM_DELETE_WINDOW", on_closing)
gui.mainloop()
if __name__ == '__main__':
globby.init()
t1 = threading.Thread(target=screen_capture.start_capture)
t1.start()
# t2 = threading.Thread(target=game_info.get_current_game)
# t2.start()
init_ui()