S-C-Link_server~ NodeBlueprint

一个节点设计图

Constructor

new NodeBlueprint(type, name)

定义一个节点

Parameters:
NameTypeDescription
typeNodeType

节点类型

namestring

节点名称,可重复

Members

name :string

节点的名称,可重复
对应UiNode.name

Type:
  • string

type :NodeType

节点的类型

Type:
  • NodeType

anchor :Vector2

节点的锚点

Type:
  • Vector2

position :Coord2

节点的位置

Type:
  • Coord2

size :Coord2

节点的大小

Type:
  • Coord2

children :Array.<NodeBlueprint>

节点的子节点

Type:
  • Array.<NodeBlueprint>

style :NodeStyle

节点的样式

Type:
  • NodeStyle

content :string

节点的内容 若不是文本/图片/输入框,保留该属性,但不生效
对于文本,为文本内容textContent
对于图片,为图片路径image
对于输入框,为输入的文本内容textContent

Type:
  • string

placeholder :string

若节点是输入框,表示占位文本内容
若不是输入框,保留该属性,但不生效

Type:
  • string

data :object

节点的自定义数据
会传到客户端中

Type:
  • object

visible

节点的可见性

tags :Array.<string>

节点的标签

Type:
  • Array.<string>

autoResize

节点自动调整尺寸的方式

pointerEventBehavior

表示界面元素对指针事件的行为方式

_event :EntityNodeEvent

节点的事件

Type:
  • EntityNodeEvent

name :string

节点的名称,可重复
对应UiNode.name

Type:
  • string

type :NodeType

节点的类型

Type:
  • NodeType

anchor :Vector2

节点的锚点

Type:
  • Vector2

position :Coord2

节点的位置

Type:
  • Coord2

size :Coord2

节点的大小

Type:
  • Coord2

children :Array.<NodeBlueprint>

节点的子节点

Type:
  • Array.<NodeBlueprint>

style :NodeStyle

节点的样式

Type:
  • NodeStyle

content :string

节点的内容 若不是文本/图片/输入框,保留该属性,但不生效
对于文本,为文本内容textContent
对于图片,为图片路径image
对于输入框,为输入的文本内容textContent

Type:
  • string

placeholder :string

若节点是输入框,表示占位文本内容
若不是输入框,保留该属性,但不生效

Type:
  • string

data :object

节点的自定义数据
会传到客户端中

Type:
  • object

visible

节点的可见性

tags :Array.<string>

节点的标签

Type:
  • Array.<string>

autoResize

节点自动调整尺寸的方式

pointerEventBehavior

表示界面元素对指针事件的行为方式

_event :EntityNodeEvent

节点的事件

Type:
  • EntityNodeEvent

Methods

clone() → {NodeBlueprint}

复制自身

Returns:
Type: 
NodeBlueprint

addEventHandler(eventName, handler, maxTimes)

添加事件监听器
暂时没什么用,因为我还没做

Parameters:
NameTypeDescription
eventNameEventName

事件类型

handlerEventCallBack

事件监听器

maxTimesnumber

事件监听器最大监听次数,超过此次数,停止监听

_pack(entity, parentId, nodeIdnullable) → {PackedNode}

打包节点,以发送到客户端
会往entity.player写入_lastNodeIndex_clientEvents属性

Parameters:
NameTypeAttributesDefaultDescription
entityGameEntity

要发送的玩家

parentIdnumber0

父节点id

nodeIdnumber<nullable>
null

节点id

Returns:
Type: 
PackedNode

clone() → {NodeBlueprint}

复制自身

Returns:
Type: 
NodeBlueprint

addEventHandler(eventName, handler, maxTimes)

添加事件监听器
暂时没什么用,因为我还没做

Parameters:
NameTypeDescription
eventNameEventName

事件类型

handlerEventCallBack

事件监听器

maxTimesnumber

事件监听器最大监听次数,超过此次数,停止监听

_pack(entity, parentId, nodeIdnullable) → {PackedNode}

打包节点,以发送到客户端
会往entity.player写入_lastNodeIndex_clientEvents属性

Parameters:
NameTypeAttributesDefaultDescription
entityGameEntity

要发送的玩家

parentIdnumber0

父节点id

nodeIdnumber<nullable>
null

节点id

Returns:
Type: 
PackedNode

