FontContainer

Registry of custom TTF fonts and semantic GUI positions. Every positioned font uses two fixed providers.

Types

Link copied to clipboard
data class TtfPlacement(val anchor: GuiAnchor?, val baselineY: Int)

Functions

Link copied to clipboard
Link copied to clipboard
fun buildComponentString(fontId: String?, text: String, y: Int, anchor: GuiAnchor? = null): String
Link copied to clipboard

清空当前容器。 / Clears this registry.

Link copied to clipboard

按 ID 查找实体;不存在时返回 null。 / Looks up an entity by ID, or returns null.

Link copied to clipboard

返回 ID 到实体的映射快照。 / Returns a snapshot of the ID-to-entity map.

Link copied to clipboard

返回已注册 ID 的快照。 / Returns a snapshot of registered IDs.

Link copied to clipboard
fun positionId(fontId: String, anchor: GuiAnchor?, y: Int): Int?

Looks up a prepared TTF position from the public top-edge coordinate.

Link copied to clipboard

按 ID 注册或替换实体。 / Registers or replaces an entity by ID.

Link copied to clipboard
fun registerAnchoredTtfPlacement(anchor: GuiAnchor, topY: Int, fontId: String? = null): Int
Link copied to clipboard
fun registerTtfPlacement(anchor: GuiAnchor?, topY: Int, fontId: String? = null): Int

Registers a logical top-edge coordinate. Null anchor keeps the display target's native origin; a non-null anchor is an absolute screen percentage. Native TTF baseline conversion is internal.

Link copied to clipboard

返回实体列表快照。 / Returns a snapshot of the entities.