I am currently working on rebuilding pyautogui that allows for adaptive resolution scaling, screen specific automation and much more.
I will get to the question but the context to understand it better:
You are a developer, you created a bot using pyautogui, and you have two screen both are at 1440p. you friend wants to use the bot you made but has one screen and 1080p screen, but you will face two issues:
1- pyautogui uses global coordinates, so all the coordinates you use will be off.
2- the images you took and used for locateonscreen, were based on 1440p screen, that means it wont work on his 1080p screen.
My solution was to create something like this:
chat_bot = mymodule.Session(screen=1, original_res=(2560,1440))
game_start = game_bot.locateonscreen("images/game_start.png", grayscale=True, region=(85, 110, 167, 78)```
by providing the original_resolution and screen, the program will be able to compare the current users screen, with the original resolution the bot was made with, and will convert the coordinates accordingly.
I need your feedback, do you think this method is the best way to solve this problem (for both the developer and users), how would you recommend the module should handle new users (who don't know how to code) on how they will route their screens vsthe developer setup (for example them saying my game is actually on screen 1 not 0, and so on).
Please note, the module will have a GUI that does the coding heavy lifting I have attached a gif of how it works as an example (the flicking is due to the overlay being visible and stopping the locate on screen from finding the image)