Skip to content

XML Format

This document describes the XML format used by Hudkit to define HUD layouts. You can edit this XML directly in Studio or provide it manually in offline mode.

<?xml version="1.0" encoding="UTF-8"?>
<hud>
<layout>
...
</layout>
</hud>
ElementDescription
<hud>Root element of the document
<layout>Container for all HUD elements. This has to be a direct child of <hud>

An ignored element meant for organization. Groups don’t render anything themselves but help structure your HUD defenition.

<group key="player-info">
<element>....</element>
<element>...</element>
</group>

Attributes:

AttributeTypeRequiredDescription
keystringNoIdentifier for progrematic access

Any unrecognized XML tag behaves the same as <group>. It passes through to its children without rendering anything. This means when writing XML by hand, you can use any tag name for organization.

A positioned container that holds visible content like text or images.

<element key="health" x="10" y="-20" anchor="bottom-left" align="left">
<text key="health-text">Health: %player_health%</text>
</element>

Attributes:

AttributeTypeRequiredDefaultDescription
keystringNo-Identifier for progrematic access
xintegerYes-Horizontal offset from anchor (in font pixels)
yintegerYes-Vertical offset from anchor (in font pixels)
anchorstringNocenterScreen anchor point (see Anchor Values)
alignstringNocenterText alignment (see Alignment Values)

Text content to display. Supports MiniMessage formatting and placeholders.

<text key="welcome-message">Welcome, %player_name%!</text>

Attributes:

AttributeTypeRequiredDescription
keystringNoIdentifier for progrematic access

Adds a background fill behind the parent element’s content.

<element key="score" x="0" y="0" anchor="top-center" align="center">
<background type="fill" expandX="4" expandY="2" />
<text key="score-text">Score: 100</text>
</element>

Attributes:

AttributeTypeRequiredDefaultDescription
typestringYes-Background type. Currently only fill is supported
expandXintegerNo0Horizontal padding in font pixels
expandYintegerNo0Vertical padding in font pixels
expandintegerNo0Shorthand for both expandX and expandY

The anchor attribute determines where on the screen the element is positioned relative to.

ValueDescription
top-leftTop-left corner of the screen
top-centerTop center of the screen
top-rightTop-right corner of the screen
middle-leftMiddle left of the screen
centerCenter of the screen (default)
middle-rightMiddle right of the screen
bottom-leftBottom-left corner of the screen
bottom-centerBottom center of the screen
bottom-rightBottom-right corner of the screen

The align attribute determines how text is aligned within the element.

ValueDescription
leftText aligned to the left
centerText centered (default)
rightText aligned to the right

Text content can include placeholders that are resolved at runtime. Placeholders are wrapped in percent signs:

<text key="player-info">%player_name% - %player_level%</text>

See Dynamic Content for how to implement placeholder resolution.

Text content supports MiniMessage formatting for rich text:

<text key="colored">
<![CDATA[<red>Health:</red> <green>100</green>]]>
</text>

When using angle brackets in text content, wrap it in <![CDATA[...]]> to prevent XML parsing issues.