A screen position in pixels, used for clicks, swipes and highlights. Scale and anchor adapt the position to another screen size; the final position is kept within the screen. Read both coordinates with x, y = point.
Syntax
Point(x, y, /, scale="fixed", anchor="none")Constructor parameters
| Name | Description |
|---|---|
xNumber | X coordinate in pixels Required · Positional only No default |
yNumber | Y coordinate in pixels Required · Positional only No default |
scaleString | How coordinates adapt from the macro screen: fixed keeps pixels; auto scales X by width and Y by height; width or height scales both axes by that dimension. Non-fixed coordinates or an anchor also follow macro screen rotation and app area mapping. Optional · Positional or named Default: fixed |
anchorString | Reference position for adapting coordinates: none (top-left), center, top, bottom, left, right, top_left, top_right, bottom_left, bottom_right. auto chooses the nearest edge or center. Optional · Positional or named Default: none |
Returns
Example
origin = Point(0, 0)
target = Point(500, 900)
swipe([
SwipePoint(origin, speed="NORMAL"),
SwipePoint(target)
])Fields
| Name | Description |
|---|---|
xNumber | Horizontal coordinate in pixels. |
yNumber | Vertical coordinate in pixels. |
scaleString | How coordinates adapt from the macro screen: fixed keeps pixels; auto scales X by width and Y by height; width or height scales both axes by that dimension. Non-fixed coordinates or an anchor also follow macro screen rotation and app area mapping. Default: fixed |
anchorString | Reference position for adapting coordinates: none (top-left), center, top, bottom, left, right, top_left, top_right, bottom_left, bottom_right. auto chooses the nearest edge or center. Default: none |
Field example
# Read the x, y values of Point
p = Point(500, 900)
x_value = p.x #500
y_value = p.y #900
scale_value = p.scale #FIXED_PIXEL
# Unpack Point into x, y coordinates
x, y = pConstructor example
# Create a Point with scale/anchor and click that position
p = Point(500, 900, scale="width", anchor="center")
click(p)