This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
component:screen:zh [2023/11/05 09:43] hfsr created |
component:screen:zh [2023/12/27 03:38] (current) hfsr [组件:屏幕] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Component: Screen | + | 组件:屏幕 |
================ | ================ | ||
- | This component is provided by [[block:screen|screen blocks]] (either when placed in the world or when installed in a robot). | + | 此组件由[[block:screen:zh|屏幕方块]](无论是放置于世界中还是安装于机器人上)提供。 |
- | Component name: `screen`. | + | 组件名:`screen`。 |
- | Callbacks: | + | |
+ | 回调函数: | ||
- `isOn():boolean` | - `isOn():boolean` | ||
- | Returns whether the screen is currently on. | + | 返回屏幕当前是否开启。 |
+ | \\ | ||
- `turnOn():boolean` | - `turnOn():boolean` | ||
- | Turns the screen on. Returns true if it was off. | + | 打开屏幕。若屏幕之前为关闭状态则返回`true`。 |
+ | \\ | ||
- `turnOff():boolean` | - `turnOff():boolean` | ||
- | Turns off the screen. Returns true if it was on. | + | 关闭屏幕。若屏幕之前为开启状态则返回`true`。 |
+ | \\ | ||
- `getAspectRatio():number, number` | - `getAspectRatio():number, number` | ||
- | The aspect ratio of the screen. For multi-block screens this is the number of blocks, horizontal and vertical. | + | 屏幕的长宽比。对多方块屏幕而言返回值为屏幕水平和垂直方向边长的方块数。 |
+ | \\ | ||
- `getKeyboards():table` | - `getKeyboards():table` | ||
- | The list of keyboards attached to the screen. | + | 获取连接到此屏幕的键盘列表。 |
- | - `setPrecise(enabled:boolean):boolean` | + | \\ |
- | Set whether to use high-precision mode (sub-pixel mouse event position). | + | - `setPrecise(enabled:boolean):boolean` |
- | //Requires Screen (Tier 3).// | + | 设定是否要启用高精度模式(将鼠标事件位置精确到子像素)。 |
+ | **需要3级屏幕。** | ||
+ | \\ | ||
- `isPrecise():boolean` | - `isPrecise():boolean` | ||
- | Check whether high-precision mode is enabled (sub-pixel mouse event position). | + | 检测是否启用了高精度模式(将鼠标事件位置精确到子像素)。 |
- | //Requires Screen (Tier 3).// | + | **需要3级屏幕。** |
+ | \\ | ||
- `setTouchModeInverted(enabled:boolean):boolean` | - `setTouchModeInverted(enabled:boolean):boolean` | ||
- | Sets Inverted Touch mode (Sneak-activate opens GUI if set to true). | + | 设置是否要启用触摸反转模式(若设置为`true`则潜行右键单击才能打开屏幕的GUI,默认为潜行右键单击触摸,直接右键单击开启GUI)。 |
+ | \\ | ||
- `isTouchModeInverted():boolean` | - `isTouchModeInverted():boolean` | ||
- | Check to see if Inverted Touch mode is enabled (Sneak-activate opens GUI is set to true). | + | 检查是否启用了触摸反转模式。 |
目录 | 目录 |