更新3.4API
This commit is contained in:
@@ -54,7 +54,7 @@ method in mod.client.ui.controls.minimapUIControl.MiniMapUIControl
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| entityId | str | 实体Id |
|
||||
| text | str | 文本的内容,可以支持[样式代码](https://minecraft-zh.gamepedia.com/%E6%A0%B7%E5%BC%8F%E4%BB%A3%E7%A0%81)(§可以设置文字的颜色、格式等,该种用法更加灵活多变) |
|
||||
| text | str | 文本的内容,可以支持[样式代码](https://zh.minecraft.wiki/w/%E6%A0%BC%E5%BC%8F%E5%8C%96%E4%BB%A3%E7%A0%81)(§可以设置文字的颜色、格式等,该种用法更加灵活多变) |
|
||||
| scale | float | 文本缩放倍数,等于文本控件json中的font_scale_factor参数,默认缩放倍数为1.0 |
|
||||
|
||||
- 返回值
|
||||
@@ -192,7 +192,7 @@ method in mod.client.ui.controls.minimapUIControl.MiniMapUIControl
|
||||
| :--- | :--- | :--- |
|
||||
| key | str | 标记Id |
|
||||
| vec2 | tuple(float,float) | 地图位置二维坐标(x,z) |
|
||||
| text | str | 文本的内容,可以支持[样式代码](https://minecraft-zh.gamepedia.com/%E6%A0%B7%E5%BC%8F%E4%BB%A3%E7%A0%81)(§可以设置文字的颜色、格式等,该种用法更加灵活多变) |
|
||||
| text | str | 文本的内容,可以支持[样式代码](https://zh.minecraft.wiki/w/%E6%A0%BC%E5%BC%8F%E5%8C%96%E4%BB%A3%E7%A0%81)(§可以设置文字的颜色、格式等,该种用法更加灵活多变) |
|
||||
| scale | float | 文本缩放倍数,等于文本控件json中的font_scale_factor参数,默认缩放倍数为1.0 |
|
||||
|
||||
- 返回值
|
||||
@@ -1271,6 +1271,36 @@ textPosition = baseUIControl.GetPosition()
|
||||
|
||||
|
||||
|
||||
## GetPropertyBag
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.ui.controls.baseUIControl.BaseUIControl
|
||||
|
||||
- 描述
|
||||
|
||||
获取PropertyBag
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| str | PropertyBag |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
text2Path = "/panel/text2"
|
||||
baseUIControl = uiNode.GetBaseUIControl(text2Path)
|
||||
propertyBag = baseUIControl.GetPropertyBag()
|
||||
```
|
||||
|
||||
|
||||
|
||||
## GetRotateAngle
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
@@ -4018,6 +4048,39 @@ baseUIControl.SetPosition(pos)
|
||||
|
||||
|
||||
|
||||
## SetPropertyBag
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.ui.controls.baseUIControl.BaseUIControl
|
||||
|
||||
- 描述
|
||||
|
||||
设置PropertyBag,将使用字典中的每个值来覆盖原本PropertyBag中的值
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| params | dict | 需要设置的属性字典,字典键值对的值仅支持设置字符串、数字、布尔值类型,其余类型会导致设置失败 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 是否设置成功 |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
text2Path = "/panel/text2"
|
||||
baseUIControl = uiNode.GetBaseUIControl(text2Path)
|
||||
params = {"text": "hello world", "number": 123, "boolean": True}
|
||||
success = baseUIControl.SetPropertyBag(params)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## SetRotatePivot
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
@@ -4519,7 +4582,7 @@ method in mod.client.ui.controls.labelUIControl.LabelUIControl
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| text | str | 文本的内容,可以支持[样式代码](https://minecraft-zh.gamepedia.com/%E6%A0%B7%E5%BC%8F%E4%BB%A3%E7%A0%81)(§可以设置文字的颜色、格式等,该种用法更加灵活多变) |
|
||||
| text | str | 文本的内容,可以支持[样式代码](https://zh.minecraft.wiki/w/%E6%A0%BC%E5%BC%8F%E5%8C%96%E4%BB%A3%E7%A0%81)(§可以设置文字的颜色、格式等,该种用法更加灵活多变) |
|
||||
| syncSize | bool | 是否设置文本时同步更新文本框大小,默认值为False |
|
||||
|
||||
- 返回值
|
||||
|
||||
@@ -136,6 +136,7 @@ sidebarDepth: 1
|
||||
| [GetOrientation](UI控件.md#getorientation) | <span style="display:inline;color:#7575f9">客户端</span> | 获取stackPanel的排列方向 |
|
||||
| [GetPath](UI控件.md#getpath) | <span style="display:inline;color:#7575f9">客户端</span> | 返回当前控件的相对路径,路径从画布节点开始算起 |
|
||||
| [GetPosition](UI控件.md#getposition) | <span style="display:inline;color:#7575f9">客户端</span> | 获取控件相对父节点的坐标 |
|
||||
| [GetPropertyBag](UI控件.md#getpropertybag) | <span style="display:inline;color:#7575f9">客户端</span> | 获取PropertyBag |
|
||||
| [GetRotateAngle](UI控件.md#getrotateangle) | <span style="display:inline;color:#7575f9">客户端</span> | 获取图片相对自身的旋转锚点旋转的角度 |
|
||||
| [GetRotatePivot](UI控件.md#getrotatepivot) | <span style="display:inline;color:#7575f9">客户端</span> | 获取图片相对自身的旋转锚点 |
|
||||
| [GetRotateRect](UI控件.md#getrotaterect) | <span style="display:inline;color:#7575f9">客户端</span> | 获取图片当前的四个边角点 |
|
||||
@@ -210,6 +211,7 @@ sidebarDepth: 1
|
||||
| [SetOffsetDelta](UI控件.md#setoffsetdelta) | <span style="display:inline;color:#7575f9">客户端</span> | 设置点击面板的拖拽偏移量 |
|
||||
| [SetOrientation](UI控件.md#setorientation) | <span style="display:inline;color:#7575f9">客户端</span> | 设置stackPanel的排列方向 |
|
||||
| [SetPosition](UI控件.md#setposition) | <span style="display:inline;color:#7575f9">客户端</span> | 设置控件相对父节点的坐标 |
|
||||
| [SetPropertyBag](UI控件.md#setpropertybag) | <span style="display:inline;color:#7575f9">客户端</span> | 设置PropertyBag,将使用字典中的每个值来覆盖原本PropertyBag中的值 |
|
||||
| [SetRotatePivot](UI控件.md#setrotatepivot) | <span style="display:inline;color:#7575f9">客户端</span> | 设置图片自身旋转锚点,该点并不是固定的点,而是相对于自身位置的点 |
|
||||
| [SetScrollViewPercentValue](UI控件.md#setscrollviewpercentvalue) | <span style="display:inline;color:#7575f9">客户端</span> | 设置当前scroll_view内容的百分比位置 |
|
||||
| [SetScrollViewPos](UI控件.md#setscrollviewpos) | <span style="display:inline;color:#7575f9">客户端</span> | 设置当前scroll_view内容的位置 |
|
||||
|
||||
Reference in New Issue
Block a user