|
|
@@ -6,78 +6,78 @@
|
|
|
- [run environment initialization](#run-environment-initialization)
|
|
|
- [event](#event)
|
|
|
- [get key event](#get-key-event)
|
|
|
- - [按键事件记录](#按键事件记录)
|
|
|
+ - [key event recording](#key-event-recording)
|
|
|
- [graphics](#graphics)
|
|
|
- - [刷新图层](#刷新图层)
|
|
|
- - [获取屏幕大小](#获取屏幕大小)
|
|
|
- - [stage 初始化](#stage-初始化)
|
|
|
- - [注册 layer](#注册-layer)
|
|
|
- - [移除 layer](#移除-layer)
|
|
|
- - [使 layer 可见](#使-layer-可见)
|
|
|
- - [使 layer 不可见](#使-layer-不可见)
|
|
|
- - [获取 layer 对象指针](#获取-layer-对象指针)
|
|
|
- - [背景颜色 layer 初始化](#背景颜色-layer-初始化)
|
|
|
- - [背景 layer 初始化](#背景-layer-初始化)
|
|
|
- - [基本单元 layer 初始化](#基本单元-layer-初始化)
|
|
|
- - [绘制基本单元](#绘制基本单元)
|
|
|
- - [用户单元 layer 初始化](#用户单元-layer-初始化)
|
|
|
- - [绘制用户单元](#绘制用户单元)
|
|
|
- - [文本 layer 初始化](#文本-layer-初始化)
|
|
|
- - [绘制文本](#绘制文本)
|
|
|
- - [数字列表 layer 初始化](#数字列表-layer-初始化)
|
|
|
- - [获取选中数字索引](#获取选中数字索引)
|
|
|
- - [菜单 layer 初始化](#菜单-layer-初始化)
|
|
|
- - [获取选中菜单项名称](#获取选中菜单项名称)
|
|
|
- - [获取选中菜单项索引](#获取选中菜单项索引)
|
|
|
+ - [refresh layer](#refresh-layer)
|
|
|
+ - [get screen size](#get-screen-size)
|
|
|
+ - [stage initialization](#stage-initialization)
|
|
|
+ - [register layer](#register-layer)
|
|
|
+ - [remove layer](#remove-layer)
|
|
|
+ - [make layer visible](#make-layer-visible)
|
|
|
+ - [make layer invisible](#make-layer-invisible)
|
|
|
+ - [get the layer object pointer](#get-the-layer-object-pointer)
|
|
|
+ - [background color layer initialization](#background-color-layer-initialization)
|
|
|
+ - [background layer initialization](#background-layer-initialization)
|
|
|
+ - [cell layer initialization](#cell-layer-initialization)
|
|
|
+ - [draw cell](#draw-cell)
|
|
|
+ - [user layer initialization](#user-layer-initialization)
|
|
|
+ - [draw user cell](#draw-user-cell)
|
|
|
+ - [text layer initialization](#text-layer-initialization)
|
|
|
+ - [draw text](#draw-text)
|
|
|
+ - [number list layer initialization](#number-list-layer-initialization)
|
|
|
+ - [get the selected number index](#get-the-selected-number-index)
|
|
|
+ - [menu layer initialization](#menu-layer-initialization)
|
|
|
+ - [get the name of the selected menu item](#get-the-name-of-the-selected-menu-item)
|
|
|
+ - [get the selected menu item index](#get-the-selected-menu-item-index)
|
|
|
- [PikaPython](#pikapython)
|
|
|
- [common](#common-1)
|
|
|
- - [引擎初始化](#引擎初始化)
|
|
|
- - [颜色转换](#颜色转换)
|
|
|
- - [按键事件类](#按键事件类)
|
|
|
- - [按键事件类初始化](#按键事件类初始化)
|
|
|
- - [更新按键状态](#更新按键状态)
|
|
|
- - [获取按键方向](#获取按键方向)
|
|
|
- - [获取按键事件](#获取按键事件)
|
|
|
- - [graphics 类](#graphics-类)
|
|
|
- - [graphics 类初始化](#graphics-类初始化)
|
|
|
- - [申请刷新](#申请刷新)
|
|
|
- - [切换 stage](#切换-stage)
|
|
|
- - [stage 类](#stage-类)
|
|
|
- - [stage 类初始化](#stage-类初始化)
|
|
|
- - [注册 layer](#注册-layer-1)
|
|
|
- - [移除 layer](#移除-layer-1)
|
|
|
- - [使 layer 可见](#使-layer-可见-1)
|
|
|
- - [使 layer 不可见](#使-layer-不可见-1)
|
|
|
- - [screen 类](#screen-类)
|
|
|
- - [screen 类初始化](#screen-类初始化)
|
|
|
- - [获取 screen 宽度](#获取-screen-宽度)
|
|
|
- - [获取 screen 高度](#获取-screen-高度)
|
|
|
- - [region 类](#region-类)
|
|
|
- - [region 类初始化](#region-类初始化)
|
|
|
- - [border opacity 类](#border-opacity-类)
|
|
|
- - [border opacity 类初始化](#border-opacity-类初始化)
|
|
|
- - [corner opacity 类](#corner-opacity-类)
|
|
|
- - [corner opacity 类初始化](#corner-opacity-类初始化)
|
|
|
- - [背景颜色 layer 类](#背景颜色-layer-类)
|
|
|
- - [背景颜色 layer 类初始化](#背景颜色-layer-类初始化)
|
|
|
- - [基础单元 layer 类](#基础单元-layer-类)
|
|
|
- - [基础单元 layer 类初始化](#基础单元-layer-类初始化)
|
|
|
- - [基础单元绘制](#基础单元绘制)
|
|
|
- - [用户单元 layer 类](#用户单元-layer-类)
|
|
|
- - [用户单元 layer 类初始化](#用户单元-layer-类初始化)
|
|
|
- - [用户单元绘制](#用户单元绘制)
|
|
|
- - [文本 layer 类](#文本-layer-类)
|
|
|
- - [文本 layer 类初始化](#文本-layer-类初始化)
|
|
|
- - [绘制字符串](#绘制字符串)
|
|
|
- - [绘制数字](#绘制数字)
|
|
|
- - [数字列表 layer 类](#数字列表-layer-类)
|
|
|
- - [数字列表 layer 类初始化](#数字列表-layer-类初始化)
|
|
|
- - [选中列表项索引获取](#选中列表项索引获取)
|
|
|
- - [item format 类](#item-format-类)
|
|
|
- - [item format 类初始化](#item-format-类初始化)
|
|
|
- - [菜单 layer 类](#菜单-layer-类)
|
|
|
- - [菜单 layer 类初始化](#菜单-layer-类初始化)
|
|
|
- - [选中列表项索引获取](#选中列表项索引获取-1)
|
|
|
+ - [engine initialization](#engine-initialization)
|
|
|
+ - [color conversion](#color-conversion)
|
|
|
+ - [key event class](#key-event-class)
|
|
|
+ - [key event class initialization](#key-event-class-initialization)
|
|
|
+ - [update key status](#update-key-status)
|
|
|
+ - [get key direction](#get-key-direction)
|
|
|
+ - [get key events](#get-key-events)
|
|
|
+ - [graphics class](#graphics-class)
|
|
|
+ - [graphics class initialization](#graphics-class-initialization)
|
|
|
+ - [apply for refresh](#apply-for-refresh)
|
|
|
+ - [switch stage](#switch-stage)
|
|
|
+ - [stage class](#stage-class)
|
|
|
+ - [stage class initialization](#stage-class-initialization)
|
|
|
+ - [register layer](#register-layer-1)
|
|
|
+ - [remove layer](#remove-layer-1)
|
|
|
+ - [make layer visible](#make-layer-visible-1)
|
|
|
+ - [make layer invisible](#make-layer-invisible-1)
|
|
|
+ - [screen class](#screen-class)
|
|
|
+ - [screen class initialization](#screen-class-initialization)
|
|
|
+ - [get screen width](#get-screen-width)
|
|
|
+ - [get screen height](#get-screen-height)
|
|
|
+ - [region class](#region-class)
|
|
|
+ - [region class initialization](#region-class-initialization)
|
|
|
+ - [border opacity class](#border-opacity-class)
|
|
|
+ - [border opacity class initialization](#border-opacity-class-initialization)
|
|
|
+ - [corner opacity class](#corner-opacity-class)
|
|
|
+ - [corner opacity class initialization](#corner-opacity-class-initialization)
|
|
|
+ - [background color layer class](#background-color-layer-class)
|
|
|
+ - [background color layer class initialization](#background-color-layer-class-initialization)
|
|
|
+ - [cell layer class](#cell-layer-class)
|
|
|
+ - [cell layer class initialization](#cell-layer-class-initialization)
|
|
|
+ - [draw cell](#draw-cell-1)
|
|
|
+ - [user layer class](#user-layer-class)
|
|
|
+ - [user layer class initialization](#user-layer-class-initialization)
|
|
|
+ - [draw user cell](#draw-user-cell-1)
|
|
|
+ - [text layer class](#text-layer-class)
|
|
|
+ - [text layer class initialization](#text-layer-class-initialization)
|
|
|
+ - [print string](#print-string)
|
|
|
+ - [print number](#print-number)
|
|
|
+ - [number list layer class](#number-list-layer-class)
|
|
|
+ - [number list layer class initialization](#number-list-layer-class-initialization)
|
|
|
+ - [get the index of the selected list item](#get-the-index-of-the-selected-list-item)
|
|
|
+ - [item format class](#item-format-class)
|
|
|
+ - [item format class initialization](#item-format-class-initialization)
|
|
|
+ - [menu layer class](#menu-layer-class)
|
|
|
+ - [menu layer class initialization](#menu-layer-class-initialization)
|
|
|
+ - [get the index of the selected list item](#get-the-index-of-the-selected-list-item-1)
|
|
|
|
|
|
## C
|
|
|
|
|
|
@@ -102,812 +102,816 @@
|
|
|
|
|
|
`rt_err_t tnsq_evt_itc_get(tnsq_evt_key_t *ptKey, rt_int32_t timeout);`
|
|
|
|
|
|
-> 在指定的时间内,从事件队列(FIFO)中移除相关事件并将其存储在 ptKey 中,若 timeout 为 0,表示无等待的获取事件。
|
|
|
+> Within the specified time, remove relevant events from the event queue (FIFO) and store them in ptKey. If timeout is 0, it means there is no waiting to obtain events.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptKey` | 指向 `tnsq_evt_key_t` 结构的指针,用于存储从事件队列获取的事件数据 |
|
|
|
-| `timeout` | 等待事件的超时时间 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `RT_EOK` | 正确执行 |
|
|
|
-| `-RT_ETIMEOUT` | 超时 |
|
|
|
-| `-RT_ERROR` | 错误执行 |
|
|
|
+| `*ptKey` | Pointer to `tnsq_evt_key_t` structure, used to store event data obtained from the event queue |
|
|
|
+| `timeout` | Timeout for waiting for events |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `RT_EOK` | Correct execution |
|
|
|
+| `-RT_ETIMEOUT` | Timeout |
|
|
|
+| `-RT_ERROR` | Error execution |
|
|
|
|
|
|
-#### 按键事件记录
|
|
|
+#### key event recording
|
|
|
|
|
|
`rt_err_t tnsq_evt_itc_put(tnsq_evt_key_t *ptKey);`
|
|
|
|
|
|
-> 将相关的事件,存入事件队列(FIFO)中。
|
|
|
+> Store relevant events in the event queue (FIFO).
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptKey` | 指向 `tnsq_evt_key_t` 结构的指针,表示要放入事件队列的事件数据 |
|
|
|
-| `timeout` | 等待事件的超时时间 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `RT_EOK` | 正确执行 |
|
|
|
-| `-RT_EFULL` | 事件队列已满 |
|
|
|
-| `-RT_ERROR` | 错误执行 |
|
|
|
+| `*ptKey` | Pointer to `tnsq_evt_key_t` structure, representing the event data to be put into the event queue |
|
|
|
+| `timeout` | Timeout for waiting for events |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `RT_EOK` | Correct execution |
|
|
|
+| `-RT_EFULL` | The event queue is full |
|
|
|
+| `-RT_ERROR` | Error execution |
|
|
|
|
|
|
### graphics
|
|
|
|
|
|
-#### 刷新图层
|
|
|
+#### refresh layer
|
|
|
|
|
|
`void tnsq_gfx_apply_for_refresh(void);`
|
|
|
|
|
|
-> 申请刷新屏幕。
|
|
|
+> Apply to refresh the screen.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `无` | 无参数 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `None` | No parameters |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 获取屏幕大小
|
|
|
+#### get screen size
|
|
|
|
|
|
`arm_2d_size_t tnsq_gfx_get_screen_size(arm_2d_scene_player_t *ptDispAdapter);
|
|
|
`
|
|
|
|
|
|
-> 获取指定 display adapter 对应屏幕的大小。
|
|
|
+> Get the screen size corresponding to the specified display adapter.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptDispAdapter` | 指向`arm_2d_scene_player_t` 结构的指针,代表对应的 display adapter |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `arm_2d_size_t` | 表示屏幕的大小的结构体,包括宽度(width)和高度(height) |
|
|
|
+| `*ptDispAdapter` | Pointer to the `arm_2d_scene_player_t` structure, representing the corresponding display adapter |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `arm_2d_size_t` | A structure representing the size of the screen, including width (width) and height (height) |
|
|
|
|
|
|
-#### stage 初始化
|
|
|
+#### stage initialization
|
|
|
|
|
|
`tnsq_gfx_stage_t *tnsq_gfx_stage_init(tnsq_gfx_stage_cfg_t *ptStageCFG, tnsq_gfx_stage_t *ptStage);`
|
|
|
|
|
|
-> 初始化一个 stage,如果 `ptStage` 为 `RT_NULL` 或为空,对应的 stage 对象由引擎动态分配与回收;如果 `ptStage` 不为 `RT_NULL`,对应的 stage 对象由用户负责,用户需保证生命周期内 stage 对象占用的地址空间始终有效,否则将导致未定义的错误。
|
|
|
+> Initialize a stage. If `ptStage` is `RT_NULL` or empty, the corresponding stage object is dynamically allocated and recycled by the engine; if `ptStage` is not `RT_NULL`, the corresponding stage object is the responsibility of the user, and the user needs to ensure the life cycle The address space occupied by the inner stage object is always valid, otherwise an undefined error will result.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptStageCFG` | 指向 `tnsq_gfx_stage_cfg_t` 结构的指针,包含用于初始化 stage 的配置参数 |
|
|
|
-| `*ptStage` | 可选参数,指向 `tnsq_gfx_stage_t` 结构的指针,表示要初始化的 stage 对象,为 `RT_NULL` 和为空时,表示动态初始化,否则,表示静态初始化 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `tnsq_gfx_stage_t *` | 初始化成功,返回指向新初始化的 stage 对象的指针 |
|
|
|
-| `RT_NULL` | 初始化失败 |
|
|
|
+| `*ptStageCFG` | Pointer to `tnsq_gfx_stage_cfg_t` structure containing configuration parameters used to initialize the stage |
|
|
|
+| `*ptStage` | Optional parameter, pointer to the `tnsq_gfx_stage_t` structure, indicating the stage object to be initialized. When `RT_NULL` and empty, it means dynamic initialization, otherwise, it means static initialization |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `tnsq_gfx_stage_t *` | Initialization successful, returns a pointer to the newly initialized stage object |
|
|
|
+| `RT_NULL` | Initialization failed |
|
|
|
|
|
|
-#### 注册 layer
|
|
|
+#### register layer
|
|
|
|
|
|
`rt_uint8_t tnsq_gfx_register_layer_to_stage(tnsq_gfx_stage_t *ptStage, void *ptLayer);`
|
|
|
|
|
|
-> 将指定的 layer 注册到 指定的 stage 中去,返回一个唯一标识 layer 的 ID。
|
|
|
+> Register the specified layer into the specified stage and return an ID that uniquely identifies the layer.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptStage` | 指向 `tnsq_gfx_stage_t` 结构的指针,表示要注册 layer 的 stage 对象 |
|
|
|
-| `*ptLayer` | 指向待注册的 layer 对象的指针,可以是特定类型的 layer 对象 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `rt_uint8_t` | 唯一表示 layer 的 ID |
|
|
|
+| `*ptStage` | Pointer to the `tnsq_gfx_stage_t` structure, indicating the stage object of the layer to be registered |
|
|
|
+| `*ptLayer` | Pointer to the layer object to be registered, which can be a specific type of layer object |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `rt_uint8_t` | Uniquely represents the ID of the layer |
|
|
|
|
|
|
-#### 移除 layer
|
|
|
+#### remove layer
|
|
|
|
|
|
`void tnsq_gfx_remove_layer(tnsq_gfx_stage_t *ptStage, rt_uint8_t chLayerID);`
|
|
|
|
|
|
-> 从指定的 stage 中,移除指定的 layer。
|
|
|
+> Remove the specified layer from the specified stage.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptStage` | 指向 `tnsq_gfx_stage_t` 结构的指针,表示要从中移除 layer 的 stage 对象 |
|
|
|
-| `*chLayerID` | 表示要移除的 layer 的唯一标识 ID |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `*ptStage` | Pointer to a `tnsq_gfx_stage_t` structure, representing the stage object from which the layer is to be removed |
|
|
|
+| `*chLayerID` | Represents the unique identification ID of the layer to be removed |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 使 layer 可见
|
|
|
+#### make layer visible
|
|
|
|
|
|
`void tnsq_gfx_make_layer_visible(tnsq_gfx_stage_t *ptStage, rt_uint8_t chLayerID);`
|
|
|
|
|
|
-> 使指定的 stage 中,指定的 layer 可见。
|
|
|
+> Make the specified layer visible in the specified stage.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptStage` | 指向 `tnsq_gfx_stage_t` 结构的指针,表示操作的 stage 对象 |
|
|
|
-| `*chLayerID` | 表示要使可见的 layer 的唯一标识 ID |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `*ptStage` | Pointer to `tnsq_gfx_stage_t` structure, representing the stage object of the operation |
|
|
|
+| `*chLayerID` | Represents the unique identification ID of the layer to be made visible |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 使 layer 不可见
|
|
|
+#### make layer invisible
|
|
|
|
|
|
`void tnsq_gfx_make_layer_invisible(tnsq_gfx_stage_t *ptStage, rt_uint8_t chLayerID);`
|
|
|
|
|
|
-> 使指定的 stage 中,指定的 layer 不可见。
|
|
|
+> Make the specified layer invisible in the specified stage.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptStage` | 指向 `tnsq_gfx_stage_t` 结构的指针,表示操作的 stage 对象 |
|
|
|
-| `*chLayerID` | 表示要使不可见的 layer 的唯一标识 ID |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `*ptStage` | Pointer to `tnsq_gfx_stage_t` structure, representing the stage object of the operation |
|
|
|
+| `*chLayerID` | Represents the unique identification ID of the layer to be made invisible |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 获取 layer 对象指针
|
|
|
+#### get the layer object pointer
|
|
|
|
|
|
`void *tnsq_gfx_get_layer_ptr(tnsq_gfx_stage_t *ptStage, rt_uint8_t chLayerID);`
|
|
|
|
|
|
-> 获取指定 stage 中对应 ID 标识的 layer 对象的指针。
|
|
|
+> Get the pointer of the layer object corresponding to the ID in the specified stage.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptStage` | 指向 `tnsq_gfx_stage_t` 结构的指针,表示操作的 stage 对象 |
|
|
|
-| `*chLayerID` | 表示要获取指针的 layer 的唯一标识 ID |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `void *` | 指向指定 layer 的指针 |
|
|
|
-| `RT_NULL` | ID 不存在 |
|
|
|
+| `*ptStage` | Pointer to `tnsq_gfx_stage_t` structure, representing the stage object of the operation |
|
|
|
+| `*chLayerID` | Represents the unique identification ID of the layer to obtain the pointer |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `void *` | Pointer to the specified layer |
|
|
|
+| `RT_NULL` | ID does not exist |
|
|
|
|
|
|
-#### 背景颜色 layer 初始化
|
|
|
+#### background color layer initialization
|
|
|
|
|
|
`tnsq_gfx_layer_bg_cl_t *tnsq_gfx_layer_bg_cl_init(tnsq_gfx_layer_bg_cl_cfg_t *ptLayerCFG, tnsq_gfx_layer_bg_cl_t *ptLayer);`
|
|
|
|
|
|
-> 初始化一个背景颜色 layer,如果 `ptLayer` 为 `RT_NULL` 或为空,对应的 layer 对象由引擎动态分配与回收;如果 `ptLayer` 不为 `RT_NULL`,对应的 layer 对象由用户负责,用户需保证生命周期内 layer 对象占用的地址空间始终有效,否则将导致未定义的错误。
|
|
|
+> Initialize a background color layer. If `ptLayer` is `RT_NULL` or empty, the corresponding layer object is dynamically allocated and recycled by the engine; if `ptLayer` is not `RT_NULL`, the corresponding layer object is the responsibility of the user, and the user needs to Ensure that the address space occupied by the layer object is always valid during the life cycle, otherwise an undefined error will result.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayerCFG` | 指向 `tnsq_gfx_layer_bg_cl_cfg_t` 结构的指针,包含用于初始化 layer 的配置参数 |
|
|
|
-| `*ptLayer` | 可选参数,指向 `tnsq_gfx_layer_bg_cl_t` 结构的指针,表示要初始化的 layer 对象,为 `RT_NULL` 和为空时,表示动态初始化,否则,表示静态初始化 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `tnsq_gfx_layer_bg_cl_t *` | 初始化成功,返回指向新初始化的 layer 对象的指针 |
|
|
|
-| `RT_NULL` | 初始化失败 |
|
|
|
+| `*ptLayerCFG` | Pointer to `tnsq_gfx_layer_bg_cl_cfg_t` structure containing configuration parameters used to initialize the layer |
|
|
|
+| `*ptLayer` | Optional parameter, pointer to the `tnsq_gfx_layer_bg_cl_t` structure, indicating the layer object to be initialized. When `RT_NULL` and empty, it means dynamic initialization, otherwise, it means static initialization |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `tnsq_gfx_layer_bg_cl_t *` | Initialization successful, returns a pointer to the newly initialized layer object |
|
|
|
+| `RT_NULL` | Initialization failed |
|
|
|
|
|
|
-#### 背景 layer 初始化
|
|
|
+#### background layer initialization
|
|
|
|
|
|
`tnsq_gfx_layer_bg_t *tnsq_gfx_layer_bg_init(tnsq_gfx_layer_bg_cfg_t *ptLayerCFG, tnsq_gfx_layer_bg_t *ptLayer);`
|
|
|
|
|
|
-> 初始化一个背景 layer,如果 `ptLayer` 为 `RT_NULL` 或为空,对应的 layer 对象由引擎动态分配与回收;如果 `ptLayer` 不为 `RT_NULL`,对应的 layer 对象由用户负责,用户需保证生命周期内 layer 对象占用的地址空间始终有效,否则将导致未定义的错误。
|
|
|
+> Initialize a background layer. If `ptLayer` is `RT_NULL` or empty, the corresponding layer object is dynamically allocated and recycled by the engine; if `ptLayer` is not `RT_NULL`, the corresponding layer object is the responsibility of the user, and the user needs to ensure The address space occupied by the layer object during the life cycle is always valid, otherwise an undefined error will result.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayerCFG` | 指向 `tnsq_gfx_layer_bg_cfg_t` 结构的指针,包含用于初始化 layer 的配置参数 |
|
|
|
-| `*ptLayer` | 可选参数,指向 `tnsq_gfx_layer_bg_t` 结构的指针,表示要初始化的 layer 对象,为 `RT_NULL` 和为空时,表示动态初始化,否则,表示静态初始化 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `tnsq_gfx_layer_bg_t *` | 初始化成功,返回指向新初始化的 layer 对象的指针 |
|
|
|
-| `RT_NULL` | 初始化失败 |
|
|
|
+| `*ptLayerCFG` | Pointer to `tnsq_gfx_layer_bg_cfg_t` structure containing configuration parameters used to initialize the layer |
|
|
|
+| `*ptLayer` | Optional parameter, pointer to the `tnsq_gfx_layer_bg_t` structure, indicating the layer object to be initialized. When `RT_NULL` and empty, it means dynamic initialization, otherwise, it means static initialization |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `tnsq_gfx_layer_bg_t *` | Initialization successful, returns a pointer to the newly initialized layer object |
|
|
|
+| `RT_NULL` | Initialization failed |
|
|
|
|
|
|
-#### 基本单元 layer 初始化
|
|
|
+#### cell layer initialization
|
|
|
|
|
|
`tnsq_gfx_layer_cell_t *tnsq_gfx_layer_cell_init(tnsq_gfx_layer_cell_cfg_t *ptLayerCFG, tnsq_gfx_layer_cell_t *ptLayer);`
|
|
|
|
|
|
-> 初始化一个基本单元 layer,如果 `ptLayer` 为 `RT_NULL` 或为空,对应的 layer 对象由引擎动态分配与回收;如果 `ptLayer` 不为 `RT_NULL`,对应的 layer 对象由用户负责,用户需保证生命周期内 layer 对象占用的地址空间始终有效,否则将导致未定义的错误。
|
|
|
+> Initialize a cell layer. If `ptLayer` is `RT_NULL` or empty, the corresponding layer object is dynamically allocated and recycled by the engine; if `ptLayer` is not `RT_NULL`, the corresponding layer object is the responsibility of the user, and the user needs to Ensure that the address space occupied by the layer object is always valid during the life cycle, otherwise an undefined error will result.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayerCFG` | 指向 `tnsq_gfx_layer_cell_cfg_t` 结构的指针,包含用于初始化 layer 的配置参数 |
|
|
|
-| `*ptLayer` | 可选参数,指向 `tnsq_gfx_layer_cell_t` 结构的指针,表示要初始化的 layer 对象,为 `RT_NULL` 和为空时,表示动态初始化,否则,表示静态初始化 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `tnsq_gfx_layer_cell_t *` | 初始化成功,返回指向新初始化的 layer 对象的指针 |
|
|
|
-| `RT_NULL` | 初始化失败 |
|
|
|
+| `*ptLayerCFG` | Pointer to `tnsq_gfx_layer_cell_cfg_t` structure containing configuration parameters used to initialize the layer |
|
|
|
+| `*ptLayer` | Optional parameter, pointer to the `tnsq_gfx_layer_cell_t` structure, indicating the layer object to be initialized. When `RT_NULL` and empty, it means dynamic initialization, otherwise, it means static initialization |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `tnsq_gfx_layer_cell_t *` | Initialization successful, returns a pointer to the newly initialized layer object |
|
|
|
+| `RT_NULL` | Initialization failed |
|
|
|
|
|
|
-#### 绘制基本单元
|
|
|
+#### draw cell
|
|
|
|
|
|
`void tnsq_gfx_layer_cell_draw(tnsq_gfx_layer_cell_t *ptLayer, rt_uint16_t iX, rt_uint16_t iY, rt_uint8_t chOpacity, COLOUR_INT tColor);`
|
|
|
|
|
|
-> 通过 `iX` 和 `iY`,标识基本单元 layer 中特定的一个单元,设置它的不透明度和颜色。
|
|
|
+> Through `iX` and `iY`, identify a specific unit in the cell layer and set its opacity and color.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayer` | 指向 `tnsq_gfx_layer_cell_t` 结构的指针,标识要进行绘制操作的 layer 对象 |
|
|
|
-| `iX` | 绘制的单元横坐标位置 |
|
|
|
-| `iY` | 绘制的单元纵坐标位置 |
|
|
|
-| `chOpacity` | 不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| `tColor` | 绘制使用的颜色 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `*ptLayer` | Pointer to the `tnsq_gfx_layer_cell_t` structure, identifying the layer object to be drawn |
|
|
|
+| `iX` | The abscissa position of the drawn cell |
|
|
|
+| `iY` | The ordinate position of the drawn cell |
|
|
|
+| `chOpacity` | Opacity, ranging from 0 to 255, 0 means fully transparent, 255 means opaque |
|
|
|
+| `tColor` | The color used for drawing |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 用户单元 layer 初始化
|
|
|
+#### user layer initialization
|
|
|
|
|
|
`tnsq_gfx_layer_user_t *tnsq_gfx_layer_user_init(tnsq_gfx_layer_user_cfg_t *ptLayerCFG, tnsq_gfx_layer_user_t *ptLayer);`
|
|
|
|
|
|
-> 初始化一个用户单元 layer,如果 `ptLayer` 为 `RT_NULL` 或为空,对应的 layer 对象由引擎动态分配与回收;如果 `ptLayer` 不为 `RT_NULL`,对应的 layer 对象由用户负责,用户需保证生命周期内 layer 对象占用的地址空间始终有效,否则将导致未定义的错误。
|
|
|
+> Initialize a user layer. If `ptLayer` is `RT_NULL` or empty, the corresponding layer object is dynamically allocated and recycled by the engine; if `ptLayer` is not `RT_NULL`, the corresponding layer object is the responsibility of the user, and the user needs to Ensure that the address space occupied by the layer object is always valid during the life cycle, otherwise an undefined error will result.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayerCFG` | 指向 `tnsq_gfx_layer_user_cfg_t` 结构的指针,包含用于初始化 layer 的配置参数 |
|
|
|
-| `*ptLayer` | 可选参数,指向 `tnsq_gfx_layer_user_t` 结构的指针,表示要初始化的 layer 对象,为 `RT_NULL` 和为空时,表示动态初始化,否则,表示静态初始化 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `tnsq_gfx_layer_user_t *` | 初始化成功,返回指向新初始化的 layer 对象的指针 |
|
|
|
-| `RT_NULL` | 初始化失败 |
|
|
|
+| `*ptLayerCFG` | Pointer to `tnsq_gfx_layer_user_cfg_t` structure containing configuration parameters used to initialize the layer |
|
|
|
+| `*ptLayer` | Optional parameter, pointer to the `tnsq_gfx_layer_user_t` structure, indicating the layer object to be initialized. When `RT_NULL` and empty, it means dynamic initialization, otherwise, it means static initialization |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `tnsq_gfx_layer_user_t *` | Initialization successful, returns a pointer to the newly initialized layer object |
|
|
|
+| `RT_NULL` | Initialization failed |
|
|
|
|
|
|
-#### 绘制用户单元
|
|
|
+#### draw user cell
|
|
|
|
|
|
`void tnsq_gfx_layer_user_draw(tnsq_gfx_layer_user_t *ptLayer, rt_uint16_t iX, rt_uint16_t iY, rt_uint8_t u7Idx);`
|
|
|
|
|
|
-> 通过 `iX` 和 `iY`, 标识用户单元 layer 中特定的一个单元,根据 `u7Idx`,执行相应的绘制操作(在初始化用户单元 layer 时,会配置相应的绘制函数)。
|
|
|
+> Through `iX` and `iY`, identify a specific unit in the user layer, and perform the corresponding drawing operation according to `u7Idx` (when the user unit layer is initialized, the corresponding drawing function will be configured).
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayer` | 指向 `tnsq_gfx_layer_user_t` 结构的指针,标识要进行绘制操作的 layer 对象 |
|
|
|
-| `iX` | 绘制的单元横坐标位置 |
|
|
|
-| `iY` | 绘制的单元纵坐标位置 |
|
|
|
-| `u7Idx` | 用户自定义绘制操作的索引,用于区分不同的绘制操作 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `*ptLayer` | Pointer to the `tnsq_gfx_layer_user_t` structure, identifying the layer object to be drawn |
|
|
|
+| `iX` | The abscissa position of the drawn cell |
|
|
|
+| `iY` | The ordinate position of the drawn cell |
|
|
|
+| `u7Idx` | Index of user-defined drawing operations, used to distinguish different drawing operations |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 文本 layer 初始化
|
|
|
+#### text layer initialization
|
|
|
|
|
|
`tnsq_gfx_layer_text_t *tnsq_gfx_layer_text_init(tnsq_gfx_layer_text_cfg_t *ptLayerCFG, tnsq_gfx_layer_text_t *ptLayer);`
|
|
|
|
|
|
-> 初始化一个文本 layer,如果 `ptLayer` 为 `RT_NULL` 或为空,对应的 layer 对象由引擎动态分配与回收;如果 `ptLayer` 不为 `RT_NULL`,对应的 layer 对象由用户负责,用户需保证生命周期内 layer 对象占用的地址空间始终有效,否则将导致未定义的错误。
|
|
|
+> Initialize a text layer. If `ptLayer` is `RT_NULL` or empty, the corresponding layer object is dynamically allocated and recycled by the engine; if `ptLayer` is not `RT_NULL`, the corresponding layer object is the responsibility of the user, and the user needs to ensure The address space occupied by the layer object during the life cycle is always valid, otherwise an undefined error will result.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayerCFG` | 指向 `tnsq_gfx_layer_text_cfg_t` 结构的指针,包含用于初始化 layer 的配置参数 |
|
|
|
-| `*ptLayer` | 可选参数,指向 `tnsq_gfx_layer_text_t` 结构的指针,表示要初始化的 layer 对象,为 `RT_NULL` 和为空时,表示动态初始化,否则,表示静态初始化 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `tnsq_gfx_layer_text_t *` | 初始化成功,返回指向新初始化的 layer 对象的指针 |
|
|
|
-| `RT_NULL` | 初始化失败 |
|
|
|
+| `*ptLayerCFG` | Pointer to `tnsq_gfx_layer_text_cfg_t` structure containing configuration parameters used to initialize the layer |
|
|
|
+| `*ptLayer` | Optional parameter, pointer to the `tnsq_gfx_layer_text_t` structure, indicating the layer object to be initialized. When `RT_NULL` and empty, it means dynamic initialization, otherwise, it means static initialization |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `tnsq_gfx_layer_text_t *` | Initialization successful, returns a pointer to the newly initialized layer object |
|
|
|
+| `RT_NULL` | Initialization failed |
|
|
|
|
|
|
-#### 绘制文本
|
|
|
+#### draw text
|
|
|
|
|
|
`rt_int32_t tnsq_gfx_layer_text_printf(tnsq_gfx_layer_text_t *ptLayer, const char *format, ...);`
|
|
|
|
|
|
-> 在指定的文本 layer 上,绘制文本。
|
|
|
+> Draw text on the specified text layer.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayer` | 指向 `tnsq_gfx_layer_text_t` 结构的指针,标识要进行绘制操作的 layer 对象 |
|
|
|
-| `*format` | 一个格式化字符串,用于指定要输出的文本格式。支持与 `printf` 函数相似的格式说明符 |
|
|
|
-| `...` | 可变数量的参数,根据 `format` 字符串中的格式说明符进行文本替换 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `rt_int32_t` | 正确执行,返回写入文本的字符数 |
|
|
|
-| `-1` | 错误执行 |
|
|
|
+| `*ptLayer` | Pointer to the `tnsq_gfx_layer_text_t` structure, identifying the layer object to be drawn |
|
|
|
+| `*format` | A format string used to specify the text format to be output. Supports format specifiers similar to the `printf` function |
|
|
|
+| `...` | A variable number of arguments, text replacement based on the format specifier in the `format` string |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `rt_int32_t` | Correct execution, returns the number of characters written into the text |
|
|
|
+| `-1` | Error execution |
|
|
|
|
|
|
-#### 数字列表 layer 初始化
|
|
|
+#### number list layer initialization
|
|
|
|
|
|
`tnsq_gfx_layer_num_t *tnsq_gfx_layer_num_init(tnsq_gfx_layer_num_cfg_t *ptLayerCFG, tnsq_gfx_layer_num_t *ptLayer);`
|
|
|
|
|
|
-> 初始化一个数字列表 layer,如果 `ptLayer` 为 `RT_NULL` 或为空,对应的 layer 对象由引擎动态分配与回收;如果 `ptLayer` 不为 `RT_NULL`,对应的 layer 对象由用户负责,用户需保证生命周期内 layer 对象占用的地址空间始终有效,否则将导致未定义的错误。
|
|
|
+> Initialize a number list layer. If `ptLayer` is `RT_NULL` or empty, the corresponding layer object is dynamically allocated and recycled by the engine; if `ptLayer` is not `RT_NULL`, the corresponding layer object is the responsibility of the user, and the user needs to Ensure that the address space occupied by the layer object is always valid during the life cycle, otherwise an undefined error will result.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayerCFG` | 指向 `tnsq_gfx_layer_num_cfg_t` 结构的指针,包含用于初始化 layer 的配置参数 |
|
|
|
-| `*ptLayer` | 可选参数,指向 `tnsq_gfx_layer_num_t` 结构的指针,表示要初始化的 layer 对象,为 `RT_NULL` 和为空时,表示动态初始化,否则,表示静态初始化 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `tnsq_gfx_layer_num_t *` | 初始化成功,返回指向新初始化的 layer 对象的指针 |
|
|
|
-| `RT_NULL` | 初始化失败 |
|
|
|
+| `*ptLayerCFG` | Pointer to `tnsq_gfx_layer_num_cfg_t` structure containing configuration parameters used to initialize the layer |
|
|
|
+| `*ptLayer` | Optional parameter, pointer to the `tnsq_gfx_layer_num_t` structure, indicating the layer object to be initialized. When `RT_NULL` and empty, it means dynamic initialization, otherwise, it means static initialization |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `tnsq_gfx_layer_num_t *` | Initialization successful, returns a pointer to the newly initialized layer object |
|
|
|
+| `RT_NULL` | Initialization failed |
|
|
|
|
|
|
-#### 获取选中数字索引
|
|
|
+#### get the selected number index
|
|
|
|
|
|
`rt_int8_t tnsq_gfx_layer_num_get_item_idx(tnsq_gfx_layer_num_t *ptLayer);`
|
|
|
|
|
|
-> 获取指定数字列表 layer 选择的数字索引。
|
|
|
+> Get the number index selected by the specified number list layer.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayer` | 指向 `tnsq_gfx_layer_num_t` 结构的指针,标识要获取当前项索引的 layer 对象 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `rt_int8_t` | 正确执行,返回当前项的索引 |
|
|
|
-| `-1` | 错误执行 |
|
|
|
+| `*ptLayer` | Pointer to the `tnsq_gfx_layer_num_t` structure, identifying the layer object from which the current item index is to be obtained |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `rt_int8_t` | Correct execution, returns the index of the current item |
|
|
|
+| `-1` | Error execution |
|
|
|
|
|
|
-#### 菜单 layer 初始化
|
|
|
+#### menu layer initialization
|
|
|
|
|
|
`tnsq_gfx_layer_menu_t *tnsq_gfx_layer_menu_init(tnsq_gfx_layer_menu_cfg_t *ptLayerCFG, tnsq_gfx_layer_menu_t *ptLayer);`
|
|
|
|
|
|
-> 初始化一个菜单 layer,如果 `ptLayer` 为 `RT_NULL` 或为空,对应的 layer 对象由引擎动态分配与回收;如果 `ptLayer` 不为 `RT_NULL`,对应的 layer 对象由用户负责,用户需保证生命周期内 layer 对象占用的地址空间始终有效,否则将导致未定义的错误。
|
|
|
+> Initialize a menu layer. If `ptLayer` is `RT_NULL` or empty, the corresponding layer object is dynamically allocated and recycled by the engine; if `ptLayer` is not `RT_NULL`, the corresponding layer object is the responsibility of the user, and the user needs to ensure The address space occupied by the layer object during the life cycle is always valid, otherwise an undefined error will result.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayerCFG` | 指向 `tnsq_gfx_layer_menu_cfg_t` 结构的指针,包含用于初始化 layer 的配置参数 |
|
|
|
-| `*ptLayer` | 可选参数,指向 `tnsq_gfx_layer_menu_t` 结构的指针,表示要初始化的 layer 对象,为 `RT_NULL` 和为空时,表示动态初始化,否则,表示静态初始化 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `tnsq_gfx_layer_menu_t *` | 初始化成功,返回指向新初始化的 layer 对象的指针 |
|
|
|
-| `RT_NULL` | 初始化失败 |
|
|
|
+| `*ptLayerCFG` | Pointer to `tnsq_gfx_layer_menu_cfg_t` structure, containing configuration parameters used to initialize the layer |
|
|
|
+| `*ptLayer` | Optional parameter, pointer to the `tnsq_gfx_layer_menu_t` structure, indicating the layer object to be initialized. When `RT_NULL` and empty, it means dynamic initialization, otherwise, it means static initialization |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `tnsq_gfx_layer_menu_t *` | Initialization successful, returns a pointer to the newly initialized layer object |
|
|
|
+| `RT_NULL` | Initialization failed |
|
|
|
|
|
|
-#### 获取选中菜单项名称
|
|
|
+#### get the name of the selected menu item
|
|
|
|
|
|
`const char *tnsq_gfx_layer_menu_get_item_name(tnsq_gfx_layer_menu_t *ptLayer);`
|
|
|
|
|
|
-> 获取指定菜单 layer 选择的菜单项的名称。
|
|
|
+> Get the name of the menu item selected by the specified menu layer.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayer` | 指向 `tnsq_gfx_layer_menu_t` 结构的指针,标识要获取当前项名称的 layer 对象 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `const char *` | 正确执行,返回当前菜单项名称的常量字符串地址 |
|
|
|
-| `NULL` | 错误执行 |
|
|
|
+| `*ptLayer` | Pointer to the `tnsq_gfx_layer_menu_t` structure, identifying the layer object from which the name of the current item is to be obtained |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `const char *` | Correctly executed, returns the constant string address of the current menu item name |
|
|
|
+| `NULL` | Error execution |
|
|
|
|
|
|
-#### 获取选中菜单项索引
|
|
|
+#### get the selected menu item index
|
|
|
|
|
|
`rt_int8_t tnsq_gfx_layer_menu_get_item_idx(tnsq_gfx_layer_menu_t *ptLayer);`
|
|
|
|
|
|
-> 获取指定菜单 layer 选择的菜单项的索引。
|
|
|
+> Get the index of the menu item selected by the specified menu layer.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `*ptLayer` | 指向 `tnsq_gfx_layer_menu_t` 结构的指针,标识要获取当前项索引的 layer 对象 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `rt_int8_t` | 正确执行,返回当前项的索引 |
|
|
|
-| `-1` | 错误执行 |
|
|
|
+| `*ptLayer` | Pointer to the `tnsq_gfx_layer_menu_t` structure, identifying the layer object to get the current item index |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `rt_int8_t` | Correct execution, returns the index of the current item |
|
|
|
+| `-1` | Error execution |
|
|
|
|
|
|
## PikaPython
|
|
|
|
|
|
### common
|
|
|
|
|
|
-#### 引擎初始化
|
|
|
+#### engine initialization
|
|
|
|
|
|
`def __init__(self): ...`
|
|
|
|
|
|
-> 初始化引擎中的一些常量。
|
|
|
+> Initialize some constants in the engine.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 颜色转换
|
|
|
+#### color conversion
|
|
|
|
|
|
`def RGB(r: int, g: int, b: int) -> int: ...`
|
|
|
|
|
|
-> 将 RGB 颜色转换为引擎使用的颜色类型。
|
|
|
+> Convert RGB colors to the color type used by the engine.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `r` | 整数值,表示红色通道的值(0-255) |
|
|
|
-| `g` | 整数值,表示绿色通道的值(0-255) |
|
|
|
-| `b` | 整数值,表示蓝色通道的值(0-255) |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `int` | 对应引擎使用的颜色表示 |
|
|
|
+| `r` | Integer value, representing the value of the red channel (0-255) |
|
|
|
+| `g` | Integer value, representing the value of the green channel (0-255) |
|
|
|
+| `b` | Integer value, representing the value of the blue channel (0-255) |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `int` | The color representation used by the corresponding engine |
|
|
|
|
|
|
-### 按键事件类
|
|
|
+### key event class
|
|
|
|
|
|
-#### 按键事件类初始化
|
|
|
+#### key event class initialization
|
|
|
|
|
|
`def __init__(self): ...`
|
|
|
|
|
|
-> 初始化按键事件对象。
|
|
|
+> Initialize the key event object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 更新按键状态
|
|
|
+#### update key status
|
|
|
|
|
|
`def update_key(self, timeout:int) -> int: ...`
|
|
|
|
|
|
-> 根据超时时间,更新按键的状态。
|
|
|
+> Update the button status according to the timeout period.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `timeout` | 整数值,表示超时时间,以毫秒为单位 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `0` | 正确执行 |
|
|
|
-| `-1` | 错误执行 |
|
|
|
-| `-2` | 超时执行 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `timeout` | Integer value, indicating the timeout period, in milliseconds |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `0` | Correct execution |
|
|
|
+| `-1` | Error execution |
|
|
|
+| `-2` | Timeout execution |
|
|
|
|
|
|
-#### 获取按键方向
|
|
|
+#### get key direction
|
|
|
|
|
|
`def get_direction(self) -> int: ...`
|
|
|
|
|
|
-> 获取按键方向信息。
|
|
|
+> Get key direction information.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `KEY_DIRECTION_UP` | 向上 |
|
|
|
-| `KEY_DIRECTION_DOWN` | 向下 |
|
|
|
-| `KEY_DIRECTION_LEFT` | 向左 |
|
|
|
-| `KEY_DIRECTION_RIGHT` | 向右 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `KEY_UP` | Up |
|
|
|
+| `KEY_DOWN` | Down |
|
|
|
+| `KEY_LEFT` | Left |
|
|
|
+| `KEY_RIGHT` | Right |
|
|
|
+| `KEY_X` | X |
|
|
|
+| `KEY_Y` | Y |
|
|
|
+| `KEY_A` | A |
|
|
|
+| `KEY_B` | B |
|
|
|
|
|
|
-#### 获取按键事件
|
|
|
+#### get key events
|
|
|
|
|
|
`def get_event(self) -> int: ...`
|
|
|
|
|
|
-> 获取按键事件信息。
|
|
|
+> Get key event information.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `KEY_EVENT_UP` | 按键抬起 |
|
|
|
-| `KEY_EVENT_DOWN` | 按键按下 |
|
|
|
-| `KEY_EVENT_PRESSED` | 短按 |
|
|
|
-| `KEY_EVENT_LONG_PRESSED` | 长按 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `KEY_EVENT_UP` | Key up |
|
|
|
+| `KEY_EVENT_DOWN` | Key pressed |
|
|
|
+| `KEY_EVENT_PRESSED` | Short press |
|
|
|
+| `KEY_EVENT_LONG_PRESSED` | Long press |
|
|
|
|
|
|
-### graphics 类
|
|
|
+### graphics class
|
|
|
|
|
|
-#### graphics 类初始化
|
|
|
+#### graphics class initialization
|
|
|
|
|
|
`def __init__(self): ...`
|
|
|
|
|
|
-> 初始化 graphics 对象。
|
|
|
+> Initialize the graphics object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 申请刷新
|
|
|
+#### apply for refresh
|
|
|
|
|
|
`def refresh(self): ...`
|
|
|
|
|
|
-> 申请刷新屏幕。
|
|
|
+> Request screen refresh.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 切换 stage
|
|
|
+#### switch stage
|
|
|
|
|
|
`def switch_stage(self): ...`
|
|
|
|
|
|
-> 切换到下一个 stage。
|
|
|
+> Switch to the next stage.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-### stage 类
|
|
|
+### stage class
|
|
|
|
|
|
-#### stage 类初始化
|
|
|
+#### stage class initialization
|
|
|
|
|
|
`def __init__(self): ...`
|
|
|
|
|
|
-> 初始化 stage 对象。
|
|
|
+> Initialize the stage object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 注册 layer
|
|
|
+#### register layer
|
|
|
|
|
|
`def register_layer(self, layer: object) -> int: ...`
|
|
|
|
|
|
-> 将指定的 layer 对象注册到 stage 中。
|
|
|
+> Register the specified layer object into the stage.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `layer` | 欲注册到 stage 中的 layer 对象 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `int` | 唯一表示 layer 的 ID |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `layer` | The layer object to be registered in the stage |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `int` | The unique ID that represents the layer |
|
|
|
|
|
|
-#### 移除 layer
|
|
|
+#### remove layer
|
|
|
|
|
|
`def remove_layer(self, layerID: int): ...`
|
|
|
|
|
|
-> 移除 stage 中,唯一 ID 标识的 layer。
|
|
|
+> Remove the layer identified by the unique ID in the stage.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `layerID` | 标识待移除 layer 的唯一 ID |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `layerID` | Unique ID that identifies the layer to be removed |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 使 layer 可见
|
|
|
+#### make layer visible
|
|
|
|
|
|
`def visible_layer(self, layerID: int): ...`
|
|
|
|
|
|
-> 使 stage 中,唯一 ID 标识的 layer 可见。
|
|
|
+> Make the layer identified by the unique ID visible in the stage.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `layerID` | 标识待操作 layer 的唯一 ID |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `layerID` | Unique ID that identifies the layer to be operated on |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 使 layer 不可见
|
|
|
+#### make layer invisible
|
|
|
|
|
|
`def invisible_layer(self, layerID: int): ...`
|
|
|
|
|
|
-> 使 stage 中,唯一 ID 标识的 layer 不可见。
|
|
|
+> Make the layer identified by the unique ID invisible in the stage.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `layerID` | 标识待操作 layer 的唯一 ID |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `layerID` | Unique ID that identifies the layer to be operated on |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-### screen 类
|
|
|
+### screen class
|
|
|
|
|
|
-#### screen 类初始化
|
|
|
+#### screen class initialization
|
|
|
|
|
|
`def __init__(self): ...`
|
|
|
|
|
|
-> 初始化 screen 对象。
|
|
|
+> Initialize the screen object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 获取 screen 宽度
|
|
|
+#### get screen width
|
|
|
|
|
|
`def width(self) -> int: ...`
|
|
|
|
|
|
-> 获取 screen 的宽度。
|
|
|
+> Get the width of screen.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `int` | screen 的宽度 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `int` | width of screen |
|
|
|
|
|
|
-#### 获取 screen 高度
|
|
|
+#### get screen height
|
|
|
|
|
|
`def height(self) -> int: ...`
|
|
|
|
|
|
-> 获取 screen 的高度。
|
|
|
+> Get the height of screen.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `int` | screen 的高度 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `int` | height of screen |
|
|
|
|
|
|
-### region 类
|
|
|
+### region class
|
|
|
|
|
|
-#### region 类初始化
|
|
|
+#### region class initialization
|
|
|
|
|
|
`def __init__(self, hwX: int, hwY: int, hwWidth: int, hwHeight: int): ...`
|
|
|
|
|
|
-> 初始化 screen 对象。
|
|
|
+> Initialize the screen object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `hwX` | region 的 x 起始坐标 |
|
|
|
-| `hwY` | region 的 y 起始坐标 |
|
|
|
-| `hwWidth` | region 的宽度 |
|
|
|
-| `hwHeight` | region 的高度 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `hwX` | x starting coordinate of region |
|
|
|
+| `hwY` | y starting coordinate of region |
|
|
|
+| `hwWidth` | width of region |
|
|
|
+| `hwHeight` | The height of the region |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-### border opacity 类
|
|
|
+### border opacity class
|
|
|
|
|
|
-#### border opacity 类初始化
|
|
|
+#### border opacity class initialization
|
|
|
|
|
|
`def __init__(self, left: int, right: int, top: int, bottom: int): ...`
|
|
|
|
|
|
-> 初始化 border opacity 对象。
|
|
|
+> Initialize the border opacity object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `left` | 左边的不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| `right` | 右边的不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| `top` | 上边的不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| `bottom` | 下边的不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `left` | The opacity of the left side, ranging from 0 to 255, 0 means completely transparent, 255 means opaque |
|
|
|
+| `right` | The opacity of the right, ranging from 0 to 255, 0 means completely transparent, 255 means opaque |
|
|
|
+| `top` | The opacity of the top, ranging from 0 to 255, 0 means completely transparent, 255 means opaque |
|
|
|
+| `bottom` | The opacity of the bottom, ranging from 0 to 255, 0 means completely transparent, 255 means opaque |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-### corner opacity 类
|
|
|
+### corner opacity class
|
|
|
|
|
|
-#### corner opacity 类初始化
|
|
|
+#### corner opacity class initialization
|
|
|
|
|
|
`def __init__(self, leftTop: int, rightTop: int, rightBottom: int, leftBottom: int): ...`
|
|
|
|
|
|
-> 初始化 corner opacity 对象。
|
|
|
+> Initialize the corner opacity object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `leftTop` | 左上角的不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| `rightTop` | 右上角的不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| `rightBottom` | 右下角的不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| `leftBottom` | 左下角的不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `leftTop` | The opacity of the upper left corner, ranging from 0 to 255, 0 means completely transparent, 255 means opaque |
|
|
|
+| `rightTop` | The opacity of the upper right corner, ranging from 0 to 255, 0 means fully transparent, 255 means opaque |
|
|
|
+| `rightBottom` | The opacity of the lower right corner, ranging from 0 to 255, 0 means fully transparent, 255 means opaque |
|
|
|
+| `leftBottom` | The opacity of the lower left corner, ranging from 0 to 255, 0 means completely transparent, 255 means opaque |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-### 背景颜色 layer 类
|
|
|
+### background color layer class
|
|
|
|
|
|
-#### 背景颜色 layer 类初始化
|
|
|
+#### background color layer class initialization
|
|
|
|
|
|
`def __init__(self, type: int, color: int, opacity: int, region: Region, borderOpacity: BorderOpacity, cornerOpacity: CornerOpacity): ...`
|
|
|
|
|
|
-> 初始化 corner opacity 对象。
|
|
|
+> Initialize the corner opacity object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `type` | 背景颜色 layer 的类型,可选项为:`BG_CL_NORMAL`、`BG_CL_BOX`、`BG_CL_BORDER` |
|
|
|
-| `color` | 背景颜色 |
|
|
|
-| `opacity` | 背景颜色的不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| `region` | 背景颜色 layer 的位置和大小 |
|
|
|
-| `borderOpacity` | 当 `type` 为 `BG_CL_BORDER` 时,指定 border opacity |
|
|
|
-| `cornerOpacity` | 当 `type` 为 `BG_CL_BORDER` 时,指定 corner opacity |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `type` | The type of background color layer, the options are: `BG_CL_NORMAL`, `BG_CL_BOX`, `BG_CL_BORDER` |
|
|
|
+| `color` | background color |
|
|
|
+| `opacity` | The opacity of the background color, ranging from 0 to 255, 0 means completely transparent, 255 means opaque |
|
|
|
+| `region` | The position and size of the background color layer |
|
|
|
+| `borderOpacity` | When `type` is `BG_CL_BORDER`, specify border opacity |
|
|
|
+| `cornerOpacity` | When `type` is `BG_CL_BORDER`, specify corner opacity |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-### 基础单元 layer 类
|
|
|
+### cell layer class
|
|
|
|
|
|
-#### 基础单元 layer 类初始化
|
|
|
+#### cell layer class initialization
|
|
|
|
|
|
`def __init__(self, hwXCount: int, hwYCount: int): ...`
|
|
|
|
|
|
-> 初始化基础单元 layer 类对象。
|
|
|
+> Initialize the cell layer class object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `hwXCount` | x 方向单元个数 |
|
|
|
-| `hwYCount` | y 方向单元个数 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `hwXCount` | Number of cells in x direction |
|
|
|
+| `hwYCount` | Number of cells in y direction |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 基础单元绘制
|
|
|
+#### draw cell
|
|
|
|
|
|
`def draw_cell(self, hwX: int, hwY: int, color: int, opacity: int): ...`
|
|
|
|
|
|
-> 绘制基础单元 layer 中的指定单元。
|
|
|
+> Draw the specified cell in the cell layer.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `hwX` | 绘制的单元横坐标位置 |
|
|
|
-| `hwY` | 绘制的单元纵坐标位置 |
|
|
|
-| `color` | 绘制使用的颜色 |
|
|
|
-| `opacity` | 不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `hwX` | The abscissa position of the drawn cell |
|
|
|
+| `hwY` | The ordinate position of the drawn cell |
|
|
|
+| `color` | The color used for drawing |
|
|
|
+| `opacity` | Opacity, ranging from 0 to 255, 0 means completely transparent, 255 means opaque |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-### 用户单元 layer 类
|
|
|
+### user layer class
|
|
|
|
|
|
-#### 用户单元 layer 类初始化
|
|
|
+#### user layer class initialization
|
|
|
|
|
|
`def __init__(self, hwXCount: int, hwYCount: int): ...`
|
|
|
|
|
|
-> 初始化用户单元 layer 类对象。
|
|
|
+> Initialize user layer class object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `hwXCount` | x 方向单元个数 |
|
|
|
-| `hwYCount` | y 方向单元个数 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `hwXCount` | Number of cells in x direction |
|
|
|
+| `hwYCount` | Number of cells in y direction |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 用户单元绘制
|
|
|
+#### draw user cell
|
|
|
|
|
|
`def draw_userMap(self, hwX: int, hwY: int, idx: int): ...`
|
|
|
|
|
|
-> 绘制用户单元 layer 中的指定单元。
|
|
|
+> Draws the specified cell in the user layer.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `hwX` | 绘制的单元横坐标位置 |
|
|
|
-| `hwY` | 绘制的单元纵坐标位置 |
|
|
|
-| `idx` | 系统自定义绘制操作的索引,用于区分不同的绘制操作(具体绘制函数是弱定义的,用户若希望自定义绘制操作,可重定义绘制函数) |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `hwX` | The abscissa position of the drawn cell |
|
|
|
+| `hwY` | The ordinate position of the drawn cell |
|
|
|
+| `idx` | The index of the system's custom drawing operation, used to distinguish different drawing operations (the specific drawing function is weakly defined. If the user wants to customize the drawing operation, he can redefine the drawing function) |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-### 文本 layer 类
|
|
|
+### text layer class
|
|
|
|
|
|
-#### 文本 layer 类初始化
|
|
|
+#### text layer class initialization
|
|
|
|
|
|
`def __init__(self, fontType: int, color: int, opacity: int, region: Region): ...`
|
|
|
|
|
|
-> 初始化文本 layer 类对象。
|
|
|
+> Initialize the text layer class object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `fontType` | 字体的类型,可选项有:`TEXT_FONT_6X8`、`TEXT_FONT_16X24`、`TEXT_FONT_A2_DIGITS_ONLY`、`TEXT_FONT_A4_DIGITS_ONLY`、`TEXT_FONT_A8_DIGITS_ONLY` |
|
|
|
-| `color` | 文本的颜色 |
|
|
|
-| `opacity` | 文本的不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| `region` | 文本 layer 的位置和大小 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `fontType` | Font type, options are: `TEXT_FONT_6X8`, `TEXT_FONT_16X24`, `TEXT_FONT_A2_DIGITS_ONLY`, `TEXT_FONT_A4_DIGITS_ONLY`, `TEXT_FONT_A8_DIGITS_ONLY` |
|
|
|
+| `color` | The color of the text |
|
|
|
+| `opacity` | The opacity of the text, ranging from 0 to 255, 0 means fully transparent, 255 means opaque |
|
|
|
+| `region` | The position and size of the text layer |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 绘制字符串
|
|
|
+#### print string
|
|
|
|
|
|
`def print_str(self, format: str, string: str): ...`
|
|
|
|
|
|
-> 向文本 layer 中绘制字符串。
|
|
|
+> Draw a string into the text layer.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `format` | 一个格式化字符串,用于指定要输出的文本格式。支持与 `printf` 函数相似的格式说明符 |
|
|
|
-| `string` | 字符串参数 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `format` | A format string used to specify the text format to be output. Supports format specifiers similar to the `printf` function |
|
|
|
+| `string` | String parameters |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 绘制数字
|
|
|
+#### print number
|
|
|
|
|
|
`def print_num(self, format: str, number: int): ...`
|
|
|
|
|
|
-> 向文本 layer 中绘制数字。
|
|
|
+> Draw numbers into the text layer.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `format` | 一个格式化字符串,用于指定要输出的文本格式。支持与 `printf` 函数相似的格式说明符 |
|
|
|
-| `number` | 数字参数 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `format` | A format string used to specify the text format to be output. Supports format specifiers similar to the `printf` function |
|
|
|
+| `number` | Numeric parameter |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-### 数字列表 layer 类
|
|
|
+### number list layer class
|
|
|
|
|
|
-#### 数字列表 layer 类初始化
|
|
|
+#### number list layer class initialization
|
|
|
|
|
|
`def __init__(self, number:int, bgColor: int, textColor: int): ...`
|
|
|
|
|
|
-> 初始化数字列表 layer 类对象。
|
|
|
+> Initialize the number list layer class object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `number` | 数字列表的列表项个数 |
|
|
|
-| `bgColor` | 列表项的背景颜色 |
|
|
|
-| `textColor` | 列表项的文本颜色 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `number` | The number of list items in the number list |
|
|
|
+| `bgColor` | Background color of list items |
|
|
|
+| `textColor` | The text color of the list item |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 选中列表项索引获取
|
|
|
+#### get the index of the selected list item
|
|
|
|
|
|
`def get_idx(self) -> int: ...`
|
|
|
|
|
|
-> 获取数字列表 layer 类对象中,被选中的列表项索引。
|
|
|
+> Get the index of the selected list item in the number list layer class object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `int` | 正确执行,返回被选中的索引项 |
|
|
|
-| `-1` | 错误执行 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `int` | Correct execution, returns the selected index item |
|
|
|
+| `-1` | Error execution |
|
|
|
|
|
|
-### item format 类
|
|
|
+### item format class
|
|
|
|
|
|
-#### item format 类初始化
|
|
|
+#### item format class initialization
|
|
|
|
|
|
`def __init__(self, boxColor: int, textColor: int, opacity: int): ...`
|
|
|
|
|
|
-> 初始化 item format 类对象。
|
|
|
+> Initialize the item format class object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `boxColor` | item 的背景颜色 |
|
|
|
-| `textColor` | item 的文本颜色 |
|
|
|
-| `opacity` | 文本的不透明度,范围为 0 到 255,0 表示完全透明,255 表示不透明 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `boxColor` | The background color of item |
|
|
|
+| `textColor` | The text color of item |
|
|
|
+| `opacity` | The opacity of the text, ranging from 0 to 255, 0 means fully transparent, 255 means opaque |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-### 菜单 layer 类
|
|
|
+### menu layer class
|
|
|
|
|
|
-#### 菜单 layer 类初始化
|
|
|
+#### menu layer class initialization
|
|
|
|
|
|
`def __init__(self, strTable: tuple, fontType: int, itemWidth: int, itemHeight: int, itemNormal: ItemFormat, itemSelect: ItemFormat): ...`
|
|
|
|
|
|
-> 初始化菜单 layer 类对象。
|
|
|
+> Initialize menu layer class object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| `strTable` | 以 `tuple` 形式存储的菜单项名称表 |
|
|
|
-| `fontType` | 字体的类型,可选项有:`TEXT_FONT_6X8`、`TEXT_FONT_16X24`、`TEXT_FONT_A2_DIGITS_ONLY`、`TEXT_FONT_A4_DIGITS_ONLY`、`TEXT_FONT_A8_DIGITS_ONLY` |
|
|
|
-| `itemWidth` | 菜单项的宽度 |
|
|
|
-| `itemHeight` | 菜单项的高度 |
|
|
|
-| `itemNormal` | 未被选中时菜单项的外观 |
|
|
|
-| `itemSelect` | 被选中时菜单项的外观 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `无` | 无返回值 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| `strTable` | A table of menu item names stored in `tuple` form |
|
|
|
+| `fontType` | Font type, options are: `TEXT_FONT_6X8`, `TEXT_FONT_16X24`, `TEXT_FONT_A2_DIGITS_ONLY`, `TEXT_FONT_A4_DIGITS_ONLY`, `TEXT_FONT_A8_DIGITS_ONLY` |
|
|
|
+| `itemWidth` | Width of menu item |
|
|
|
+| `itemHeight` | The height of the menu item |
|
|
|
+| `itemNormal` | The appearance of the menu item when not selected |
|
|
|
+| `itemSelect` | The appearance of the menu item when selected |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `None` | No return value |
|
|
|
|
|
|
-#### 选中列表项索引获取
|
|
|
+#### get the index of the selected list item
|
|
|
|
|
|
`def get_idx(self) -> int: ...`
|
|
|
|
|
|
-> 获取菜单 layer 类对象中,被选中的列表项索引。
|
|
|
+> Get the index of the selected list item in the menu layer class object.
|
|
|
|
|
|
-| 参数 | 描述 |
|
|
|
+| Parameters | Description |
|
|
|
|:-----|:-----|
|
|
|
-| `self` | 对象自身的引用 |
|
|
|
-| **返回** | **描述** |
|
|
|
-| `int` | 正确执行,返回被选中的索引项 |
|
|
|
-| `-1` | 错误执行 |
|
|
|
+| `self` | A reference to the object itself |
|
|
|
+| **Return** | **Description** |
|
|
|
+| `int` | Correct execution, returns the selected index item |
|
|
|
+| `-1` | Error execution |
|