HeadTemplate

data class HeadTemplate(val size: Int = 16, val overlay: Boolean = true, val render: String = "flat", val mask: String = "square", val loading: String = "default", val failure: String = "default", val target: HeadTarget = HeadTarget())(source)

可复用的玩家头像外观;布局元素可以覆盖默认目标。 Reusable player-face style; layout elements can override its default target.

模板 ID 是 core/template/head 目录中 YAML 的顶层键,不是文件名;同一文件可定义多个模板。 A template ID is a top-level YAML key under core/template/head, not a filename. One file may define multiple templates.

Parameters

size

面部边长(像素),8–64 的 8 倍数。 / Face size in pixels, a multiple of 8 from 8 to 64.

overlay

是否显示帽子/头发外层。 / Whether to render the hat/hair layer.

render

flat 将脸和帽子叠在一起;layered 将帽子单独向左/向上偏移 1px。 / flat composites layers; layered offsets the hat 1px left/up.

mask

square、circle 或 masks/xxx.png 的 8×8 透明遮罩。 / Square, circle or an 8×8 alpha mask at masks/xxx.png.

loading

加载占位图:default 或 fallback 目录中的 PNG 名(不含扩展名)。 / Loading fallback: default or a PNG basename in the fallback directory.

failure

加载失败/无目标时的占位图,与 loading 格式相同。 / Fallback for failure/no target, using the same naming as loading.

Constructors

Link copied to clipboard
constructor(size: Int = 16, overlay: Boolean = true, render: String = "flat", mask: String = "square", loading: String = "default", failure: String = "default", target: HeadTarget = HeadTarget())

Properties

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 size: Int
Link copied to clipboard

Functions

Link copied to clipboard
fun validate()