pick_rect

command
v0.2.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Command pick_rect is a generic drag-to-pick CLI. It captures a screenshot from ADB (or a PNG file via -source), opens a browser drag UI labeled with -label, and saves the chosen rect to the JSON file at -out.

Use cases:

  • capture a "Continue" button after chest dismissal
  • capture any single UI element bounding box
  • quickly sketch a ref-space rect without writing a new picker

The saved JSON shape is the bare Rectangle:

{
  "x1": 100, "y1": 200, "x2": 300, "y2": 400
}

which matches `game.Rectangle` so callers can json.Unmarshal it directly into a *game.Rectangle without a wrapper struct.

Coords are stored in REFERENCE space (game.RefWidth × RefHeight) regardless of capture resolution; the runtime ScaleRef completes the conversion at tap-time.

Typical workflow:

# 1. Stage the screen you want to capture.
# 2. Drag a rect around the target.
go run cmd/pick_rect/main.go -label "Continue button" -out assets/continue_button.json
# 3. Restart the consumer (or wait for next bot-startup) to pick up the new geometry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL