Smart way to use MoveToObject (for different resolution)?

Discuss RoboTask here
Post Reply
snowseals
Posts: 59
Joined: Mon Apr 11, 2016 10:17 am

Smart way to use MoveToObject (for different resolution)?

Post by snowseals »

Is there smart way, like calculating, where the pixels will be on a different resolution?

Like for ex., I made all the scripts for 1920x1080.
Now I want to use the same scripts, on a different resolution on a laptop, like 1280x800.

I also saw something like Relative pixels, but I guess that only shows when using the Wait for Pixel -instance.

Is there some formula, so I can calculate the new positions/pixels in the script so the mouse cursor will be on-point?
Otherwise, I'll have to re-record the scripts again, on the other resolution.
Attachments
MoveToObject.png
MoveToObject.png (16.83 KiB) Viewed 13416 times
snowseals
Posts: 59
Joined: Mon Apr 11, 2016 10:17 am

Re: Smart way to use MoveToObject (for different resolution)

Post by snowseals »

Would this suffice?

Like 1920 = 100% / 100 = 19,20 x 1280 = 66,67%
As shown in attachment, Mouse Cursor Position for X = 565 at 1920 = 100%
565 / 100 = 5,65 x 66,67 = 376,68 is new Mouse Cursor Position for X?

Or is there an alternative/simpler way to convert/create the new postion?
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Smart way to use MoveToObject (for different resolution)

Post by Oleg »

Mouse actions are very dependent on current screen resolution.
There are no universal mechanism to calculate new element position because different windows have different behavior when it works in another size.

You can use VB script (or VB Evaluate) action if you want to use proportional calculation of new position.
Oleg Yershov
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Smart way to use MoveToObject (for different resolution)

Post by Oleg »

Another recommendation:
You can change window size and position before usage of mouse action.
Look at the action Window Size and position

Fore example change change size of window to 800*600 and use fixed mouse coordinates.
Oleg Yershov
Post Reply