LayoutEntityElement

data class LayoutEntityElement(anchor: GuiAnchor? = null, val layer: Int = 0, val affectBounds: Boolean = true, val condition: String? = null, val x: Int = 0, val y: Int = 0, val align: String? = null, value: String? = null, val lines: LinesConfig? = null, val list: List<String>? = null, val offset: PositionOffset? = null, val image: ElementImageEntity? = null, val head: HeadElement? = null, val avatar: AvatarElement? = null, val progress: LayoutEntityProgress? = null, val compass: CompassElement? = null, val background: ElementBackgroundEntity? = null, val font: String? = null)(source)

布局中的图片、玩家头像、文字、进度条或文字背景。 A layout element representing an image, player head, text, progress display, or text background.

anchor 是屏幕百分比;外层 x 正数向右,y 正数向上,并统一表示元素顶部。TTF 基线由字体指标自动换算。不写锚点时使用目标自身的原点。GUI 标题忽略锚点。 anchor is a screen percentage; positive outer x moves right and positive y moves up, and y consistently denotes the element's top edge. TTF baselines are derived from font metrics. Without an anchor, the target's origin is used. Inventory titles ignore anchors.

Parameters

x

相对锚点的水平像素偏移。 / Horizontal pixel offset from the anchor.

y

元素顶部相对锚点的垂直像素偏移,正数向上。 / Top-edge pixel offset from the anchor, positive upward.

head

引用 core/template/head 中的头像模板及可选目标覆盖。 / A player-head template reference and optional target override.

font

字体 ID;为空时使用布局默认字体。 / Font ID; falls back to the layout's default font.

Constructors

Link copied to clipboard
constructor(anchor: GuiAnchor? = null, layer: Int = 0, affectBounds: Boolean = true, condition: String? = null, x: Int = 0, y: Int = 0, align: String? = null, value: String? = null, lines: LinesConfig? = null, list: List<String>? = null, offset: PositionOffset? = null, image: ElementImageEntity? = null, head: HeadElement? = null, avatar: AvatarElement? = null, progress: LayoutEntityProgress? = null, compass: CompassElement? = null, background: ElementBackgroundEntity? = null, font: String? = null)

Properties

Link copied to clipboard
@SerializedName(value = "affect-bounds")
val affectBounds: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val font: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val layer: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val x: Int
Link copied to clipboard
val y: Int

Functions

Link copied to clipboard
fun asLangValue(any: Any, layoutId: String, elementId: String): String?

通过布局与元素 ID 获取本地化文本值。 Resolves the localized text value for this layout and element ID.

Link copied to clipboard

返回被限制在 0–100 的锚点副本,或 null。 Returns an anchor clamped to 0–100, or null.

Link copied to clipboard
fun validate()