跳到主要内容

文本

API​

SetText(ID: int, text: str) -> void​

设置文本内容。

  • text:要设置的文本内容。支持 "\n" 转义换行。

GetText(ID: int) -> str​

获取文本内容。

  • returns:文本内容

SetTextColor(ID: int, color: color) -> void​

设置文本颜色。

  • color:
    • [r, g, b]:RGB 颜色(a=1)
    • [r, g, b, a]:RGBA 颜色

GetTextColor(ID: int) -> vec4​

获取文本颜色。

  • returns:文本颜色,恒为 [r, g, b, a]

SetTextSize(ID: int, size: float) -> void​

设置文本字体大小。

  • size:字体大小

GetTextSize(ID: int) -> float​

获取文本字体大小。

  • returns:文本字体大小