Back map.py (temp)
This commit is contained in:
parent
00c58c925d
commit
1b5a86b0a2
7
map.py
7
map.py
@ -10,15 +10,14 @@ root = tk.Tk()
|
|||||||
canvas = tk.Canvas(root)
|
canvas = tk.Canvas(root)
|
||||||
canvas.pack()
|
canvas.pack()
|
||||||
|
|
||||||
root.geometry("1024x800")
|
root.geometry("1280x720")
|
||||||
root.tk.call('wm', 'iconphoto', root._w, tk.PhotoImage(file='map.png'))
|
|
||||||
ttext = tk.Canvas(root, width=90, height=20, bg="black")
|
ttext = tk.Canvas(root, width=90, height=20, bg="black")
|
||||||
ttext.place(x=940, y=0)
|
ttext.place(x=1180, y=0)
|
||||||
text = ttext.create_text(40, 10, text="X: 1, Y: 1", fill="white")
|
text = ttext.create_text(40, 10, text="X: 1, Y: 1", fill="white")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
x = root.winfo_pointerx() - root.winfo_rootx()
|
x = root.winfo_pointerx() - root.winfo_rootx()
|
||||||
y = 800 - (root.winfo_pointery() - root.winfo_rooty())
|
y = 720 - (root.winfo_pointery() - root.winfo_rooty())
|
||||||
ttext.itemconfig(text, text=f"X: {x}, Y: {y}")
|
ttext.itemconfig(text, text=f"X: {x}, Y: {y}")
|
||||||
|
|
||||||
# Открываем URL как файл
|
# Открываем URL как файл
|
||||||
|
Loading…
Reference in New Issue
Block a user