sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #32221
[Question #266455]: Region arguments seem to be mixed up?
New question #266455 on Sikuli:
https://answers.launchpad.net/sikuli/+question/266455
Hi RaiMan,
I've noticed that while using the Region() function it wouldn't find the things in the area I defined, so I used selectRegion() to check if my coordinates for the Region() are correct and I've found something odd:
This is how I defined my region, which should be a rectangle (ish) shape in the bottom-center part of the screen:
s0Width = Screen(0).getBounds().width
s0Height = Screen(0).getBounds().height
Region((int(s0Width*0.5-300)),0,(int(s0Width*0.5+300)),(int(s0Height*0.5))).exists(Pattern("1430816648032.png").similar(0.88)):
When I printed the xywh coordinates from this, this is what I got: 660, 0, 1260, 540.
AS I mentioned, the problem was that the command only found my pattern in the top-center of the monitor instead of the bottom-center.
So I've done the selectRegion() command, selecting roughly the same area, which gave me the following coordinate:
680,567 602x512 or I could say: 680,567,602,512 ?
So question is, was I wrong thinking that the Region() should be x and y coordinate of the left-bottom starting point of the rectangle pointing to w and h, which are the coordinates of the right-top point of the rectangle?
Even if I have to change my w and h to only count from the x and y, having to have y in the center-height instead of 0 seems very odd.
But it might be that I'm completely wrong here.. :)
Any help is much appreciated!
George
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.