Python:Tween函数pyautogui.ease版行为等于pyautogui.linear型()

2024-10-05 10:05:34 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用pyauthogui自动平滑地移动鼠标。为此,我使用了tween函数,如easeOutQuad()easeOutElastic()easeInCubic()等。 问题是鼠标的移动方式与默认函数pyauthogui.linear()相同。在

我已经测试了这个与微软油漆应用程序和喷枪工具,看看它是否有效。所以我的问题是,我有没有遗漏什么?在

使用: python 3.5 pyautogui 0.9.41版

import pyautogui
import time

# Needed time to set focus to Paint app
time.sleep(2.5)

pyautogui.dragRel(800, 0, 2)
pyautogui.moveRel(xOffset=-800, yOffset=20, duration=0)

pyautogui.easeOutQuad(1)
pyautogui.dragRel(800, 0, 2)
pyautogui.moveRel(xOffset=-800, yOffset=20, duration=0)

pyautogui.easeOutElastic(1)
pyautogui.dragRel(800, 0, 2)
pyautogui.moveRel(xOffset=-800, yOffset=20, duration=0)

pyautogui.easeInCubic(1)
pyautogui.dragRel(800, 0, 2)
pyautogui.moveRel(xOffset=-800, yOffset=20, duration=0)

expected output


Tags: to函数importtime鼠标durationpyautoguixoffset

热门问题