A point on the screen, measured in pixels. Scale/anchor control coordinate mapping across screen sizes. After mapping and offsets, runtime consumers clamp the final point to the current screen's valid pixel range. Point can be destructured as x, y.
Syntax
Point(x, y, /, scale="fixed", anchor="none")Constructor parameters
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 | Coordinate scale mode. Values: fixed, auto, width, height. Default: fixed |
anchorString | Coordinate anchor. Values: none, center, top, bottom, left, right, top_left, top_right, bottom_left, bottom_right, auto. Default: none |
# 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 = p# Create a Point with scale/anchor and click that position
p = Point(500, 900, scale="width", anchor="center")
click(p)