Runtime v2.81 · Updated Sep 30, 2026

Point

A point on the screen, measured in pixels.

Syntax

Point(x, y, /, scale="fixed", anchor="none")

Constructor parameters

NameDescription
xNumber
X coordinate in pixels
Required · Positional only
No default
yNumber
Y coordinate in pixels
Required · Positional only
No default
scaleString
Coordinate scale mode.
Optional · Positional or named
Default: fixed
anchorString
Coordinate anchor.
Optional · Positional or named
Default: none

Returns

Point

Behavior / side effects

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.

Execution

  • Blocking: No
  • Thread safety: Use separate objects per flow
  • Parallel execution: Yes

Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.

Example

origin = Point(0, 0)
target = Point(500, 900)
swipe([
    SwipePoint(origin, speed="NORMAL"),
    SwipePoint(target)
])

Errors / limitations

No additional limitations documented; follow the parameter and behavior contract above.

Related APIs

None

Fields

NameDescription
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
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 = p
Constructor example
# Create a Point with scale/anchor and click that position
p = Point(500, 900, scale="width", anchor="center")
click(p)

Methods

3 methods

Point.offset

Resolve this Point on the current screen, multiply integer pixel dx/dy by the selected full-screen width or height ratio without rotating the delta axes, then add the result and return a new fixed-pixel Point with anchor none.

Syntax

point.offset(dx, dy, scale=None)

Parameters

NameDescription
dxInt
Integer pixel delta on the Point X axis. Decimal and normalized values are rejected.
Required · Positional or named
No default
dyInt
Integer pixel delta on the Point Y axis. Decimal and normalized values are rejected.
Required · Positional or named
No default
scaleString?
Offset scale mode using full-screen dimensions. Defaults to this Point's current scale. Values: fixed, auto, width, height.
Optional · Positional or named
Default: None

Returns

Point — A resolved fixed-pixel Point clamped to the current screen, whose scale is FIXED_PIXEL and anchor is NONE.

Behavior / side effects

Resolve this Point on the current screen, multiply integer pixel dx/dy by the selected full-screen width or height ratio without rotating the delta axes, then add the result and return a new fixed-pixel Point with anchor none. App viewport size is not used. When scale is omitted, the offset inherits this Point's scale. The original point is not mutated.

Execution

  • Blocking: No
  • Thread safety: Use separate objects per flow
  • Parallel execution: Yes

Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.

Example

# Scale the pixel delta by full-screen width, then add it to Point
target = Point(500, 900, scale="width", anchor="center").offset(120, -80)
print(target)
target.highlight()

Errors / limitations

No additional limitations documented; follow the parameter and behavior contract above.

Related APIs

Point.highlight

Draw a highlighted square centered at this point.

Syntax

point.highlight(color="green", line_width=2, region_width=36, auto_hide_ms=0)

Parameters

NameDescription
colorColor | String | Number
Highlight color.
Optional · Positional or named
Default: green
line_widthNumber
Stroke thickness in dp.
Optional · Positional or named
Default: 2
region_widthNumber
Square width/height in pixels.
Optional · Positional or named
Default: 36
auto_hide_msNumber
Auto-hide after N milliseconds. 0 disables auto-hide.
Optional · Positional or named
Default: 0

Returns

Region — The highlighted square region centered around the point.

Behavior / side effects

Draw a highlighted square centered at this point. Re-highlighting the same point instance replaces the previous one.

Execution

  • Blocking: No
  • Thread safety: Use separate objects per flow
  • Parallel execution: Yes

Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.

Example

p = Point(500, 900)
p.highlight()

Errors / limitations

No additional limitations documented; follow the parameter and behavior contract above.

Related APIs

Point.highlight_off

Turn off highlight for this point instance.

Syntax

point.highlight_off()

Parameters

None

Returns

Point — Returns the same point after turning highlight off.

Behavior / side effects

Turn off highlight for this point instance.

Execution

  • Blocking: No
  • Thread safety: Use separate objects per flow
  • Parallel execution: Yes

Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.

Example

p = Point(500, 900)
p.highlight("red", 3)
wait(1000)
p.highlight_off()

Errors / limitations

No additional limitations documented; follow the parameter and behavior contract above.

Related APIs