S-C-Link 库(客户端)
用于通过服务端渲染客户端内容的库
依赖EasyBox3Lib 0.1.6
(为什么使用Game开头的API?因为GUI是新岛专属())
- Version
- 0.0.2
- License
- MIT
- Source
- Version
- 0.0.2
- License
- MIT
- Source
Classes
- Vector2
- Vector3
- Coord2
- RGBColor
- RGBAColor
- NodeControllers
- Vector2
- Vector3
- Coord2
- RGBColor
- RGBAColor
- NodeControllers
Members
(inner, constant) EventName :string
事件类型
- string
| Name | Type | Description |
|---|---|---|
onPress | string | |
onRelease | string | |
onFocus | string | |
onBlur | string | |
onLockChange | string | |
onLockError | string |
- Source
(inner) nodeMap :Map.<number, NodeControllers>
- Map.<number, NodeControllers>
- Source
(inner, constant) EventName :string
事件类型
- string
| Name | Type | Description |
|---|---|---|
onPress | string | |
onRelease | string | |
onFocus | string | |
onBlur | string | |
onLockChange | string | |
onLockError | string |
- Source
(inner) nodeMap :Map.<number, NodeControllers>
- Map.<number, NodeControllers>
- Source
Methods
(inner) throwError(…error)
抛出错误
会在页面上创建文本节点
可以通过点击节点关闭
| Name | Type | Attributes | Description |
|---|---|---|---|
error | string | <repeatable> | 要抛出的错误 |
- Source
(inner) BSOD(…error)
抛出错误的另类方式
| Name | Type | Attributes | Description |
|---|---|---|---|
error | string | <repeatable> | 要抛出的错误 |
- Source
(inner) throwError(…error)
抛出错误
会在页面上创建文本节点
可以通过点击节点关闭
| Name | Type | Attributes | Description |
|---|---|---|---|
error | string | <repeatable> | 要抛出的错误 |
- Source
(inner) BSOD(…error)
抛出错误的另类方式
| Name | Type | Attributes | Description |
|---|---|---|---|
error | string | <repeatable> | 要抛出的错误 |
- Source
Type Definitions
NodeStyle
节点样式
| Name | Type | Description |
|---|---|---|
textXAlignment | string | | 若节点为文本,则为节点的水平对齐方式 |
textYAlignment | string | | 若节点为文本,则为节点的垂直对齐方式 |
textColor | RGBColor | 若节点为文本,则为文字颜色 |
backgroundColor | RGBAColor | 节点背景颜色 |
placeholderColor | RGBAColor | 若节点是输入框,表示占位文本背景颜色 |
zIndex | number | | 节点的层级,用于确定节点的渲染顺序。 |
textFontSize | number | 若节点为文本,则为文字字号 |
imageOpacity | number | 若节点是图片,表示图片不透明度,范围0~1 |
- Source
PackedNode
打包后的节点
| Name | Type | Attributes | Description |
|---|---|---|---|
protocols | "renderMessage" | | 事件协议,打包节点所需的协议只有 | |
id | number | 节点序号 | |
name | string | <nullable> | 节点名称,只在 |
data | object | <nullable> | 节点自定义数量,只在 |
style | NodeStyle | <nullable> | 节点样式,只在 |
content | string | <nullable> | 节点内容,只在 |
pointerEventBehavior | number | <nullable> | 界面元素对指针事件的行为方式,只在 |
autoResize | string | <nullable> | 节点自动调整尺寸的方式,只在 |
visible | boolean | <nullable> | 节点的可见性,只在 |
placeholder | string | <nullable> | 节点占位文本内容,只在 |
size | Coord2 | <nullable> | 节点大小,只在 |
position | Coord2 | <nullable> | 节点位置,只在 |
anchor | Vector2 | <nullable> | 节点锚点,只在 |
parent | number | <nullable> | 父节点id |
childern | Array.<PackedNode> | <nullable> | 子节点,只在 |
type | NodeType | <nullable> | 节点类型,只在 |
events | PackedNodeEvent | <nullable> | 打包后的节点事件 |
- Source
PackedData
打包后的数据,用于发送给服务端
要求有protocols属性指定协议
- PackedNode |
PackedClientEvent
- Source
PackedNodeEvent
打包后的节点事件
| Name | Type | Description |
|---|---|---|
onPress | boolean | 是否监听当节点被按下时,触发的事件 |
onRelease | boolean | 是否监听当节点被松开时,触发的事件 |
onFocus | boolean | 是否监听当节点为输入框,聚焦时触发的事件 |
onBlur | boolean | 是否监听当节点为输入框,失去焦点时触发的事件 |
- Source
PackedClientEvent
当节点事件被触发时,发送到服务端的数据
| Name | Type | Attributes | Description |
|---|---|---|---|
protocols | "triggeredEvent" | 事件协议,触发事件的协议为 | |
node | PackedNode | <nullable> | 节点 |
eventName | EventName | 触发的事件类型 |
- Source
NodeStyle
节点样式
| Name | Type | Description |
|---|---|---|
textXAlignment | string | | 若节点为文本,则为节点的水平对齐方式 |
textYAlignment | string | | 若节点为文本,则为节点的垂直对齐方式 |
textColor | RGBColor | 若节点为文本,则为文字颜色 |
backgroundColor | RGBAColor | 节点背景颜色 |
placeholderColor | RGBAColor | 若节点是输入框,表示占位文本背景颜色 |
zIndex | number | | 节点的层级,用于确定节点的渲染顺序。 |
textFontSize | number | 若节点为文本,则为文字字号 |
imageOpacity | number | 若节点是图片,表示图片不透明度,范围0~1 |
- Source
PackedNode
打包后的节点
| Name | Type | Attributes | Description |
|---|---|---|---|
protocols | "renderMessage" | | 事件协议,打包节点所需的协议只有 | |
id | number | 节点序号 | |
name | string | <nullable> | 节点名称,只在 |
data | object | <nullable> | 节点自定义数量,只在 |
style | NodeStyle | <nullable> | 节点样式,只在 |
content | string | <nullable> | 节点内容,只在 |
pointerEventBehavior | number | <nullable> | 界面元素对指针事件的行为方式,只在 |
autoResize | string | <nullable> | 节点自动调整尺寸的方式,只在 |
visible | boolean | <nullable> | 节点的可见性,只在 |
placeholder | string | <nullable> | 节点占位文本内容,只在 |
size | Coord2 | <nullable> | 节点大小,只在 |
position | Coord2 | <nullable> | 节点位置,只在 |
anchor | Vector2 | <nullable> | 节点锚点,只在 |
parent | number | <nullable> | 父节点id |
childern | Array.<PackedNode> | <nullable> | 子节点,只在 |
type | NodeType | <nullable> | 节点类型,只在 |
events | PackedNodeEvent | <nullable> | 打包后的节点事件 |
- Source
PackedData
打包后的数据,用于发送给服务端
要求有protocols属性指定协议
- PackedNode |
PackedClientEvent
- Source
PackedNodeEvent
打包后的节点事件
| Name | Type | Description |
|---|---|---|
onPress | boolean | 是否监听当节点被按下时,触发的事件 |
onRelease | boolean | 是否监听当节点被松开时,触发的事件 |
onFocus | boolean | 是否监听当节点为输入框,聚焦时触发的事件 |
onBlur | boolean | 是否监听当节点为输入框,失去焦点时触发的事件 |
- Source
PackedClientEvent
当节点事件被触发时,发送到服务端的数据
| Name | Type | Attributes | Description |
|---|---|---|---|
protocols | "triggeredEvent" | 事件协议,触发事件的协议为 | |
node | PackedNode | <nullable> | 节点 |
eventName | EventName | 触发的事件类型 |
- Source