guibot.match module¶
SUMMARY¶
Class and functionality related to target matches on screen.
INTERFACE¶
- class guibot.match.Match(xpos, ypos, width, height, dx=0, dy=0, similarity=0.0, dc=None, cv=None)[source]¶
Bases:
Region
Wrapper around image which adds data necessary for manipulation of matches on a screen.
- property x¶
Getter for readonly attribute.
- Returns:
x coordinate of the upleft vertex of the region
- Return type:
int
- property y¶
Getter for readonly attribute.
- Returns:
y coordinate of the upleft vertex of the region
- Return type:
int
- property dx¶
Getter for readonly attribute.
- Returns:
x offset from the center of the match region
- Return type:
int
- property dy¶
Getter for readonly attribute.
- Returns:
y offset from the center of the match region
- Return type:
int
- property similarity¶
Getter for readonly attribute.
- Returns:
similarity the match was obtained with
- Return type:
float
- property target¶
Getter for readonly attribute.
- Returns:
target location to click on if clicking on the match
- Return type:
location.Location
- calc_click_point(xpos, ypos, width, height, offset)[source]¶
Calculate target location to click on if clicking on the match.
- Parameters:
xpos (int) – x coordinate of upleft vertex of the match region
ypos (int) – y coordinate of upleft vertex of the match region
width (int) – width of the match region
height (int) – height of the match region
offset (
location.Location
) – offset from the match region center for the final target
- Returns:
target location to click on if clicking on the match
- Return type:
location.Location