Skip to content

Commit 3fa67ff

Browse files
committed
update screen coordinates
Signed-off-by: 82Flex <82flex@gmail.com>
1 parent 5dcc94d commit 3fa67ff

6 files changed

Lines changed: 230 additions & 6 deletions

File tree

Lines changed: 44 additions & 0 deletions
Loading
Lines changed: 44 additions & 0 deletions
Loading

docs/lua-manual/appendix/screen-coordinates.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,32 @@ XXTouch Elite always uses physical pixels as units, with the hardware resolutio
1414
- [iOS Design Cheat Sheet](https://kapeli.com/cheat_sheets/iOS_Design.docset/Contents/Resources/Documents/index)
1515
- [The Ultimate Guide To iPhone Resolutions](https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions)
1616

17-
:::tip
18-
In your script, you can change the screen coordinate system using the [`screen.init`](../screen.md#initialize-rotated-coordinate-system-screeninit) function.
17+
## Device default orientation and affected modules
18+
19+
This chapter uses the hardware coordinate system (physical pixels). In addition, XXTouch Elite defines device-specific default orientations that affect how coordinates are interpreted by common features.
20+
21+
### Default orientations
22+
23+
For historical reasons, any mention in this manual of “HOME button at the bottom” should be read as the device’s default orientation; likewise, mentions of the HOME button being left/right/top correspond to the respective orientation conventions.
24+
25+
iPhone: Portrait (upright). This is the default orientation for screenshots, simulated taps, record-and-replay, and Script UI.
26+
27+
![Bezel_iPhone](./img/bezel-iphone-default.svg)
28+
29+
iPad: Facing the screen, the default orientation is with the charging port on the right side (Landscape Right).
30+
31+
![Bezel_iPad](./img/bezel-ipad-default.svg)
32+
33+
### What this impacts
34+
35+
- Screen-related operations: capturing screenshots, cropping regions, color sampling, and image recognition all interpret X/Y in the default orientation unless you change it.
36+
- Touch interactions: coordinates for tapping, swiping, and other gestures; recorded tracks are played back under the default orientation.
37+
- Record and replay: gesture paths are stored in hardware coordinates and assumed to run under the default orientation unless reconfigured.
38+
- Script UI and overlays: any absolute screen positions used by UI/overlay components follow the same orientation rules.
39+
- Image/template reuse: templates/screenshots created under one orientation should be used under the same orientation, or you should rotate/normalize via `screen.init`.
40+
41+
### Changing the coordinate system in scripts
42+
43+
When needed, use [`screen.init`](../screen.md#initialize-rotated-coordinate-system-screeninit) to rotate the working coordinate system for your script, while XXTouch Elite still operates on hardware pixels underneath. It’s good practice to explicitly set your intended orientation at the start of a script.
1944

2045
![Screen_Coordinates.002](./img/Screen_Coordinates.002.png)
21-
:::
Lines changed: 44 additions & 0 deletions
Loading
Lines changed: 44 additions & 0 deletions
Loading

i18n/zh-Hans/docusaurus-plugin-content-docs/current/lua-manual/appendix/screen-coordinates.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,32 @@ XXTouch Elite 始终以物理像素为单位,使用硬件分辨率坐标系
1414
- [iOS Design Cheat Sheet](https://kapeli.com/cheat_sheets/iOS_Design.docset/Contents/Resources/Documents/index)
1515
- [The Ultimate Guide To iPhone Resolutions](https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions)
1616

17-
:::tip
18-
在脚本当中,你可以使用 [`screen.init`](../screen.md#初始化旋转坐标系-screeninit) 改变屏幕坐标系。
17+
## 设备默认方向与受影响的模块
18+
19+
本章所述均基于硬件分辨率坐标系(物理像素)。此外,XXTouch Elite 针对不同设备规定了默认方向,影响常见功能对坐标的解释方式。
20+
21+
### 默认方向
22+
23+
出于历史原因,本文档中出现的 “HOME 键在下” 等说法,均可理解为对应设备的默认方向;同理,“HOME 键在左/右/上” 等描述也分别指代与之对应的方向约定。
24+
25+
iPhone:竖直向上(Portrait)。该默认方向适用于屏幕截取、模拟点击、录制回放和脚本 UI 等操作。
26+
27+
![Bezel_iPhone](./img/bezel-iphone-default.svg)
28+
29+
iPad:正对屏幕,充电接口位于右侧(横屏向右)为默认方向。
30+
31+
![Bezel_iPad](./img/bezel-ipad-default.svg)
32+
33+
### 影响范围
34+
35+
- 屏幕相关操作:截图、区域裁剪、取色与图像识别等,若未显式修改,将按默认方向解析坐标。
36+
- 触控交互:点击、滑动等手势坐标;录制的轨迹会在默认方向下回放。
37+
- 录制与回放:手势路径以硬件坐标存储,除非重新配置,否则按默认方向执行。
38+
- 脚本 UI 与覆盖层:使用绝对屏幕坐标的 UI/Overlay 组件遵循相同的方向规则。
39+
- 图像/模板复用:在某一方向下制作的模板/截图,应在相同方向下使用;或通过 `screen.init` 进行旋转/归一化。
40+
41+
### 在脚本中切换坐标系
42+
43+
如需调整,请使用 [`screen.init`](../screen.md#初始化旋转坐标系-screeninit) 在脚本中显式设定工作坐标系。底层仍以硬件像素运作。建议在脚本开头明确设置预期方向。
1944

2045
![Screen_Coordinates.002](./img/Screen_Coordinates.002.png)
21-
:::

0 commit comments

Comments
 (0)