Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

import time
import pyautogui
import math
# 获取窗口左上角坐标和宽度、高度
window_name = "Pi Day Challenge by matrix67"
window_info = pyautogui.getWindowsWithTitle(window_name)[0]
window_left = window_info.left
window_top = window_info.top
window_width = window_info.width
window_height = window_info.height
# 点击窗口标题栏,将焦点切换到指定窗口
window_info.activate()
# 计算圆的半径
radius = 664.95
# 计算圆心坐标
center_x = window_left + window_width // 2
center_y = window_top + window_height // 2+90
# 点击窗口标题栏,将焦点切换到指定窗口
pyautogui.click(window_info.left + 50, window_info.top + 10)
# 计算圆上某一点的坐标
angle = 0  # 将角度设置为圆的某个角度,这里设为 45 度
a = int(center_x + radius * math.cos(angle))
b = int(center_y + radius * math.sin(angle))
pyautogui.moveTo(a, b, duration=0)
# 按下鼠标左键
pyautogui.mouseDown(button='left')
time.sleep(0.5)
# 绘制圆形
steps = 100
for step in range(steps+1):
    angle = (2 * math.pi / steps) * step
    x = int(center_x + radius * math.cos(angle))
    y = int(center_y + radius * math.sin(angle))
    pyautogui.moveTo(x, y, duration=0)
# 抬起鼠标左键
pyautogui.mouseUp(button='left')
# 恢复鼠标位置
pyautogui.moveTo(center_x, center_y, duration=0)