神岛 API 文档 - ArenaPro版
    Preparing search index...

    UI文本

    UI Text

    Hierarchy (View Summary)

    Index

    Properties

    anchor: Vec2

    节点的锚点,用于确定节点的位置。

    The anchor of the node, used to determine the position of the node.

    autoResize: "X" | "Y" | "NONE" | "XY"

    节点的自动调整尺寸的方式。

    The way the node automatically resizes.

    autoWordWrap: boolean

    是否开启自动换行。

    Whether to enable automatic line wrapping.

    backgroundColor: Vec3

    节点的背景颜色。

    The background color of the node.

    backgroundOpacity: number

    节点的背景透明度。

    The background opacity of the node.

    children: readonly UiNode[]

    节点的子节点。如需要调整子节点结构,应修改子节点的parent属性。

    The child nodes of this node. To adjust the child node structure, you should modify the parent property of the child node.

    clone: () => this

    克隆节点,包括其子节点。

    Clones the node, including its children.

    事件管理器。

    Event manager.

    name: string

    该节点的标识,可重复。

    The identifier of this node, can be repeated.

    parent: UiNode

    节点的父节点,非根节点的父节点为空时,该节点将不会被渲染。

    The parent node of this node. If the parent of a non-root node is empty, the node will not be rendered.

    pointerEventBehavior: PointerEventBehavior

    配置鼠标指针事件的响应方式

    Configures the response method for mouse pointer events

    position: Coord2

    节点的位置,相对于父节点的位置。

    The position of the node, relative to the parent node.

    richText: boolean

    富文本标记,表示内容是否支持富文本格式 当前支持的xml标签有:

    • <font size="16" color="#D03737">内容</font>
    • <stroke color="#00FFFF" thickness="10" opacity="0.6">内容</stroke>

    Rich text flag, indicating whether the content supports rich text format. Currently supported XML tags are:

    • <font size="16" color="#D03737">Content</font>
    • <stroke color="#00FFFF" thickness="10" opacity="0.6">Content</stroke>
    rotation: number

    节点的旋转(角度)

    The rotation of the node (in degrees).

    size: Coord2

    节点的尺寸。

    The size of the node.

    textColor: Vec3

    节点显示的文本的颜色。

    The color of the text displayed by the node.

    textContent: string

    文本元素的内容,支持转义字符与换行,会对自身元素的自适应大小产生影响。

    • 换行后,所有受到元素大小影响的属性,均需以新的大小进行计算,
    • UiText.richText为真时,将开启富文本解析。

    The content of the text element, supports escape characters and line breaks, and will affect the adaptive size of the element itself.

    • After a line break, all properties affected by the element size need to be calculated with the new size.
    • When UiText.richText is true, rich text parsing will be enabled.
    textFontFamily: UITextFontFamily

    定义文本使用的字体。

    Defines the font used for the text.

    textFontSize: number

    节点显示的文本的字体大小。

    The font size of the text displayed by the node.

    textLineHeight: number

    文本的行高。

    The line height of the text.

    textStrokeColor: Vec3

    只读属性,定义文本的描边颜色。

    Read-only property that defines the stroke color of the text.

    textStrokeOpacity: number

    定义文本描边的不透明度。

    Defines the opacity of the text stroke.

    textStrokeThickness: number

    定义文本描边的厚度。

    Defines the thickness of the text stroke.

    textXAlignment: "Center" | "Left" | "Right"

    节点显示的文本的水平对齐方式。

    The horizontal alignment of the text displayed by the node.

    textYAlignment: "Center" | "Top" | "Bottom"

    节点显示的文本的垂直对齐方式。

    The vertical alignment of the text displayed by the node.

    uiScale: UiScale

    节点等比例缩放数据。

    Node proportional scaling data.

    visible: boolean

    节点的可见性。

    The visibility of the node.

    zIndex: number

    节点的层级,用于确定节点的渲染顺序。

    The z-index of the node, used to determine the rendering order.

    Methods