S-C-Link_server~ NodeBlueprint

一个节点设计图

Constructor

new NodeBlueprint(type, name)

定义一个节点

Parameters:
NameTypeDescription
typeNodeType

节点类型

namestring

节点名称,可重复

Members

name :string

节点的名称,可重复
对应UiNode.name

Type:
  • string

type :NodeType

节点的类型

Type:
  • NodeType

anchor :Vector2

节点的锚点

Type:
  • Vector2

position :Coord2

节点的位置

Type:
  • Coord2

size :Coord2

节点的大小

Type:
  • Coord2

children :Array.<NodeBlueprint>

节点的子节点

Type:
  • Array.<NodeBlueprint>

style :NodeStyle

节点的样式

Type:
  • NodeStyle

content :string

节点的内容 若不是文本/图片/输入框,保留该属性,但不生效
对于文本,为文本内容textContent
对于图片,为图片路径image
对于输入框,为输入的文本内容textContent

Type:
  • string

placeholder :string

若节点是输入框,表示占位文本内容
若不是输入框,保留该属性,但不生效

Type:
  • string

data :object

节点的自定义数据
会传到客户端中

Type:
  • object

visible

节点的可见性

tags :Array.<string>

节点的标签

Type:
  • Array.<string>

autoResize

节点自动调整尺寸的方式

pointerEventBehavior

表示界面元素对指针事件的行为方式

_event :EntityNodeEvent

节点的事件

Type:
  • EntityNodeEvent

name :string

节点的名称,可重复
对应UiNode.name

Type:
  • string

type :NodeType

节点的类型

Type:
  • NodeType

anchor :Vector2

节点的锚点

Type:
  • Vector2

position :Coord2

节点的位置

Type:
  • Coord2

size :Coord2

节点的大小

Type:
  • Coord2

children :Array.<NodeBlueprint>

节点的子节点

Type:
  • Array.<NodeBlueprint>

style :NodeStyle

节点的样式

Type:
  • NodeStyle

content :string

节点的内容 若不是文本/图片/输入框,保留该属性,但不生效
对于文本,为文本内容textContent
对于图片,为图片路径image
对于输入框,为输入的文本内容textContent

Type:
  • string

placeholder :string

若节点是输入框,表示占位文本内容
若不是输入框,保留该属性,但不生效

Type:
  • string

data :object

节点的自定义数据
会传到客户端中

Type:
  • object

visible

节点的可见性

tags :Array.<string>

节点的标签

Type:
  • Array.<string>

autoResize

节点自动调整尺寸的方式

pointerEventBehavior

表示界面元素对指针事件的行为方式

_event :EntityNodeEvent

节点的事件

Type:
  • EntityNodeEvent

Methods

clone() → {NodeBlueprint}

复制自身

Returns:
Type: 
NodeBlueprint

addEventHandler(eventName, handler, maxTimes)

添加事件监听器
暂时没什么用,因为我还没做

Parameters:
NameTypeDescription
eventNameEventName

事件类型

handlerEventCallBack

事件监听器

maxTimesnumber

事件监听器最大监听次数,超过此次数,停止监听

_pack(entity, parentId, nodeIdnullable) → {PackedNode}

打包节点,以发送到客户端
会往entity.player写入_lastNodeIndex_clientEvents属性

Parameters:
NameTypeAttributesDefaultDescription
entityGameEntity

要发送的玩家

parentIdnumber0

父节点id

nodeIdnumber<nullable>
null

节点id

Returns:
Type: 
PackedNode

clone() → {NodeBlueprint}

复制自身

Returns:
Type: 
NodeBlueprint

addEventHandler(eventName, handler, maxTimes)

添加事件监听器
暂时没什么用,因为我还没做

Parameters:
NameTypeDescription
eventNameEventName

事件类型

handlerEventCallBack

事件监听器

maxTimesnumber

事件监听器最大监听次数,超过此次数,停止监听

_pack(entity, parentId, nodeIdnullable) → {PackedNode}

打包节点,以发送到客户端
会往entity.player写入_lastNodeIndex_clientEvents属性

Parameters:
NameTypeAttributesDefaultDescription
entityGameEntity

要发送的玩家

parentIdnumber0

父节点id

nodeIdnumber<nullable>
null

节点id

Returns:
Type: 
PackedNode