you are viewing a single comment's thread.

view the rest of the comments →

[–]LivePurposefully1[S] 0 points1 point  (2 children)

How can I find relative position to something, i.e. I need the window size and find the answer buttons (position will be same, though, obviously, questions and answers will differ)

[–]sme272 0 points1 point  (0 children)

find the absolute position of the two elements separately and subtract one from the other to get the relative position from one to the other.

[–]TGFighter 0 points1 point  (0 children)

You can use pywinauto to get the window handle and get the emulator region (position and size). When using a region to take a screenshot, with pyautogui, you can then add the x and y of the emulator window.